diff mbox

[08/11] drm/intel: add enable_psr module option and disable psr by default

Message ID 1373579105-1732-9-git-send-email-rodrigo.vivi@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi July 11, 2013, 9:45 p.m. UTC
v2: prefer seq_puts to seq_printf detected by Paulo Zanoni.
v3: PSR is disabled by default. Without userspace ready it
    will cause regression for kde and xdm users

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 3 +++
 drivers/gpu/drm/i915/i915_drv.c     | 4 ++++
 drivers/gpu/drm/i915/i915_drv.h     | 2 ++
 drivers/gpu/drm/i915/intel_dp.c     | 6 ++++++
 4 files changed, 15 insertions(+)

Comments

Chris Wilson July 15, 2013, 2:01 p.m. UTC | #1
On Thu, Jul 11, 2013 at 06:45:02PM -0300, Rodrigo Vivi wrote:
> v2: prefer seq_puts to seq_printf detected by Paulo Zanoni.
> v3: PSR is disabled by default. Without userspace ready it
>     will cause regression for kde and xdm users

I think we should still aim to enable by default and disable on the
first direct access after a mmioflip.
-Chris
Rodrigo Vivi July 15, 2013, 8:23 p.m. UTC | #2
On Mon, Jul 15, 2013 at 11:01 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Jul 11, 2013 at 06:45:02PM -0300, Rodrigo Vivi wrote:
>> v2: prefer seq_puts to seq_printf detected by Paulo Zanoni.
>> v3: PSR is disabled by default. Without userspace ready it
>>     will cause regression for kde and xdm users
>
> I think we should still aim to enable by default and disable on the
> first direct access after a mmioflip.

unfortunately I couldn't implement a reliable way of detect it without
false positives,
so let's put this disabled for now and revert when I find a reliable way.

> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre



--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
Chris Wilson July 15, 2013, 10:01 p.m. UTC | #3
On Mon, Jul 15, 2013 at 05:23:35PM -0300, Rodrigo Vivi wrote:
> On Mon, Jul 15, 2013 at 11:01 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Thu, Jul 11, 2013 at 06:45:02PM -0300, Rodrigo Vivi wrote:
> >> v2: prefer seq_puts to seq_printf detected by Paulo Zanoni.
> >> v3: PSR is disabled by default. Without userspace ready it
> >>     will cause regression for kde and xdm users
> >
> > I think we should still aim to enable by default and disable on the
> > first direct access after a mmioflip.
> 
> unfortunately I couldn't implement a reliable way of detect it without
> false positives,

Can you give me an example of one of the false positives? The detect
front buffer writes patches we had should be good enough to only punish
legacy userspace.

> so let's put this disabled for now and revert when I find a reliable way.

That's fine, just think we're giving up too easily ;-)
-Chris
Daniel Vetter July 16, 2013, 5:19 a.m. UTC | #4
On Mon, Jul 15, 2013 at 11:01:13PM +0100, Chris Wilson wrote:
> On Mon, Jul 15, 2013 at 05:23:35PM -0300, Rodrigo Vivi wrote:
> > On Mon, Jul 15, 2013 at 11:01 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > > On Thu, Jul 11, 2013 at 06:45:02PM -0300, Rodrigo Vivi wrote:
> > >> v2: prefer seq_puts to seq_printf detected by Paulo Zanoni.
> > >> v3: PSR is disabled by default. Without userspace ready it
> > >>     will cause regression for kde and xdm users
> > >
> > > I think we should still aim to enable by default and disable on the
> > > first direct access after a mmioflip.
> > 
> > unfortunately I couldn't implement a reliable way of detect it without
> > false positives,
> 
> Can you give me an example of one of the false positives? The detect
> front buffer writes patches we had should be good enough to only punish
> legacy userspace.
> 
> > so let's put this disabled for now and revert when I find a reliable way.
> 
> That's fine, just think we're giving up too easily ;-)

Agreed, and part of the problem is that slacker-me is sitting on a big
review of your rfc patches ;-) I really need to get around to write that
down into a nice mail from my ineligible notes ...

I hope that with good sw side frontbuffer rendering tracking we'll be able
to enable psr in more conditions, e.g. also when sprites are enabled and
similar cases.
-Daniel
Rodrigo Vivi July 16, 2013, 1:45 p.m. UTC | #5
On Mon, Jul 15, 2013 at 7:01 PM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Mon, Jul 15, 2013 at 05:23:35PM -0300, Rodrigo Vivi wrote:
>> On Mon, Jul 15, 2013 at 11:01 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> > On Thu, Jul 11, 2013 at 06:45:02PM -0300, Rodrigo Vivi wrote:
>> >> v2: prefer seq_puts to seq_printf detected by Paulo Zanoni.
>> >> v3: PSR is disabled by default. Without userspace ready it
>> >>     will cause regression for kde and xdm users
>> >
>> > I think we should still aim to enable by default and disable on the
>> > first direct access after a mmioflip.
>>
>> unfortunately I couldn't implement a reliable way of detect it without
>> false positives,
>
> Can you give me an example of one of the false positives? The detect
> front buffer writes patches we had should be good enough to only punish
> legacy userspace.

psr works very well on unity and gnome and disable it in the cases it
already works well is a kind of false positive...
I didn't mean false positive in terms of error in detection, but
disabling when not really needed.

>
>> so let's put this disabled for now and revert when I find a reliable way.
>
> That's fine, just think we're giving up too easily ;-)

Yes, I am! tell you more on irc ;)

> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre



--
Rodrigo Vivi
Blog: http://blog.vivi.eng.br
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index e679968..5a2b621 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1961,6 +1961,9 @@  static int i915_edp_psr_status(struct seq_file *m, void *data)
 		case PSR_NO_SINK:
 			seq_puts(m, "not supported by panel");
 			break;
+		case PSR_MODULE_PARAM:
+			seq_puts(m, "disabled by flag");
+			break;
 		case PSR_CRTC_NOT_ACTIVE:
 			seq_puts(m, "crtc not active");
 			break;
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index b07362f..f2c018d 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -118,6 +118,10 @@  module_param_named(i915_enable_ppgtt, i915_enable_ppgtt, int, 0600);
 MODULE_PARM_DESC(i915_enable_ppgtt,
 		"Enable PPGTT (default: true)");
 
+int i915_enable_psr __read_mostly = 0;
+module_param_named(enable_psr, i915_enable_psr, int, 0600);
+MODULE_PARM_DESC(enable_psr, "Enable PSR (default: false)");
+
 unsigned int i915_preliminary_hw_support __read_mostly = 0;
 module_param_named(preliminary_hw_support, i915_preliminary_hw_support, int, 0600);
 MODULE_PARM_DESC(preliminary_hw_support,
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d0b9483..1992081 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -563,6 +563,7 @@  struct i915_fbc {
 enum no_psr_reason {
 	PSR_NO_SOURCE, /* Not supported on platform */
 	PSR_NO_SINK, /* Not supported by panel */
+	PSR_MODULE_PARAM,
 	PSR_CRTC_NOT_ACTIVE,
 	PSR_PWR_WELL_ENABLED,
 	PSR_NOT_TILED,
@@ -1593,6 +1594,7 @@  extern int i915_enable_rc6 __read_mostly;
 extern int i915_enable_fbc __read_mostly;
 extern bool i915_enable_hangcheck __read_mostly;
 extern int i915_enable_ppgtt __read_mostly;
+extern int i915_enable_psr __read_mostly;
 extern unsigned int i915_preliminary_hw_support __read_mostly;
 extern int i915_disable_power_well __read_mostly;
 extern int i915_enable_ips __read_mostly;
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index c0870a69..c0defaf 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1526,6 +1526,12 @@  static bool intel_edp_psr_match_conditions(struct intel_dp *intel_dp)
 		return false;
 	}
 
+	if (!i915_enable_psr) {
+		DRM_DEBUG_KMS("PSR disable by flag\n");
+		dev_priv->no_psr_reason = PSR_MODULE_PARAM;
+		return false;
+	}
+
 	if (!intel_crtc->active || !crtc->fb || !crtc->mode.clock) {
 		DRM_DEBUG_KMS("crtc not active for PSR\n");
 		dev_priv->no_psr_reason = PSR_CRTC_NOT_ACTIVE;