Skip to content

Commit 81fd014

Browse files
committed
drm/dp: Add argument for max luminance in drm_edp_backlight_init
Add new argument to drm_edp_backlight_init which gives the max_luminance which will be needed to set the max values for backlight. --v2 -Use pass only max luminance instead of luminance_range_info struct [Arun] 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-4-suraj.kandpal@intel.com
1 parent c802a6b commit 81fd014

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

drivers/gpu/drm/display/drm_dp_helper.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4235,6 +4235,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
42354235
* interface.
42364236
* @aux: The DP aux device to use for probing
42374237
* @bl: The &drm_edp_backlight_info struct to fill out with information on the backlight
4238+
* @max_luminance: max luminance when need luminance is set as true
42384239
* @driver_pwm_freq_hz: Optional PWM frequency from the driver in hz
42394240
* @edp_dpcd: A cached copy of the eDP DPCD
42404241
* @current_level: Where to store the probed brightness level, if any
@@ -4251,6 +4252,7 @@ drm_edp_backlight_probe_state(struct drm_dp_aux *aux, struct drm_edp_backlight_i
42514252
*/
42524253
int
42534254
drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
4255+
u32 max_luminance,
42544256
u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
42554257
u16 *current_level, u8 *current_mode, bool need_luminance)
42564258
{
@@ -4380,7 +4382,7 @@ int drm_panel_dp_aux_backlight(struct drm_panel *panel, struct drm_dp_aux *aux)
43804382

43814383
bl->aux = aux;
43824384

4383-
ret = drm_edp_backlight_init(aux, &bl->info, 0, edp_dpcd,
4385+
ret = drm_edp_backlight_init(aux, &bl->info, 0, 0, edp_dpcd,
43844386
&current_level, &current_mode, false);
43854387
if (ret < 0)
43864388
return ret;

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -599,8 +599,10 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
599599
connector->base.base.id, connector->base.name);
600600
} else {
601601
ret = drm_edp_backlight_init(&intel_dp->aux, &panel->backlight.edp.vesa.info,
602-
panel->vbt.backlight.pwm_freq_hz, intel_dp->edp_dpcd,
603-
&current_level, &current_mode, false);
602+
luminance_range->max_luminance,
603+
panel->vbt.backlight.pwm_freq_hz,
604+
intel_dp->edp_dpcd, &current_level, &current_mode,
605+
false);
604606
if (ret < 0)
605607
return ret;
606608

drivers/gpu/drm/nouveau/nouveau_backlight.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ nv50_backlight_init(struct nouveau_backlight *bl,
261261
NV_DEBUG(drm, "DPCD backlight controls supported on %s\n",
262262
nv_conn->base.name);
263263

264-
ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info, 0, edp_dpcd,
264+
ret = drm_edp_backlight_init(&nv_conn->aux, &bl->edp_info,
265+
0, 0, edp_dpcd,
265266
&current_level, &current_mode, false);
266267
if (ret < 0)
267268
return ret;

include/drm/display/drm_dp_helper.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -854,6 +854,7 @@ struct drm_edp_backlight_info {
854854

855855
int
856856
drm_edp_backlight_init(struct drm_dp_aux *aux, struct drm_edp_backlight_info *bl,
857+
u32 max_luminance,
857858
u16 driver_pwm_freq_hz, const u8 edp_dpcd[EDP_DISPLAY_CTL_CAP_SIZE],
858859
u16 *current_level, u8 *current_mode, bool need_luminance);
859860
int drm_edp_backlight_set_level(struct drm_dp_aux *aux, const struct drm_edp_backlight_info *bl,

0 commit comments

Comments
 (0)