disp: msm: specify default value for msm enum property

Allow caller to specify the default value of the enum
property while installing with msm prop layer. It is
not always the case that the default value to be the
first entry.

Change-Id: Ie0bb1ad7479e3e07810b3d817fdf618b1935858c
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
This commit is contained in:
Jeykumar Sankaran
2020-05-27 18:20:13 -07:00
부모 fdf88f7853
커밋 b87b13690b
6개의 변경된 파일23개의 추가작업 그리고 20개의 파일을 삭제

파일 보기

@@ -1,6 +1,6 @@
// SPDX-License-Identifier: GPL-2.0-only
/*
* Copyright (c) 2016-2019, The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
*/
#include "msm_prop.h"
@@ -203,7 +203,7 @@ void msm_property_install_volatile_range(struct msm_property_info *info,
void msm_property_install_enum(struct msm_property_info *info,
const char *name, int flags, int is_bitmask,
const struct drm_prop_enum_list *values, int num_values,
uint32_t property_idx)
u32 init_idx, uint32_t property_idx)
{
struct drm_property **prop;
@@ -239,10 +239,10 @@ void msm_property_install_enum(struct msm_property_info *info,
info->property_data[property_idx].default_value = 0;
info->property_data[property_idx].force_dirty = false;
/* select first defined value for enums */
if (!is_bitmask)
/* initialize with the given idx if valid */
if (!is_bitmask && init_idx && (init_idx < num_values))
info->property_data[property_idx].default_value =
values->type;
values[init_idx].type;
/* always attach property, if created */
if (*prop) {