[Intel-gfx] [PATCH 1/2] drm/i915/backlight: Drop duplicate intel_panel_actually_set_backlight()

Hans de Goede hdegoede at redhat.com
Thu Dec 16 15:14:45 UTC 2021


Hi,

On 11/21/21 12:00, Hans de Goede wrote:
> After the recent refactoring of the backlight code the contents of
> intel_panel_actually_set_backlight() is exactly the same (minus a
> small wording difference in the drm_dbg_kms() as the contents if the
> more widely used intel_backlight_set_pwm_level() function.
> 
> Drop the duplicate intel_panel_actually_set_backlight() function.
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>

I just realized that I did not push this series to drm-intel-next yet.

Before pushing I double checked my work and I noticed that this patch
is wrong there is a subtle but important difference between
intel_panel_actually_set_backlight() and intel_backlight_set_pwm_level()

intel_panel_actually_set_backlight() calls:

	panel->backlight.funcs->set(conn_state, level);

where as intel_backlight_set_pwm_level() calls:

	panel->backlight.pwm_funcs->set(conn_state, level);

I missed the pwm_funcs vs funcs difference, the funcs->set
function is normally just a wrapper for pwm_funcs->set, but
the dp_aux and dsi_dsc code my overwrite the functions to
which backlight.funcs point to so the difference matters.

Tl;DR: self nack for this one.

Patch 2/2 is still valid and I will push that out shortly.

Regards,

Hans





> ---
>  drivers/gpu/drm/i915/display/intel_backlight.c | 16 ++--------------
>  1 file changed, 2 insertions(+), 14 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_backlight.c b/drivers/gpu/drm/i915/display/intel_backlight.c
> index 9523411cddd8..03cd730c926a 100644
> --- a/drivers/gpu/drm/i915/display/intel_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_backlight.c
> @@ -268,18 +268,6 @@ static void ext_pwm_set_backlight(const struct drm_connector_state *conn_state,
>  	pwm_apply_state(panel->backlight.pwm, &panel->backlight.pwm_state);
>  }
>  
> -static void
> -intel_panel_actually_set_backlight(const struct drm_connector_state *conn_state, u32 level)
> -{
> -	struct intel_connector *connector = to_intel_connector(conn_state->connector);
> -	struct drm_i915_private *i915 = to_i915(connector->base.dev);
> -	struct intel_panel *panel = &connector->panel;
> -
> -	drm_dbg_kms(&i915->drm, "set backlight level = %d\n", level);
> -
> -	panel->backlight.funcs->set(conn_state, level);
> -}
> -
>  /* set backlight brightness to level in range [0..max], assuming hw min is
>   * respected.
>   */
> @@ -314,7 +302,7 @@ void intel_backlight_set_acpi(const struct drm_connector_state *conn_state,
>  					 panel->backlight.device->props.max_brightness);
>  
>  	if (panel->backlight.enabled)
> -		intel_panel_actually_set_backlight(conn_state, hw_level);
> +		intel_backlight_set_pwm_level(conn_state, hw_level);
>  
>  	mutex_unlock(&dev_priv->backlight_lock);
>  }
> @@ -863,7 +851,7 @@ static void intel_panel_set_backlight(const struct drm_connector_state *conn_sta
>  	panel->backlight.level = hw_level;
>  
>  	if (panel->backlight.enabled)
> -		intel_panel_actually_set_backlight(conn_state, hw_level);
> +		intel_backlight_set_pwm_level(conn_state, hw_level);
>  
>  	mutex_unlock(&dev_priv->backlight_lock);
>  }
> 



More information about the Intel-gfx mailing list