summaryrefslogtreecommitdiff
path: root/drivers/gpu
diff options
context:
space:
mode:
authorClarence Ip <cip@codeaurora.org>2017-09-08 15:47:26 -0400
committerLakshmi Narayana Kalavala <lkalaval@codeaurora.org>2018-03-09 14:28:51 -0800
commit777a58fa41cfb69c8f0945043ae36db66c4ecdb4 (patch)
treececf14cafe061ba6dd886bc9e11167723cb6f2d9 /drivers/gpu
parent07324253e2e621c2cf54105c5612e341a9f305ad (diff)
drm/msm: init enum properties to default value
Initialize DRM/KMS enumeration properties to the first defined value rather than 0 since enumeration properties are meant to store the actual value rather than simply an enumeration index. Change-Id: I23dd62308a2d3a45c763090b6f0557634ed49d63 Signed-off-by: Clarence Ip <cip@codeaurora.org>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/msm/msm_prop.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/gpu/drm/msm/msm_prop.c b/drivers/gpu/drm/msm/msm_prop.c
index 10f89de25831..02ed2b7a062f 100644
--- a/drivers/gpu/drm/msm/msm_prop.c
+++ b/drivers/gpu/drm/msm/msm_prop.c
@@ -340,9 +340,16 @@ void msm_property_install_enum(struct msm_property_info *info,
info->property_data[property_idx].default_value = default_value;
info->property_data[property_idx].force_dirty = false;
+ /* select first defined value for enums */
+ if (!is_bitmask)
+ info->property_data[property_idx].default_value =
+ values->type;
+
/* always attach property, if created */
if (*prop) {
- drm_object_attach_property(info->base, *prop, 0);
+ drm_object_attach_property(info->base, *prop,
+ info->property_data
+ [property_idx].default_value);
++info->install_count;
}
}