Re: [PATCH] drm/i915: set min brightness for aux backlight interface.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 19 Apr 2021, Lee Shawn C <shawn.c.lee@xxxxxxxxx> wrote:
> Min brightness level for aux backlight interface is always zero.
> Driver should refer to VBT's setting to configure proper minimum
> level just like PWM backlight interface.

Unfortunately this change makes it harder for Lyude to extract the dpcd
backlight code from i915 to drm helpers, and I think the min brightness
should be handled after or in connection with that change.

BR,
Jani.


>
> Cc: Jani Nikula <jani.nikula@xxxxxxxxxxxxxxx>
> Cc: Ville Syrjala <ville.syrjala@xxxxxxxxxxxxxxx>
> Cc: Lyude Paul <lyude@xxxxxxxxxx>
> Cc: Cooper Chiou <cooper.chiou@xxxxxxxxx>
>
> Signed-off-by: Lee Shawn C <shawn.c.lee@xxxxxxxxx>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 2 +-
>  drivers/gpu/drm/i915/display/intel_panel.c            | 2 +-
>  drivers/gpu/drm/i915/display/intel_panel.h            | 1 +
>  3 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> index 4f8337c7fd2e..efd8fa155105 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> @@ -571,7 +571,7 @@ static int intel_dp_aux_vesa_setup_backlight(struct intel_connector *connector,
>  	if (!panel->backlight.max)
>  		return -ENODEV;
>  
> -	panel->backlight.min = 0;
> +	panel->backlight.min = get_backlight_min_vbt(connector);
>  	panel->backlight.level = intel_dp_aux_vesa_get_backlight(connector, pipe);
>  	panel->backlight.enabled = intel_dp_aux_vesa_backlight_dpcd_mode(connector) &&
>  				   panel->backlight.level != 0;
> diff --git a/drivers/gpu/drm/i915/display/intel_panel.c b/drivers/gpu/drm/i915/display/intel_panel.c
> index 551fcaa77c2c..6d58ec192a04 100644
> --- a/drivers/gpu/drm/i915/display/intel_panel.c
> +++ b/drivers/gpu/drm/i915/display/intel_panel.c
> @@ -1614,7 +1614,7 @@ static u32 get_backlight_max_vbt(struct intel_connector *connector)
>  /*
>   * Note: The setup hooks can't assume pipe is set!
>   */
> -static u32 get_backlight_min_vbt(struct intel_connector *connector)
> +u32 get_backlight_min_vbt(struct intel_connector *connector)
>  {
>  	struct drm_i915_private *dev_priv = to_i915(connector->base.dev);
>  	struct intel_panel *panel = &connector->panel;
> diff --git a/drivers/gpu/drm/i915/display/intel_panel.h b/drivers/gpu/drm/i915/display/intel_panel.h
> index 1d340f77bffc..63da4e355585 100644
> --- a/drivers/gpu/drm/i915/display/intel_panel.h
> +++ b/drivers/gpu/drm/i915/display/intel_panel.h
> @@ -53,6 +53,7 @@ void intel_panel_set_pwm_level(const struct drm_connector_state *conn_state, u32
>  u32 intel_panel_invert_pwm_level(struct intel_connector *connector, u32 level);
>  u32 intel_panel_backlight_level_to_pwm(struct intel_connector *connector, u32 level);
>  u32 intel_panel_backlight_level_from_pwm(struct intel_connector *connector, u32 val);
> +u32 get_backlight_min_vbt(struct intel_connector *connector);
>  
>  #if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)
>  int intel_backlight_device_register(struct intel_connector *connector);

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux