Skip to content

Commit aede238

Browse files
committed
drm/i915/backlight: Use drm helper to set edp backlight
Now that the drm helper sets the backlight using luminance too we can use that. Remove the obselete function. Signed-off-by: Suraj Kandpal <[email protected]> Reviewed-by: Arun R Murthy <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent e13af51 commit aede238

File tree

1 file changed

+3
-31
lines changed

1 file changed

+3
-31
lines changed

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

Lines changed: 3 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -475,43 +475,13 @@ static u32 intel_dp_aux_vesa_get_backlight(struct intel_connector *connector, en
475475
return connector->panel.backlight.level;
476476
}
477477

478-
static int
479-
intel_dp_aux_vesa_set_luminance(struct intel_connector *connector, u32 level)
480-
{
481-
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
482-
u8 buf[3];
483-
int ret;
484-
485-
level = level * 1000;
486-
level &= 0xffffff;
487-
buf[0] = (level & 0x0000ff);
488-
buf[1] = (level & 0x00ff00) >> 8;
489-
buf[2] = (level & 0xff0000) >> 16;
490-
491-
ret = drm_dp_dpcd_write(&intel_dp->aux, DP_EDP_PANEL_TARGET_LUMINANCE_VALUE,
492-
buf, sizeof(buf));
493-
if (ret != sizeof(buf)) {
494-
drm_err(intel_dp->aux.drm_dev,
495-
"%s: Failed to set VESA Aux Luminance: %d\n",
496-
intel_dp->aux.name, ret);
497-
return -EINVAL;
498-
} else {
499-
return 0;
500-
}
501-
}
502-
503478
static void
504479
intel_dp_aux_vesa_set_backlight(const struct drm_connector_state *conn_state, u32 level)
505480
{
506481
struct intel_connector *connector = to_intel_connector(conn_state->connector);
507482
struct intel_panel *panel = &connector->panel;
508483
struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
509484

510-
if (panel->backlight.edp.vesa.luminance_control_support) {
511-
if (!intel_dp_aux_vesa_set_luminance(connector, level))
512-
return;
513-
}
514-
515485
if (!panel->backlight.edp.vesa.info.aux_set) {
516486
const u32 pwm_level = intel_backlight_level_to_pwm(connector, level);
517487

@@ -537,7 +507,9 @@ intel_dp_aux_vesa_enable_backlight(const struct intel_crtc_state *crtc_state,
537507
if (ret == 1)
538508
return;
539509

540-
if (!intel_dp_aux_vesa_set_luminance(connector, level))
510+
if (!drm_edp_backlight_set_level(&intel_dp->aux,
511+
&panel->backlight.edp.vesa.info,
512+
level))
541513
return;
542514
}
543515

0 commit comments

Comments
 (0)