diff mbox series

[7/7] drm/i915/dp: Limit brightness level to 20

Message ID 20240404032931.380887-9-suraj.kandpal@intel.com (mailing list archive)
State New, archived
Headers show
Series Enable Aux Based EDP HDR | expand

Commit Message

Suraj Kandpal April 4, 2024, 3:29 a.m. UTC
Limit minimum brightness to 20 when using aux based brightness
control to avoid letting the screen going completely blank.

Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
---
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jani Nikula April 4, 2024, 9:04 a.m. UTC | #1
On Thu, 04 Apr 2024, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> Limit minimum brightness to 20 when using aux based brightness
> control to avoid letting the screen going completely blank.

Why "20"? What does it mean? Why don't we have this in the VBT like for
PWM backlight?

>
> Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> 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 20dd5a6a0f3f..b54ea7e46954 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> @@ -211,6 +211,9 @@ intel_dp_aux_hdr_set_aux_backlight(const struct drm_connector_state *conn_state,
>  	struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
>  	u8 buf[4] = {};
>  
> +	if (level < 20)
> +		level = 20;
> +
>  	buf[0] = level & 0xFF;
>  	buf[1] = (level & 0xFF00) >> 8;
Suraj Kandpal April 4, 2024, 10:15 a.m. UTC | #2
> -----Original Message-----
> From: Jani Nikula <jani.nikula@linux.intel.com>
> Sent: Thursday, April 4, 2024 2:34 PM
> To: Kandpal, Suraj <suraj.kandpal@intel.com>; intel-gfx@lists.freedesktop.org
> Cc: Borah, Chaitanya Kumar <chaitanya.kumar.borah@intel.com>; Shankar,
> Uma <uma.shankar@intel.com>; Nautiyal, Ankit K
> <ankit.k.nautiyal@intel.com>; Murthy, Arun R <arun.r.murthy@intel.com>;
> Syrjala, Ville <ville.syrjala@intel.com>; Kumar, Naveen1
> <naveen1.kumar@intel.com>; sebastian.wick@redhat.com; Kandpal, Suraj
> <suraj.kandpal@intel.com>
> Subject: Re: [PATCH 7/7] drm/i915/dp: Limit brightness level to 20
> 
> On Thu, 04 Apr 2024, Suraj Kandpal <suraj.kandpal@intel.com> wrote:
> > Limit minimum brightness to 20 when using aux based brightness control
> > to avoid letting the screen going completely blank.
> 
> Why "20"? What does it mean? Why don't we have this in the VBT like for
> PWM backlight?

That makes sense. I used 20nits as that's where I felt the minimum amount of brightness looked okay.
But yes I could use the minimum brightness that we save in intel_panel ->backlight structure

Regards,
Suraj Kandpal
> 
> >
> > Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
> > ---
> >  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > 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 20dd5a6a0f3f..b54ea7e46954 100644
> > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > @@ -211,6 +211,9 @@ intel_dp_aux_hdr_set_aux_backlight(const struct
> drm_connector_state *conn_state,
> >  	struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
> >  	u8 buf[4] = {};
> >
> > +	if (level < 20)
> > +		level = 20;
> > +
> >  	buf[0] = level & 0xFF;
> >  	buf[1] = (level & 0xFF00) >> 8;
> 
> --
> Jani Nikula, Intel
diff mbox series

Patch

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 20dd5a6a0f3f..b54ea7e46954 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -211,6 +211,9 @@  intel_dp_aux_hdr_set_aux_backlight(const struct drm_connector_state *conn_state,
 	struct intel_dp *intel_dp = enc_to_intel_dp(connector->encoder);
 	u8 buf[4] = {};
 
+	if (level < 20)
+		level = 20;
+
 	buf[0] = level & 0xFF;
 	buf[1] = (level & 0xFF00) >> 8;