Skip to content

Commit 2af612a

Browse files
committed
drm/dp: Introduce new member in drm_backlight_info
Introduce luminance_set flag which indicates if we can manipulate backlight using luminance value or not which is only possible after eDP v1.5. Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com> Reviewed-by: Arun R Murthy <arun.r.murthy@intel.com> Link: https://lore.kernel.org/r/20250620063445.3603086-2-suraj.kandpal@intel.com
1 parent 026a60e commit 2af612a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4261,11 +4261,15 @@ drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl
42614261
bl->aux_set = true;
42624262
if (edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)
42634263
bl->lsb_reg_used = true;
4264+
if ((edp_dpcd[0] & DP_EDP_15) && edp_dpcd[3] &
4265+
(DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE))
4266+
bl->luminance_set = true;
42644267

42654268
/* Sanity check caps */
4266-
if (!bl->aux_set && !(edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP)) {
4269+
if (!bl->aux_set && !(edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP) &&
4270+
!bl->luminance_set) {
42674271
drm_dbg_kms(aux->drm_dev,
4268-
"%s: Panel supports neither AUX or PWM brightness control? Aborting\n",
4272+
"%s: Panel does not support AUX, PWM or luminance-based brightness control. Aborting\n",
42694273
aux->name);
42704274
return -EINVAL;
42714275
}

include/drm/display/drm_dp_helper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ struct drm_edp_backlight_info {
849849
bool lsb_reg_used : 1;
850850
bool aux_enable : 1;
851851
bool aux_set : 1;
852+
bool luminance_set : 1;
852853
};
853854

854855
int

0 commit comments

Comments
 (0)