linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT
@ 2021-03-18 17:02 Lyude Paul
  2021-03-18 17:49 ` Lyude Paul
  0 siblings, 1 reply; 5+ messages in thread
From: Lyude Paul @ 2021-03-18 17:02 UTC (permalink / raw)
  To: intel-gfx
  Cc: Jani Nikula, Rodrigo Vivi, Jani Nikula, Joonas Lahtinen,
	David Airlie, Daniel Vetter, Sean Paul, Aaron Ma, Dave Airlie,
	open list:DRM DRIVERS, open list

Looks like that there actually are another subset of laptops on the market
that don't support the Intel HDR backlight interface, but do advertise
support for the VESA DPCD backlight interface despite the fact it doesn't
seem to work.

Note though I'm not entirely clear on this - on one of the machines where
this issue was observed, I also noticed that we appeared to be rejecting
the VBT defined backlight frequency in
intel_dp_aux_vesa_calc_max_backlight(). It's noted in this function that:

/* Use highest possible value of Pn for more granularity of brightness
 * adjustment while satifying the conditions below.
 * ...
 * - FxP is within 25% of desired value.
 *   Note: 25% is arbitrary value and may need some tweak.
 */

So it's possible that this value might just need to be tweaked, but for now
let's just disable the VESA backlight interface unless it's specified in
the VBT just to be safe. We might be able to try enabling this again by
default in the future.

Fixes: 2227816e647a ("drm/i915/dp: Allow forcing specific interfaces through enable_dpcd_backlight")
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3169
Signed-off-by: Lyude Paul <lyude@redhat.com>
---
 drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 1 -
 1 file changed, 1 deletion(-)

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 651884390137..4f8337c7fd2e 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -646,7 +646,6 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector)
 			break;
 		case INTEL_BACKLIGHT_DISPLAY_DDI:
 			try_intel_interface = true;
-			try_vesa_interface = true;
 			break;
 		default:
 			return -ENODEV;
-- 
2.29.2


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT
  2021-03-18 17:02 [PATCH] drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT Lyude Paul
@ 2021-03-18 17:49 ` Lyude Paul
  2021-03-23 14:06   ` Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Lyude Paul @ 2021-03-18 17:49 UTC (permalink / raw)
  To: intel-gfx
  Cc: Jani Nikula, Rodrigo Vivi, Jani Nikula, Joonas Lahtinen,
	David Airlie, Daniel Vetter, Sean Paul, Aaron Ma, Dave Airlie,
	open list:DRM DRIVERS, open list

Actually-NAK this. I just realized I've been misreading the bug and that this
doesn't actually seem to be fixed. Will resend once I figure out what's going on

On Thu, 2021-03-18 at 13:02 -0400, Lyude Paul wrote:
> Looks like that there actually are another subset of laptops on the market
> that don't support the Intel HDR backlight interface, but do advertise
> support for the VESA DPCD backlight interface despite the fact it doesn't
> seem to work.
> 
> Note though I'm not entirely clear on this - on one of the machines where
> this issue was observed, I also noticed that we appeared to be rejecting
> the VBT defined backlight frequency in
> intel_dp_aux_vesa_calc_max_backlight(). It's noted in this function that:
> 
> /* Use highest possible value of Pn for more granularity of brightness
>  * adjustment while satifying the conditions below.
>  * ...
>  * - FxP is within 25% of desired value.
>  *   Note: 25% is arbitrary value and may need some tweak.
>  */
> 
> So it's possible that this value might just need to be tweaked, but for now
> let's just disable the VESA backlight interface unless it's specified in
> the VBT just to be safe. We might be able to try enabling this again by
> default in the future.
> 
> Fixes: 2227816e647a ("drm/i915/dp: Allow forcing specific interfaces through
> enable_dpcd_backlight")
> Cc: Jani Nikula <jani.nikula@intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3169
> Signed-off-by: Lyude Paul <lyude@redhat.com>
> ---
>  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> 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 651884390137..4f8337c7fd2e 100644
> --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> @@ -646,7 +646,6 @@ int intel_dp_aux_init_backlight_funcs(struct
> intel_connector *connector)
>                         break;
>                 case INTEL_BACKLIGHT_DISPLAY_DDI:
>                         try_intel_interface = true;
> -                       try_vesa_interface = true;
>                         break;
>                 default:
>                         return -ENODEV;

-- 
Sincerely,
   Lyude Paul (she/her)
   Software Engineer at Red Hat
   
Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT
  2021-03-18 17:49 ` Lyude Paul
@ 2021-03-23 14:06   ` Jani Nikula
  2021-03-23 17:19     ` Lyude Paul
  0 siblings, 1 reply; 5+ messages in thread
From: Jani Nikula @ 2021-03-23 14:06 UTC (permalink / raw)
  To: lyude, intel-gfx
  Cc: Rodrigo Vivi, Joonas Lahtinen, David Airlie, Daniel Vetter,
	Sean Paul, Aaron Ma, Dave Airlie, open list:DRM DRIVERS,
	open list

On Thu, 18 Mar 2021, Lyude Paul <lyude@redhat.com> wrote:
> Actually-NAK this. I just realized I've been misreading the bug and that this
> doesn't actually seem to be fixed. Will resend once I figure out what's going on

Well, I think there are actually multiple issues on multiple
machines. This fixes the issue on ThinkPad X1 Titanium Gen1 [1].

I suspect reverting 98e497e203a5 ("drm/i915/dpcd_bl: uncheck PWM_PIN_CAP
when detect eDP backlight capabilities") would too. But then that would
break *other* machines that claim support for *both* eDP PWM pin and
DPCD backlight control, I think.

I think there are issues with how we try setup DPCD backlight if the GOP
has set up PWM backlight. For example, we don't set the backlight
control mode correctly until the next disable/enable sequence. However,
I tried to fix this, and I think I was doing all the right things, and
DPCD reads seemed to confirm this, yet I was not able to control
brightness using DPCD. I don't know what gives, but I do know eDP PWM
pin control works.


BR,
Jani.


[1] https://gitlab.freedesktop.org/drm/intel/-/issues/3158


>
> On Thu, 2021-03-18 at 13:02 -0400, Lyude Paul wrote:
>> Looks like that there actually are another subset of laptops on the market
>> that don't support the Intel HDR backlight interface, but do advertise
>> support for the VESA DPCD backlight interface despite the fact it doesn't
>> seem to work.
>> 
>> Note though I'm not entirely clear on this - on one of the machines where
>> this issue was observed, I also noticed that we appeared to be rejecting
>> the VBT defined backlight frequency in
>> intel_dp_aux_vesa_calc_max_backlight(). It's noted in this function that:
>> 
>> /* Use highest possible value of Pn for more granularity of brightness
>>  * adjustment while satifying the conditions below.
>>  * ...
>>  * - FxP is within 25% of desired value.
>>  *   Note: 25% is arbitrary value and may need some tweak.
>>  */
>> 
>> So it's possible that this value might just need to be tweaked, but for now
>> let's just disable the VESA backlight interface unless it's specified in
>> the VBT just to be safe. We might be able to try enabling this again by
>> default in the future.
>> 
>> Fixes: 2227816e647a ("drm/i915/dp: Allow forcing specific interfaces through
>> enable_dpcd_backlight")
>> Cc: Jani Nikula <jani.nikula@intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3169
>> Signed-off-by: Lyude Paul <lyude@redhat.com>
>> ---
>>  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 1 -
>>  1 file changed, 1 deletion(-)
>> 
>> 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 651884390137..4f8337c7fd2e 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
>> @@ -646,7 +646,6 @@ int intel_dp_aux_init_backlight_funcs(struct
>> intel_connector *connector)
>>                         break;
>>                 case INTEL_BACKLIGHT_DISPLAY_DDI:
>>                         try_intel_interface = true;
>> -                       try_vesa_interface = true;
>>                         break;
>>                 default:
>>                         return -ENODEV;

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT
  2021-03-23 14:06   ` Jani Nikula
@ 2021-03-23 17:19     ` Lyude Paul
  2021-04-06 18:43       ` [Intel-gfx] " Jani Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Lyude Paul @ 2021-03-23 17:19 UTC (permalink / raw)
  To: Jani Nikula, intel-gfx
  Cc: Rodrigo Vivi, Joonas Lahtinen, David Airlie, Daniel Vetter,
	Sean Paul, Aaron Ma, Dave Airlie, open list:DRM DRIVERS,
	open list

On Tue, 2021-03-23 at 16:06 +0200, Jani Nikula wrote:
> On Thu, 18 Mar 2021, Lyude Paul <lyude@redhat.com> wrote:
> > Actually-NAK this. I just realized I've been misreading the bug and that
> > this
> > doesn't actually seem to be fixed. Will resend once I figure out what's
> > going on
> 
> Well, I think there are actually multiple issues on multiple
> machines. This fixes the issue on ThinkPad X1 Titanium Gen1 [1].
> 
> I suspect reverting 98e497e203a5 ("drm/i915/dpcd_bl: uncheck PWM_PIN_CAP
> when detect eDP backlight capabilities") would too. But then that would
> break *other* machines that claim support for *both* eDP PWM pin and
> DPCD backlight control, I think.
> 
> I think there are issues with how we try setup DPCD backlight if the GOP
> has set up PWM backlight. For example, we don't set the backlight
> control mode correctly until the next disable/enable sequence. However,
> I tried to fix this, and I think I was doing all the right things, and
> DPCD reads seemed to confirm this, yet I was not able to control
> brightness using DPCD. I don't know what gives, but I do know eDP PWM
> pin control works.

Should we go ahead and push the VESA fix for this then? If you're willing to
test future patches on that machine, we could give another shot at enabling this
in the future if we find reason to.

> 
> 
> BR,
> Jani.
> 
> 
> [1] https://gitlab.freedesktop.org/drm/intel/-/issues/3158
> 
> 
> > 
> > On Thu, 2021-03-18 at 13:02 -0400, Lyude Paul wrote:
> > > Looks like that there actually are another subset of laptops on the market
> > > that don't support the Intel HDR backlight interface, but do advertise
> > > support for the VESA DPCD backlight interface despite the fact it doesn't
> > > seem to work.
> > > 
> > > Note though I'm not entirely clear on this - on one of the machines where
> > > this issue was observed, I also noticed that we appeared to be rejecting
> > > the VBT defined backlight frequency in
> > > intel_dp_aux_vesa_calc_max_backlight(). It's noted in this function that:
> > > 
> > > /* Use highest possible value of Pn for more granularity of brightness
> > >  * adjustment while satifying the conditions below.
> > >  * ...
> > >  * - FxP is within 25% of desired value.
> > >  *   Note: 25% is arbitrary value and may need some tweak.
> > >  */
> > > 
> > > So it's possible that this value might just need to be tweaked, but for
> > > now
> > > let's just disable the VESA backlight interface unless it's specified in
> > > the VBT just to be safe. We might be able to try enabling this again by
> > > default in the future.
> > > 
> > > Fixes: 2227816e647a ("drm/i915/dp: Allow forcing specific interfaces
> > > through
> > > enable_dpcd_backlight")
> > > Cc: Jani Nikula <jani.nikula@intel.com>
> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3169
> > > Signed-off-by: Lyude Paul <lyude@redhat.com>
> > > ---
> > >  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 1 -
> > >  1 file changed, 1 deletion(-)
> > > 
> > > 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 651884390137..4f8337c7fd2e 100644
> > > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
> > > @@ -646,7 +646,6 @@ int intel_dp_aux_init_backlight_funcs(struct
> > > intel_connector *connector)
> > >                         break;
> > >                 case INTEL_BACKLIGHT_DISPLAY_DDI:
> > >                         try_intel_interface = true;
> > > -                       try_vesa_interface = true;
> > >                         break;
> > >                 default:
> > >                         return -ENODEV;
> 

-- 
Sincerely,
   Lyude Paul (she/her)
   Software Engineer at Red Hat
   
Note: I deal with a lot of emails and have a lot of bugs on my plate. If you've
asked me a question, are waiting for a review/merge on a patch, etc. and I
haven't responded in a while, please feel free to send me another email to check
on my status. I don't bite!


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [Intel-gfx] [PATCH] drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT
  2021-03-23 17:19     ` Lyude Paul
@ 2021-04-06 18:43       ` Jani Nikula
  0 siblings, 0 replies; 5+ messages in thread
From: Jani Nikula @ 2021-04-06 18:43 UTC (permalink / raw)
  To: lyude, intel-gfx
  Cc: David Airlie, open list, open list:DRM DRIVERS, Sean Paul,
	Aaron Ma, Dave Airlie

On Tue, 23 Mar 2021, Lyude Paul <lyude@redhat.com> wrote:
> On Tue, 2021-03-23 at 16:06 +0200, Jani Nikula wrote:
>> On Thu, 18 Mar 2021, Lyude Paul <lyude@redhat.com> wrote:
>> > Actually-NAK this. I just realized I've been misreading the bug and that
>> > this
>> > doesn't actually seem to be fixed. Will resend once I figure out what's
>> > going on
>> 
>> Well, I think there are actually multiple issues on multiple
>> machines. This fixes the issue on ThinkPad X1 Titanium Gen1 [1].
>> 
>> I suspect reverting 98e497e203a5 ("drm/i915/dpcd_bl: uncheck PWM_PIN_CAP
>> when detect eDP backlight capabilities") would too. But then that would
>> break *other* machines that claim support for *both* eDP PWM pin and
>> DPCD backlight control, I think.
>> 
>> I think there are issues with how we try setup DPCD backlight if the GOP
>> has set up PWM backlight. For example, we don't set the backlight
>> control mode correctly until the next disable/enable sequence. However,
>> I tried to fix this, and I think I was doing all the right things, and
>> DPCD reads seemed to confirm this, yet I was not able to control
>> brightness using DPCD. I don't know what gives, but I do know eDP PWM
>> pin control works.
>
> Should we go ahead and push the VESA fix for this then? If you're willing to
> test future patches on that machine, we could give another shot at enabling this
> in the future if we find reason to.

Yes, let's go with this first.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>
>> 
>> 
>> BR,
>> Jani.
>> 
>> 
>> [1] https://gitlab.freedesktop.org/drm/intel/-/issues/3158
>> 
>> 
>> > 
>> > On Thu, 2021-03-18 at 13:02 -0400, Lyude Paul wrote:
>> > > Looks like that there actually are another subset of laptops on the market
>> > > that don't support the Intel HDR backlight interface, but do advertise
>> > > support for the VESA DPCD backlight interface despite the fact it doesn't
>> > > seem to work.
>> > > 
>> > > Note though I'm not entirely clear on this - on one of the machines where
>> > > this issue was observed, I also noticed that we appeared to be rejecting
>> > > the VBT defined backlight frequency in
>> > > intel_dp_aux_vesa_calc_max_backlight(). It's noted in this function that:
>> > > 
>> > > /* Use highest possible value of Pn for more granularity of brightness
>> > >  * adjustment while satifying the conditions below.
>> > >  * ...
>> > >  * - FxP is within 25% of desired value.
>> > >  *   Note: 25% is arbitrary value and may need some tweak.
>> > >  */
>> > > 
>> > > So it's possible that this value might just need to be tweaked, but for
>> > > now
>> > > let's just disable the VESA backlight interface unless it's specified in
>> > > the VBT just to be safe. We might be able to try enabling this again by
>> > > default in the future.
>> > > 
>> > > Fixes: 2227816e647a ("drm/i915/dp: Allow forcing specific interfaces
>> > > through
>> > > enable_dpcd_backlight")
>> > > Cc: Jani Nikula <jani.nikula@intel.com>
>> > > Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> > > Bugzilla: https://gitlab.freedesktop.org/drm/intel/-/issues/3169
>> > > Signed-off-by: Lyude Paul <lyude@redhat.com>
>> > > ---
>> > >  drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 1 -
>> > >  1 file changed, 1 deletion(-)
>> > > 
>> > > 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 651884390137..4f8337c7fd2e 100644
>> > > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
>> > > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
>> > > @@ -646,7 +646,6 @@ int intel_dp_aux_init_backlight_funcs(struct
>> > > intel_connector *connector)
>> > >                         break;
>> > >                 case INTEL_BACKLIGHT_DISPLAY_DDI:
>> > >                         try_intel_interface = true;
>> > > -                       try_vesa_interface = true;
>> > >                         break;
>> > >                 default:
>> > >                         return -ENODEV;
>> 

-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2021-04-06 18:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-18 17:02 [PATCH] drm/i915/dpcd_bl: Don't try vesa interface unless specified by VBT Lyude Paul
2021-03-18 17:49 ` Lyude Paul
2021-03-23 14:06   ` Jani Nikula
2021-03-23 17:19     ` Lyude Paul
2021-04-06 18:43       ` [Intel-gfx] " Jani Nikula

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).