diff mbox series

[1/2] drm/i915: Re-add enable_rc6 modparam

Message ID 20190514164653.935-1-stuart.summers@intel.com (mailing list archive)
State New, archived
Headers show
Series [1/2] drm/i915: Re-add enable_rc6 modparam | expand

Commit Message

Summers, Stuart May 14, 2019, 4:46 p.m. UTC
To allow easier debug of platforms which do not fully support
power-saving render C-state 6, add back the module parameter
to allow RC6 flows to be disabled. Instead of directly affecting
the RC6 states via a bitmask as done previously, use this module
parameter to clear the has_rc6 field for these platforms.

Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Suggested-by: Vinay Belgaumkar <vinay.belgaumkar@intel.com>
Signed-off-by: Stuart Summers <stuart.summers@intel.com>
---
 drivers/gpu/drm/i915/i915_params.c | 3 +++
 drivers/gpu/drm/i915/i915_params.h | 3 ++-
 drivers/gpu/drm/i915/intel_pm.c    | 3 +++
 3 files changed, 8 insertions(+), 1 deletion(-)

Comments

Chris Wilson May 14, 2019, 4:53 p.m. UTC | #1
Quoting Stuart Summers (2019-05-14 17:46:52)
> To allow easier debug of platforms which do not fully support
> power-saving render C-state 6, add back the module parameter
> to allow RC6 flows to be disabled. Instead of directly affecting
> the RC6 states via a bitmask as done previously, use this module
> parameter to clear the has_rc6 field for these platforms.

If you know which platforms don't support rc6, don't enable rc6.
-Chris
Summers, Stuart May 14, 2019, 6:32 p.m. UTC | #2
On Tue, 2019-05-14 at 17:53 +0100, Chris Wilson wrote:
> Quoting Stuart Summers (2019-05-14 17:46:52)
> > To allow easier debug of platforms which do not fully support
> > power-saving render C-state 6, add back the module parameter
> > to allow RC6 flows to be disabled. Instead of directly affecting
> > the RC6 states via a bitmask as done previously, use this module
> > parameter to clear the has_rc6 field for these platforms.
> 
> If you know which platforms don't support rc6, don't enable rc6.

I'd really prefer to have this parameter in place for debug purposes.
It seems more useful to allow quick testing by reloading i915 than by
requiring a rebuild.

Of course, once debug is complete and the platform is known to either
not support the feature or has some cripling bug around this, I agree,
rc6 shouldn't be enabled on that platform and i915 should be updated.

Thanks,
Stuart

> -Chris
Rodrigo Vivi May 15, 2019, 12:06 a.m. UTC | #3
On Tue, May 14, 2019 at 06:32:01PM +0000, Summers, Stuart wrote:
> On Tue, 2019-05-14 at 17:53 +0100, Chris Wilson wrote:
> > Quoting Stuart Summers (2019-05-14 17:46:52)
> > > To allow easier debug of platforms which do not fully support
> > > power-saving render C-state 6, add back the module parameter
> > > to allow RC6 flows to be disabled. Instead of directly affecting
> > > the RC6 states via a bitmask as done previously, use this module
> > > parameter to clear the has_rc6 field for these platforms.
> > 
> > If you know which platforms don't support rc6, don't enable rc6.
> 
> I'd really prefer to have this parameter in place for debug purposes.
> It seems more useful to allow quick testing by reloading i915 than by
> requiring a rebuild.
> 
> Of course, once debug is complete and the platform is known to either
> not support the feature or has some cripling bug around this, I agree,
> rc6 shouldn't be enabled on that platform and i915 should be updated.

Exactly. We need the flexibility for debug that.
unfortunately using debugfs doesn't look a solution.

One possibility that just came to my mind now is, what if we make
this only for platforms that are still protected by is_alpha_support=1
(soon becoming require_force_probe=1)

But this is just one side of the coin... when product is out there
and we want the user to debug the issue to see if it is a RC6 bug
we have no way to verify that. :/

Please let's add this back one way or another.

Thanks,
Rodrigo.

> 
> Thanks,
> Stuart
> 
> > -Chris



> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Tvrtko Ursulin May 15, 2019, 5:43 a.m. UTC | #4
On 15/05/2019 01:06, Rodrigo Vivi wrote:
> On Tue, May 14, 2019 at 06:32:01PM +0000, Summers, Stuart wrote:
>> On Tue, 2019-05-14 at 17:53 +0100, Chris Wilson wrote:
>>> Quoting Stuart Summers (2019-05-14 17:46:52)
>>>> To allow easier debug of platforms which do not fully support
>>>> power-saving render C-state 6, add back the module parameter
>>>> to allow RC6 flows to be disabled. Instead of directly affecting
>>>> the RC6 states via a bitmask as done previously, use this module
>>>> parameter to clear the has_rc6 field for these platforms.
>>>
>>> If you know which platforms don't support rc6, don't enable rc6.
>>
>> I'd really prefer to have this parameter in place for debug purposes.
>> It seems more useful to allow quick testing by reloading i915 than by
>> requiring a rebuild.
>>
>> Of course, once debug is complete and the platform is known to either
>> not support the feature or has some cripling bug around this, I agree,
>> rc6 shouldn't be enabled on that platform and i915 should be updated.
> 
> Exactly. We need the flexibility for debug that.
> unfortunately using debugfs doesn't look a solution.
> 
> One possibility that just came to my mind now is, what if we make
> this only for platforms that are still protected by is_alpha_support=1
> (soon becoming require_force_probe=1)
> 
> But this is just one side of the coin... when product is out there
> and we want the user to debug the issue to see if it is a RC6 bug
> we have no way to verify that. :/
> 
> Please let's add this back one way or another.

To throw a compromise option out there - add the modparam for debug 
builds only (CONFIG_DRM_I915_DEBUG)?

Regards,

Tvrtko
Summers, Stuart May 15, 2019, 2:16 p.m. UTC | #5
On Wed, 2019-05-15 at 06:43 +0100, Tvrtko Ursulin wrote:
> On 15/05/2019 01:06, Rodrigo Vivi wrote:
> > On Tue, May 14, 2019 at 06:32:01PM +0000, Summers, Stuart wrote:
> > > On Tue, 2019-05-14 at 17:53 +0100, Chris Wilson wrote:
> > > > Quoting Stuart Summers (2019-05-14 17:46:52)
> > > > > To allow easier debug of platforms which do not fully support
> > > > > power-saving render C-state 6, add back the module parameter
> > > > > to allow RC6 flows to be disabled. Instead of directly
> > > > > affecting
> > > > > the RC6 states via a bitmask as done previously, use this
> > > > > module
> > > > > parameter to clear the has_rc6 field for these platforms.
> > > > 
> > > > If you know which platforms don't support rc6, don't enable
> > > > rc6.
> > > 
> > > I'd really prefer to have this parameter in place for debug
> > > purposes.
> > > It seems more useful to allow quick testing by reloading i915
> > > than by
> > > requiring a rebuild.
> > > 
> > > Of course, once debug is complete and the platform is known to
> > > either
> > > not support the feature or has some cripling bug around this, I
> > > agree,
> > > rc6 shouldn't be enabled on that platform and i915 should be
> > > updated.
> > 
> > Exactly. We need the flexibility for debug that.
> > unfortunately using debugfs doesn't look a solution.
> > 
> > One possibility that just came to my mind now is, what if we make
> > this only for platforms that are still protected by
> > is_alpha_support=1
> > (soon becoming require_force_probe=1)
> > 
> > But this is just one side of the coin... when product is out there
> > and we want the user to debug the issue to see if it is a RC6 bug
> > we have no way to verify that. :/
> > 
> > Please let's add this back one way or another.
> 
> To throw a compromise option out there - add the modparam for debug 
> builds only (CONFIG_DRM_I915_DEBUG)?

No issues here, and makes sense. If we have concensus, I'd be happy to
add this and repost.

-Stuart

> 
> Regards,
> 
> Tvrtko
Jani Nikula May 16, 2019, 9:59 a.m. UTC | #6
On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> One possibility that just came to my mind now is, what if we make
> this only for platforms that are still protected by is_alpha_support=1
> (soon becoming require_force_probe=1)

Please don't conflate alpha_support or force_probe with *anything* else.

> But this is just one side of the coin... when product is out there
> and we want the user to debug the issue to see if it is a RC6 bug
> we have no way to verify that. :/

The problem is, if it works with rc6 disabled, it doesn't prove it's an
rc6 bug either.


BR,
Jani.
Summers, Stuart May 16, 2019, 2:10 p.m. UTC | #7
On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
> On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > One possibility that just came to my mind now is, what if we make
> > this only for platforms that are still protected by
> > is_alpha_support=1
> > (soon becoming require_force_probe=1)
> 
> Please don't conflate alpha_support or force_probe with *anything*
> else.
> 
> > But this is just one side of the coin... when product is out there
> > and we want the user to debug the issue to see if it is a RC6 bug
> > we have no way to verify that. :/
> 
> The problem is, if it works with rc6 disabled, it doesn't prove it's
> an
> rc6 bug either.

Good point. I'm not saying we should enforce a process of disabling RC6
for the platform if enable_rc6=0 results in success. I'm just saying
having the option is useful from a debug perspective. We will still
need to do the appropriate full analysis, including the normal code
review process on a pre-case basis when debug involves this parameter.
But the parameter itself is still useful.

Thanks,
Stuart

> 
> 
> BR,
> Jani.
> 
>
Jani Nikula May 16, 2019, 3:42 p.m. UTC | #8
On Thu, 16 May 2019, "Summers, Stuart" <stuart.summers@intel.com> wrote:
> On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
>> On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
>> > One possibility that just came to my mind now is, what if we make
>> > this only for platforms that are still protected by
>> > is_alpha_support=1
>> > (soon becoming require_force_probe=1)
>> 
>> Please don't conflate alpha_support or force_probe with *anything*
>> else.
>> 
>> > But this is just one side of the coin... when product is out there
>> > and we want the user to debug the issue to see if it is a RC6 bug
>> > we have no way to verify that. :/
>> 
>> The problem is, if it works with rc6 disabled, it doesn't prove it's
>> an
>> rc6 bug either.
>
> Good point. I'm not saying we should enforce a process of disabling RC6
> for the platform if enable_rc6=0 results in success. I'm just saying
> having the option is useful from a debug perspective. We will still
> need to do the appropriate full analysis, including the normal code
> review process on a pre-case basis when debug involves this parameter.
> But the parameter itself is still useful.

The trouble starts when users figure out that enable_rc6=0 works around
a particular problem they have (likely by way of disabling runtime pm,
not directly related to rc6). You could argue this is a good thing, but
unfortunately we generally never hear from them again, and the root
cause remains unsolved, with degraded user experience wrt power
management.

BR,
Jani.
Summers, Stuart May 16, 2019, 3:49 p.m. UTC | #9
On Thu, 2019-05-16 at 18:42 +0300, Jani Nikula wrote:
> On Thu, 16 May 2019, "Summers, Stuart" <stuart.summers@intel.com>
> wrote:
> > On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
> > > On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > > > One possibility that just came to my mind now is, what if we
> > > > make
> > > > this only for platforms that are still protected by
> > > > is_alpha_support=1
> > > > (soon becoming require_force_probe=1)
> > > 
> > > Please don't conflate alpha_support or force_probe with
> > > *anything*
> > > else.
> > > 
> > > > But this is just one side of the coin... when product is out
> > > > there
> > > > and we want the user to debug the issue to see if it is a RC6
> > > > bug
> > > > we have no way to verify that. :/
> > > 
> > > The problem is, if it works with rc6 disabled, it doesn't prove
> > > it's
> > > an
> > > rc6 bug either.
> > 
> > Good point. I'm not saying we should enforce a process of disabling
> > RC6
> > for the platform if enable_rc6=0 results in success. I'm just
> > saying
> > having the option is useful from a debug perspective. We will still
> > need to do the appropriate full analysis, including the normal code
> > review process on a pre-case basis when debug involves this
> > parameter.
> > But the parameter itself is still useful.
> 
> The trouble starts when users figure out that enable_rc6=0 works
> around
> a particular problem they have (likely by way of disabling runtime
> pm,
> not directly related to rc6). You could argue this is a good thing,
> but
> unfortunately we generally never hear from them again, and the root
> cause remains unsolved, with degraded user experience wrt power
> management.

So I understand the reasoning here, and agree that isn't an ideal
situation. I'd also like a way to debug more efficiently. What did you
think about the suggestion from Tvrtko to only apply on
CONFIG_DRM_I915_DEBUG?

Or we could even wrap this entirely with a CONFIG_I915_DEBUG_PM -
although I'd like to suggest we still use the module parameter, we
could just use the config option to hide the modparam under normal
operation.

Thanks,
Stuart

> 
> BR,
> Jani.
> 
>
Rodrigo Vivi May 17, 2019, 4:17 p.m. UTC | #10
On Thu, May 16, 2019 at 03:49:19PM +0000, Summers, Stuart wrote:
> On Thu, 2019-05-16 at 18:42 +0300, Jani Nikula wrote:
> > On Thu, 16 May 2019, "Summers, Stuart" <stuart.summers@intel.com>
> > wrote:
> > > On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
> > > > On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > > > > One possibility that just came to my mind now is, what if we
> > > > > make
> > > > > this only for platforms that are still protected by
> > > > > is_alpha_support=1
> > > > > (soon becoming require_force_probe=1)
> > > > 
> > > > Please don't conflate alpha_support or force_probe with
> > > > *anything*
> > > > else.
> > > > 
> > > > > But this is just one side of the coin... when product is out
> > > > > there
> > > > > and we want the user to debug the issue to see if it is a RC6
> > > > > bug
> > > > > we have no way to verify that. :/
> > > > 
> > > > The problem is, if it works with rc6 disabled, it doesn't prove
> > > > it's
> > > > an
> > > > rc6 bug either.

Well, RC6 is the main GT power gating. The issue could be on may other
individual power gating, but if by disabling RC6 the issue is gone
it is a very good indication that it is a GT-PM bug somewhere.

> > > 
> > > Good point. I'm not saying we should enforce a process of disabling
> > > RC6
> > > for the platform if enable_rc6=0 results in success. I'm just
> > > saying
> > > having the option is useful from a debug perspective. We will still
> > > need to do the appropriate full analysis, including the normal code
> > > review process on a pre-case basis when debug involves this
> > > parameter.
> > > But the parameter itself is still useful.
> > 
> > The trouble starts when users figure out that enable_rc6=0 works
> > around
> > a particular problem they have (likely by way of disabling runtime
> > pm,
> > not directly related to rc6). You could argue this is a good thing,
> > but
> > unfortunately we generally never hear from them again, and the root
> > cause remains unsolved, with degraded user experience wrt power
> > management.

This is indeed bad. We should probably be clear that by disabling that
they are draining their power and probably killing battery life.

> 
> So I understand the reasoning here, and agree that isn't an ideal
> situation. I'd also like a way to debug more efficiently. What did you
> think about the suggestion from Tvrtko to only apply on
> CONFIG_DRM_I915_DEBUG?

if debug is on and parameter is set, right? Might be a good thing to
avoid the abuse on the parameter.

> 
> Or we could even wrap this entirely with a CONFIG_I915_DEBUG_PM -
> although I'd like to suggest we still use the module parameter, we
> could just use the config option to hide the modparam under normal
> operation.

I think this looks more like you are enabling more logs and
not that you are disabling... unless the plan is to go with
this flag plus logs and traces around PM. Than I think it is
a good idea.

Same rules needs to apply to  RC6, RPM, DC states,
display power well management, psr, etc.

Thanks,
Rodrigo.

> 
> Thanks,
> Stuart
> 
> > 
> > BR,
> > Jani.
> > 
> > 



> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjala May 17, 2019, 4:34 p.m. UTC | #11
On Fri, May 17, 2019 at 09:17:39AM -0700, Rodrigo Vivi wrote:
> On Thu, May 16, 2019 at 03:49:19PM +0000, Summers, Stuart wrote:
> > On Thu, 2019-05-16 at 18:42 +0300, Jani Nikula wrote:
> > > On Thu, 16 May 2019, "Summers, Stuart" <stuart.summers@intel.com>
> > > wrote:
> > > > On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
> > > > > On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > > > > > One possibility that just came to my mind now is, what if we
> > > > > > make
> > > > > > this only for platforms that are still protected by
> > > > > > is_alpha_support=1
> > > > > > (soon becoming require_force_probe=1)
> > > > > 
> > > > > Please don't conflate alpha_support or force_probe with
> > > > > *anything*
> > > > > else.
> > > > > 
> > > > > > But this is just one side of the coin... when product is out
> > > > > > there
> > > > > > and we want the user to debug the issue to see if it is a RC6
> > > > > > bug
> > > > > > we have no way to verify that. :/
> > > > > 
> > > > > The problem is, if it works with rc6 disabled, it doesn't prove
> > > > > it's
> > > > > an
> > > > > rc6 bug either.
> 
> Well, RC6 is the main GT power gating. The issue could be on may other
> individual power gating, but if by disabling RC6 the issue is gone
> it is a very good indication that it is a GT-PM bug somewhere.

I disagree. In the recent past enable_rc6 was often used by
people to workaround display underruns and whatnot.
Rodrigo Vivi May 17, 2019, 4:44 p.m. UTC | #12
On Fri, May 17, 2019 at 07:34:23PM +0300, Ville Syrjälä wrote:
> On Fri, May 17, 2019 at 09:17:39AM -0700, Rodrigo Vivi wrote:
> > On Thu, May 16, 2019 at 03:49:19PM +0000, Summers, Stuart wrote:
> > > On Thu, 2019-05-16 at 18:42 +0300, Jani Nikula wrote:
> > > > On Thu, 16 May 2019, "Summers, Stuart" <stuart.summers@intel.com>
> > > > wrote:
> > > > > On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
> > > > > > On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > > > > > > One possibility that just came to my mind now is, what if we
> > > > > > > make
> > > > > > > this only for platforms that are still protected by
> > > > > > > is_alpha_support=1
> > > > > > > (soon becoming require_force_probe=1)
> > > > > > 
> > > > > > Please don't conflate alpha_support or force_probe with
> > > > > > *anything*
> > > > > > else.
> > > > > > 
> > > > > > > But this is just one side of the coin... when product is out
> > > > > > > there
> > > > > > > and we want the user to debug the issue to see if it is a RC6
> > > > > > > bug
> > > > > > > we have no way to verify that. :/
> > > > > > 
> > > > > > The problem is, if it works with rc6 disabled, it doesn't prove
> > > > > > it's
> > > > > > an
> > > > > > rc6 bug either.
> > 
> > Well, RC6 is the main GT power gating. The issue could be on may other
> > individual power gating, but if by disabling RC6 the issue is gone
> > it is a very good indication that it is a GT-PM bug somewhere.
> 
> I disagree. In the recent past enable_rc6 was often used by
> people to workaround display underruns and whatnot.

o.O
do you mean this was being used as a placebo? or real issue?
or something like by keeping rc6 gpu was keeping the power request
to punit high so display was receiving enough power to not strugle
with wm? or something like that or what?

> 
> -- 
> Ville Syrjälä
> Intel
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjala May 17, 2019, 5:02 p.m. UTC | #13
On Fri, May 17, 2019 at 09:44:46AM -0700, Rodrigo Vivi wrote:
> On Fri, May 17, 2019 at 07:34:23PM +0300, Ville Syrjälä wrote:
> > On Fri, May 17, 2019 at 09:17:39AM -0700, Rodrigo Vivi wrote:
> > > On Thu, May 16, 2019 at 03:49:19PM +0000, Summers, Stuart wrote:
> > > > On Thu, 2019-05-16 at 18:42 +0300, Jani Nikula wrote:
> > > > > On Thu, 16 May 2019, "Summers, Stuart" <stuart.summers@intel.com>
> > > > > wrote:
> > > > > > On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
> > > > > > > On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> > > > > > > > One possibility that just came to my mind now is, what if we
> > > > > > > > make
> > > > > > > > this only for platforms that are still protected by
> > > > > > > > is_alpha_support=1
> > > > > > > > (soon becoming require_force_probe=1)
> > > > > > > 
> > > > > > > Please don't conflate alpha_support or force_probe with
> > > > > > > *anything*
> > > > > > > else.
> > > > > > > 
> > > > > > > > But this is just one side of the coin... when product is out
> > > > > > > > there
> > > > > > > > and we want the user to debug the issue to see if it is a RC6
> > > > > > > > bug
> > > > > > > > we have no way to verify that. :/
> > > > > > > 
> > > > > > > The problem is, if it works with rc6 disabled, it doesn't prove
> > > > > > > it's
> > > > > > > an
> > > > > > > rc6 bug either.
> > > 
> > > Well, RC6 is the main GT power gating. The issue could be on may other
> > > individual power gating, but if by disabling RC6 the issue is gone
> > > it is a very good indication that it is a GT-PM bug somewhere.
> > 
> > I disagree. In the recent past enable_rc6 was often used by
> > people to workaround display underruns and whatnot.
> 
> o.O
> do you mean this was being used as a placebo? or real issue?
> or something like by keeping rc6 gpu was keeping the power request
> to punit high so display was receiving enough power to not strugle
> with wm? or something like that or what?

Disabling rc6 disables most package C-states, which makes life
a lot easier for the display engine due to reduced memory
access latencies.
Summers, Stuart May 21, 2019, 7:17 p.m. UTC | #14
On Fri, 2019-05-17 at 09:17 -0700, Rodrigo Vivi wrote:
> On Thu, May 16, 2019 at 03:49:19PM +0000, Summers, Stuart wrote:
> > On Thu, 2019-05-16 at 18:42 +0300, Jani Nikula wrote:
> > > On Thu, 16 May 2019, "Summers, Stuart" <stuart.summers@intel.com>
> > > wrote:
> > > > On Thu, 2019-05-16 at 12:59 +0300, Jani Nikula wrote:
> > > > > On Tue, 14 May 2019, Rodrigo Vivi <rodrigo.vivi@intel.com>
> > > > > wrote:
> > > > > > One possibility that just came to my mind now is, what if
> > > > > > we
> > > > > > make
> > > > > > this only for platforms that are still protected by
> > > > > > is_alpha_support=1
> > > > > > (soon becoming require_force_probe=1)
> > > > > 
> > > > > Please don't conflate alpha_support or force_probe with
> > > > > *anything*
> > > > > else.
> > > > > 
> > > > > > But this is just one side of the coin... when product is
> > > > > > out
> > > > > > there
> > > > > > and we want the user to debug the issue to see if it is a
> > > > > > RC6
> > > > > > bug
> > > > > > we have no way to verify that. :/
> > > > > 
> > > > > The problem is, if it works with rc6 disabled, it doesn't
> > > > > prove
> > > > > it's
> > > > > an
> > > > > rc6 bug either.
> 
> Well, RC6 is the main GT power gating. The issue could be on may
> other
> individual power gating, but if by disabling RC6 the issue is gone
> it is a very good indication that it is a GT-PM bug somewhere.
> 
> > > > 
> > > > Good point. I'm not saying we should enforce a process of
> > > > disabling
> > > > RC6
> > > > for the platform if enable_rc6=0 results in success. I'm just
> > > > saying
> > > > having the option is useful from a debug perspective. We will
> > > > still
> > > > need to do the appropriate full analysis, including the normal
> > > > code
> > > > review process on a pre-case basis when debug involves this
> > > > parameter.
> > > > But the parameter itself is still useful.
> > > 
> > > The trouble starts when users figure out that enable_rc6=0 works
> > > around
> > > a particular problem they have (likely by way of disabling
> > > runtime
> > > pm,
> > > not directly related to rc6). You could argue this is a good
> > > thing,
> > > but
> > > unfortunately we generally never hear from them again, and the
> > > root
> > > cause remains unsolved, with degraded user experience wrt power
> > > management.
> 
> This is indeed bad. We should probably be clear that by disabling
> that
> they are draining their power and probably killing battery life.

I could add a DRM_ERROR or even a GEM_WARN_ON if this is set with a
description similar to what you have if that's interesting.

> 
> > 
> > So I understand the reasoning here, and agree that isn't an ideal
> > situation. I'd also like a way to debug more efficiently. What did
> > you
> > think about the suggestion from Tvrtko to only apply on
> > CONFIG_DRM_I915_DEBUG?
> 
> if debug is on and parameter is set, right? Might be a good thing to
> avoid the abuse on the parameter.
> 
> > 
> > Or we could even wrap this entirely with a CONFIG_I915_DEBUG_PM -
> > although I'd like to suggest we still use the module parameter, we
> > could just use the config option to hide the modparam under normal
> > operation.
> 
> I think this looks more like you are enabling more logs and
> not that you are disabling... unless the plan is to go with
> this flag plus logs and traces around PM. Than I think it is
> a good idea.

I'm not precluding people from adding more logs here - and there will
at least be some additional logs indicating we are bypassing the PM
flows. But at least for this patch, the intention would be to add new
"debug capability", which in this case, means the addition of the new
module parameter, enable_rc6.

Really this is just an extra deterent for users, since they'll need to
custom build the kernel to get this - not something enabled by default
in one of the distros, for instance.

Thanks,
Stuart

> 
> Same rules needs to apply to  RC6, RPM, DC states,
> display power well management, psr, etc.
> 
> Thanks,
> Rodrigo.
> 
> > 
> > Thanks,
> > Stuart
> > 
> > > 
> > > BR,
> > > Jani.
> > > 
> > > 
> 
> 
> 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
>
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index b5be0abbba35..e31406c6821d 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -169,6 +169,9 @@  i915_param_named_unsafe(inject_load_failure, uint, 0400,
 i915_param_named(enable_dpcd_backlight, bool, 0600,
 	"Enable support for DPCD backlight control (default:false)");
 
+i915_param_named_unsafe(enable_rc6, bool, 0400,
+	"Enable power-saving render C-state 6. (default: true)");
+
 #if IS_ENABLED(CONFIG_DRM_I915_GVT)
 i915_param_named(enable_gvt, bool, 0400,
 	"Enable support for Intel GVT-g graphics virtualization host support(default:false)");
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index 3f14e9881a0d..28bf4005a610 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -76,7 +76,8 @@  struct drm_printer;
 	param(bool, nuclear_pageflip, false) \
 	param(bool, enable_dp_mst, true) \
 	param(bool, enable_dpcd_backlight, false) \
-	param(bool, enable_gvt, false)
+	param(bool, enable_gvt, false) \
+	param(bool, enable_rc6, true)
 
 #define MEMBER(T, member, ...) T member;
 struct i915_params {
diff --git a/drivers/gpu/drm/i915/intel_pm.c b/drivers/gpu/drm/i915/intel_pm.c
index decdd79c3805..6b514dd033cb 100644
--- a/drivers/gpu/drm/i915/intel_pm.c
+++ b/drivers/gpu/drm/i915/intel_pm.c
@@ -7020,6 +7020,9 @@  static bool sanitize_rc6(struct drm_i915_private *i915)
 {
 	struct intel_device_info *info = mkwrite_device_info(i915);
 
+	if (!i915_modparams.enable_rc6)
+		info->has_rc6 = 0;
+
 	/* Powersaving is controlled by the host when inside a VM */
 	if (intel_vgpu_active(i915)) {
 		info->has_rc6 = 0;