Skip to content

Commit c802a6b

Browse files
committed
drm/dp: Add argument in drm_edp_backlight_init
Add bool argument in drm_edp_backlight init to provide the drivers option to choose if they want to use luminance values to manipulate brightness. 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-3-suraj.kandpal@intel.com
1 parent 2af612a commit c802a6b

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4239,6 +4239,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
42394239
* @edp_dpcd: A cached copy of the eDP DPCD
42404240
* @current_level: Where to store the probed brightness level, if any
42414241
* @current_mode: Where to store the currently set backlight control mode
4242+
* @need_luminance: Tells us if a we want to manipulate backlight using luminance values
42424243
*
42434244
* Initializes a &drm_edp_backlight_info struct by probing @aux for it's backlight capabilities,
42444245
* along with also probing the current and maximum supported brightness levels.
@@ -4251,7 +4252,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
42514252
int
42524253
drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
42534254
u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
4254-
u16 *current_level, u8 *current_mode)
4255+
u16 *current_level, u8 *current_mode, bool need_luminance)
42554256
{
42564257
int ret;
42574258

@@ -4262,7 +4263,7 @@ drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl
42624263
if (edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_BYTE_COUNT)
42634264
bl->lsb_reg_used = true;
42644265
if ((edp_dpcd[0] & DP_EDP_15) && edp_dpcd[3] &
4265-
(DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE))
4266+
(DP_EDP_PANEL_LUMINANCE_CONTROL_CAPABLE) && need_luminance)
42664267
bl->luminance_set = true;
42674268

42684269
/* Sanity check caps */
@@ -4380,7 +4381,7 @@ int drm_panel_dp_aux_backlight(struct drm_panel *panel, struct drm_dp_aux *aux)
43804381
bl->aux = aux;
43814382

43824383
ret = drm_edp_backlight_init(aux, &bl->info, 0, edp_dpcd,
4383-
&current_level, &current_mode);
4384+
&current_level, &current_mode, false);
43844385
if (ret < 0)
43854386
return ret;
43864387

drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -600,7 +600,7 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
600600
} else {
601601
ret = drm_edp_backlight_init(&intel_dp->aux, &panel->backlight.edp.vesa.info,
602602
panel->vbt.backlight.pwm_freq_hz, intel_dp->edp_dpcd,
603-
&current_level, &current_mode);
603+
&current_level, &current_mode, false);
604604
if (ret < 0)
605605
return ret;
606606

drivers/gpu/drm/nouveau/nouveau_backlight.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ nv50_backlight_init(struct nouveau_backlight *bl,
262262
nv_conn->base.name);
263263

264264
ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info, 0, edp_dpcd,
265-
&current_level, &current_mode);
265+
&current_level, &current_mode, false);
266266
if (ret < 0)
267267
return ret;
268268

include/drm/display/drm_dp_helper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -855,7 +855,7 @@ struct drm_edp_backlight_info {
855855
int
856856
drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
857857
u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
858-
u16 *current_level, u8 *current_mode);
858+
u16 *current_level, u8 *current_mode, bool need_luminance);
859859
int drm_edp_backlight_set_level(struct drm_dp_aux *aux, const struct drm_edp_backlight_info *bl,
860860
u16 level);
861861
int drm_edp_backlight_enable(struct drm_dp_aux *aux, const struct drm_edp_backlight_info *bl,

0 commit comments

Comments
 (0)