DRM / i915: Fix resume regression on MSI Wind U100 w/o KMS
diff mbox series

Message ID 201001090045.33784.rjw@sisk.pl
State New, archived
Headers show
Series
  • DRM / i915: Fix resume regression on MSI Wind U100 w/o KMS
Related show

Commit Message

Rafael J. Wysocki Jan. 8, 2010, 11:45 p.m. UTC
From: Rafael J. Wysocki <rjw@sisk.pl>

Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
new pm ops for i915), among other things, removed the .suspend and
.resume pointers from the struct drm_driver object in i915_drv.c,
which broke resume without KMS on my MSI Wind U100.

Fix this by reverting that part of commit cbda12d77ea59.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
---
 drivers/gpu/drm/i915/i915_drv.c |   53 ++++------------------------------------
 1 file changed, 6 insertions(+), 47 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Comments

Linus Torvalds Jan. 9, 2010, 12:01 a.m. UTC | #1
On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
>
> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> new pm ops for i915), among other things, removed the .suspend and
> .resume pointers from the struct drm_driver object in i915_drv.c,
> which broke resume without KMS on my MSI Wind U100.
> 
> Fix this by reverting that part of commit cbda12d77ea59.

Hmm. I get the feeling that perhaps the of the drm_driver callbacks was 
very muchintentional, and that the code presumably wants to be called 
purely through the PCI layer, and not through the "drm class" logic at 
all?

Your patch seems like it would always execute the silly class suspend even 
though we explicitly don't want to. And a much nicer fix would seem to 
register the thing properly as a PCI driver even if you don't then use 
KMS.

So it looks to me like the problem is that drm_init() will register the 
driver as a real PCI driver only if

	driver->driver_features & DRIVER_MODESET

and otherwise it does that very odd "stealth mode manual scanning" thing 
which doesn't register it as a proper PCI driver.

So could we instead make that "disable KSM" _just_ disable the mode 
setting part, not disable the "I'm a real driver" part?

		Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Jesse Barnes Jan. 9, 2010, 12:06 a.m. UTC | #2
On Fri, 8 Jan 2010 16:01:46 -0800 (PST)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> >
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> > new pm ops for i915), among other things, removed the .suspend and
> > .resume pointers from the struct drm_driver object in i915_drv.c,
> > which broke resume without KMS on my MSI Wind U100.
> > 
> > Fix this by reverting that part of commit cbda12d77ea59.
> 
> Hmm. I get the feeling that perhaps the of the drm_driver callbacks
> was very muchintentional, and that the code presumably wants to be
> called purely through the PCI layer, and not through the "drm class"
> logic at all?
> 
> Your patch seems like it would always execute the silly class suspend
> even though we explicitly don't want to. And a much nicer fix would
> seem to register the thing properly as a PCI driver even if you don't
> then use KMS.
> 
> So it looks to me like the problem is that drm_init() will register
> the driver as a real PCI driver only if
> 
> 	driver->driver_features & DRIVER_MODESET
> 
> and otherwise it does that very odd "stealth mode manual scanning"
> thing which doesn't register it as a proper PCI driver.
> 
> So could we instead make that "disable KSM" _just_ disable the mode 
> setting part, not disable the "I'm a real driver" part?

Yeah, but that would be more invasive.  In the KMS case the driver
(which is registered as PCI) does a lot of the initialization that the
core takes care of in the non-KMS case, and some of it happens later at
ioctl time.  I'm afraid of that code since it seems like whenever you
change something obvious it subtly breaks an old userland.
Jesse Barnes Jan. 9, 2010, 12:21 a.m. UTC | #3
On Fri, 8 Jan 2010 16:06:59 -0800
Jesse Barnes <jbarnes@virtuousgeek.org> wrote:

> On Fri, 8 Jan 2010 16:01:46 -0800 (PST)
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
> > 
> > 
> > On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> > >
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > 
> > > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915:
> > > implement new pm ops for i915), among other things, removed
> > > the .suspend and .resume pointers from the struct drm_driver
> > > object in i915_drv.c, which broke resume without KMS on my MSI
> > > Wind U100.
> > > 
> > > Fix this by reverting that part of commit cbda12d77ea59.
> > 
> > Hmm. I get the feeling that perhaps the of the drm_driver callbacks
> > was very muchintentional, and that the code presumably wants to be
> > called purely through the PCI layer, and not through the "drm class"
> > logic at all?
> > 
> > Your patch seems like it would always execute the silly class
> > suspend even though we explicitly don't want to. And a much nicer
> > fix would seem to register the thing properly as a PCI driver even
> > if you don't then use KMS.
> > 
> > So it looks to me like the problem is that drm_init() will register
> > the driver as a real PCI driver only if
> > 
> > 	driver->driver_features & DRIVER_MODESET
> > 
> > and otherwise it does that very odd "stealth mode manual scanning"
> > thing which doesn't register it as a proper PCI driver.
> > 
> > So could we instead make that "disable KSM" _just_ disable the mode 
> > setting part, not disable the "I'm a real driver" part?
> 
> Yeah, but that would be more invasive.  In the KMS case the driver
> (which is registered as PCI) does a lot of the initialization that the
> core takes care of in the non-KMS case, and some of it happens later
> at ioctl time.  I'm afraid of that code since it seems like whenever
> you change something obvious it subtly breaks an old userland.

Hm, maybe it's not as bad as I was afraid it was...  we already support
i915.modeset=0 even on a KMS enabled driver, which should be fairly
equivalent.  Rafael, if you build i915 with KMS enabled but modeset=0
do you get the right suspend/resume behavior?
Rafael J. Wysocki Jan. 9, 2010, 12:21 a.m. UTC | #4
On Saturday 09 January 2010, Linus Torvalds wrote:
> 
> On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> >
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> > new pm ops for i915), among other things, removed the .suspend and
> > .resume pointers from the struct drm_driver object in i915_drv.c,
> > which broke resume without KMS on my MSI Wind U100.
> > 
> > Fix this by reverting that part of commit cbda12d77ea59.
> 
> Hmm. I get the feeling that perhaps the of the drm_driver callbacks was 
> very muchintentional, and that the code presumably wants to be called 
> purely through the PCI layer, and not through the "drm class" logic at 
> all?
> 
> Your patch seems like it would always execute the silly class suspend even 
> though we explicitly don't want to. And a much nicer fix would seem to 
> register the thing properly as a PCI driver even if you don't then use 
> KMS.
> 
> So it looks to me like the problem is that drm_init() will register the 
> driver as a real PCI driver only if
> 
> 	driver->driver_features & DRIVER_MODESET
> 
> and otherwise it does that very odd "stealth mode manual scanning" thing 
> which doesn't register it as a proper PCI driver.
> 
> So could we instead make that "disable KSM" _just_ disable the mode 
> setting part, not disable the "I'm a real driver" part?

Hmm.  Do you mean set DRIVER_MODESET unconditionally before calling drm_init()
and only reset it later if necessary?

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Jesse Barnes Jan. 9, 2010, 12:32 a.m. UTC | #5
On Fri, 8 Jan 2010 16:01:46 -0800 (PST)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> >
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> > new pm ops for i915), among other things, removed the .suspend and
> > .resume pointers from the struct drm_driver object in i915_drv.c,
> > which broke resume without KMS on my MSI Wind U100.
> > 
> > Fix this by reverting that part of commit cbda12d77ea59.
> 
> Hmm. I get the feeling that perhaps the of the drm_driver callbacks
> was very muchintentional, and that the code presumably wants to be
> called purely through the PCI layer, and not through the "drm class"
> logic at all?
> 
> Your patch seems like it would always execute the silly class suspend
> even though we explicitly don't want to. And a much nicer fix would
> seem to register the thing properly as a PCI driver even if you don't
> then use KMS.
> 
> So it looks to me like the problem is that drm_init() will register
> the driver as a real PCI driver only if
> 
> 	driver->driver_features & DRIVER_MODESET
> 
> and otherwise it does that very odd "stealth mode manual scanning"
> thing which doesn't register it as a proper PCI driver.
> 
> So could we instead make that "disable KSM" _just_ disable the mode 
> setting part, not disable the "I'm a real driver" part?

This is the minimal fix I think (totally untested):

diff --git a/drivers/gpu/drm/i915/i915_drv.c
b/drivers/gpu/drm/i915/i915_drv.c index a0a2cad..1364c3e 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -541,6 +541,11 @@ static int __init i915_init(void)
                driver.driver_features &= ~DRIVER_MODESET;
 #endif
 
+       if (!(driver.driver_features & DRIVER_MODESET)) {
+               driver.suspend = i915_suspend;
+               driver.resume = i915_resume;
+       }
+
        return drm_init(&driver);
 }
Rafael J. Wysocki Jan. 9, 2010, 12:43 a.m. UTC | #6
On Saturday 09 January 2010, Jesse Barnes wrote:
> On Fri, 8 Jan 2010 16:06:59 -0800
> Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> 
> > On Fri, 8 Jan 2010 16:01:46 -0800 (PST)
> > Linus Torvalds <torvalds@linux-foundation.org> wrote:
> > 
> > > 
> > > 
> > > On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> > > >
> > > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > > 
> > > > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915:
> > > > implement new pm ops for i915), among other things, removed
> > > > the .suspend and .resume pointers from the struct drm_driver
> > > > object in i915_drv.c, which broke resume without KMS on my MSI
> > > > Wind U100.
> > > > 
> > > > Fix this by reverting that part of commit cbda12d77ea59.
> > > 
> > > Hmm. I get the feeling that perhaps the of the drm_driver callbacks
> > > was very muchintentional, and that the code presumably wants to be
> > > called purely through the PCI layer, and not through the "drm class"
> > > logic at all?
> > > 
> > > Your patch seems like it would always execute the silly class
> > > suspend even though we explicitly don't want to. And a much nicer
> > > fix would seem to register the thing properly as a PCI driver even
> > > if you don't then use KMS.
> > > 
> > > So it looks to me like the problem is that drm_init() will register
> > > the driver as a real PCI driver only if
> > > 
> > > 	driver->driver_features & DRIVER_MODESET
> > > 
> > > and otherwise it does that very odd "stealth mode manual scanning"
> > > thing which doesn't register it as a proper PCI driver.
> > > 
> > > So could we instead make that "disable KSM" _just_ disable the mode 
> > > setting part, not disable the "I'm a real driver" part?
> > 
> > Yeah, but that would be more invasive.  In the KMS case the driver
> > (which is registered as PCI) does a lot of the initialization that the
> > core takes care of in the non-KMS case, and some of it happens later
> > at ioctl time.  I'm afraid of that code since it seems like whenever
> > you change something obvious it subtly breaks an old userland.
> 
> Hm, maybe it's not as bad as I was afraid it was...  we already support
> i915.modeset=0 even on a KMS enabled driver, which should be fairly
> equivalent.  Rafael, if you build i915 with KMS enabled but modeset=0
> do you get the right suspend/resume behavior?

No, with modeset=0 it doesn't register the PCI driver as well.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Rafael J. Wysocki Jan. 9, 2010, 12:46 a.m. UTC | #7
On Saturday 09 January 2010, Jesse Barnes wrote:
> On Fri, 8 Jan 2010 16:01:46 -0800 (PST)
> Linus Torvalds <torvalds@linux-foundation.org> wrote:
> 
> > 
> > 
> > On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> > >
> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > 
> > > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> > > new pm ops for i915), among other things, removed the .suspend and
> > > .resume pointers from the struct drm_driver object in i915_drv.c,
> > > which broke resume without KMS on my MSI Wind U100.
> > > 
> > > Fix this by reverting that part of commit cbda12d77ea59.
> > 
> > Hmm. I get the feeling that perhaps the of the drm_driver callbacks
> > was very muchintentional, and that the code presumably wants to be
> > called purely through the PCI layer, and not through the "drm class"
> > logic at all?
> > 
> > Your patch seems like it would always execute the silly class suspend
> > even though we explicitly don't want to. And a much nicer fix would
> > seem to register the thing properly as a PCI driver even if you don't
> > then use KMS.
> > 
> > So it looks to me like the problem is that drm_init() will register
> > the driver as a real PCI driver only if
> > 
> > 	driver->driver_features & DRIVER_MODESET
> > 
> > and otherwise it does that very odd "stealth mode manual scanning"
> > thing which doesn't register it as a proper PCI driver.
> > 
> > So could we instead make that "disable KSM" _just_ disable the mode 
> > setting part, not disable the "I'm a real driver" part?
> 
> This is the minimal fix I think (totally untested):
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c
> b/drivers/gpu/drm/i915/i915_drv.c index a0a2cad..1364c3e 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -541,6 +541,11 @@ static int __init i915_init(void)
>                 driver.driver_features &= ~DRIVER_MODESET;
>  #endif
>  
> +       if (!(driver.driver_features & DRIVER_MODESET)) {
> +               driver.suspend = i915_suspend;
> +               driver.resume = i915_resume;
> +       }
> +
>         return drm_init(&driver);
>  }

Which is functionally equivalent to my patch, because i915_suspend/resume()
won't be called by drm_class_suspend/resume() in the KMS case anyway.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Linus Torvalds Jan. 9, 2010, 12:50 a.m. UTC | #8
On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> 
> Which is functionally equivalent to my patch, because i915_suspend/resume()
> won't be called by drm_class_suspend/resume() in the KMS case anyway.

Ahh, right you are - that class suspend function does a check for 
DRIVER_MODESET, and only does the suspend/resume if it's not a MODESET 
driver.

Ok, so I withdraw my objections to your original patch - it's confusing, 
but that's just because DRM is such a horrible mess with subtle things.

			Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Jesse Barnes Jan. 9, 2010, 1:13 a.m. UTC | #9
On Fri, 8 Jan 2010 16:50:57 -0800 (PST)
Linus Torvalds <torvalds@linux-foundation.org> wrote:

> 
> 
> On Sat, 9 Jan 2010, Rafael J. Wysocki wrote:
> > 
> > Which is functionally equivalent to my patch, because
> > i915_suspend/resume() won't be called by drm_class_suspend/resume()
> > in the KMS case anyway.
> 
> Ahh, right you are - that class suspend function does a check for 
> DRIVER_MODESET, and only does the suspend/resume if it's not a
> MODESET driver.
> 
> Ok, so I withdraw my objections to your original patch - it's
> confusing, but that's just because DRM is such a horrible mess with
> subtle things.

Yeah the non-KMS paths just suck.

Acked-by: Jesse Barnes <jbarnes@virtuousgeek.org>

Though hopefully you can get the PCI driver registration working w/o
too much trouble; that would be even better.
Dave Airlie Jan. 9, 2010, 2:15 a.m. UTC | #10
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> > new pm ops for i915), among other things, removed the .suspend and
> > .resume pointers from the struct drm_driver object in i915_drv.c,
> > which broke resume without KMS on my MSI Wind U100.
> > 
> > Fix this by reverting that part of commit cbda12d77ea59.
> 
> Hmm. I get the feeling that perhaps the of the drm_driver callbacks was 
> very muchintentional, and that the code presumably wants to be called 
> purely through the PCI layer, and not through the "drm class" logic at 
> all?
> 
> Your patch seems like it would always execute the silly class suspend even 
> though we explicitly don't want to. And a much nicer fix would seem to 
> register the thing properly as a PCI driver even if you don't then use 
> KMS.
> 
> So it looks to me like the problem is that drm_init() will register the 
> driver as a real PCI driver only if
> 
> 	driver->driver_features & DRIVER_MODESET
> 
> and otherwise it does that very odd "stealth mode manual scanning" thing 
> which doesn't register it as a proper PCI driver.
> 
> So could we instead make that "disable KSM" _just_ disable the mode 
> setting part, not disable the "I'm a real driver" part?
> 

This was mainly due to pre-existing fb drivers binding to the device, and 
the drm drivers having to work around that, with KMS since we have fb in 
the drm driver its correct to bind, pre-kms its just a mess I'd rather 
stay away from.

Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Jesse Barnes Jan. 9, 2010, 2:50 a.m. UTC | #11
On Sat, 9 Jan 2010 02:15:41 +0000 (GMT)
Dave Airlie <airlied@linux.ie> wrote:

> > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > 
> > > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915:
> > > implement new pm ops for i915), among other things, removed
> > > the .suspend and .resume pointers from the struct drm_driver
> > > object in i915_drv.c, which broke resume without KMS on my MSI
> > > Wind U100.
> > > 
> > > Fix this by reverting that part of commit cbda12d77ea59.
> > 
> > Hmm. I get the feeling that perhaps the of the drm_driver callbacks
> > was very muchintentional, and that the code presumably wants to be
> > called purely through the PCI layer, and not through the "drm
> > class" logic at all?
> > 
> > Your patch seems like it would always execute the silly class
> > suspend even though we explicitly don't want to. And a much nicer
> > fix would seem to register the thing properly as a PCI driver even
> > if you don't then use KMS.
> > 
> > So it looks to me like the problem is that drm_init() will register
> > the driver as a real PCI driver only if
> > 
> > 	driver->driver_features & DRIVER_MODESET
> > 
> > and otherwise it does that very odd "stealth mode manual scanning"
> > thing which doesn't register it as a proper PCI driver.
> > 
> > So could we instead make that "disable KSM" _just_ disable the mode 
> > setting part, not disable the "I'm a real driver" part?
> > 
> 
> This was mainly due to pre-existing fb drivers binding to the device,
> and the drm drivers having to work around that, with KMS since we
> have fb in the drm driver its correct to bind, pre-kms its just a
> mess I'd rather stay away from.

Linus, can we ever drop those old paths?  Maybe after the new bits have
been around for awhile?  Users of really old userspace stacks would
lose 3D support, but they'd still have 2D, so it wouldn't be a complete
break.  The non-KMS paths sometimes break like this anyway without us
noticing (especially some of the weirder 3D paths)...

Just thinking out loud, we could really kill a lot of really bad code...
Jerome Glisse Jan. 9, 2010, 12:01 p.m. UTC | #12
On Fri, Jan 08, 2010 at 06:50:41PM -0800, Jesse Barnes wrote:
> On Sat, 9 Jan 2010 02:15:41 +0000 (GMT)
> Dave Airlie <airlied@linux.ie> wrote:
> 
> > > > From: Rafael J. Wysocki <rjw@sisk.pl>
> > > > 
> > > > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915:
> > > > implement new pm ops for i915), among other things, removed
> > > > the .suspend and .resume pointers from the struct drm_driver
> > > > object in i915_drv.c, which broke resume without KMS on my MSI
> > > > Wind U100.
> > > > 
> > > > Fix this by reverting that part of commit cbda12d77ea59.
> > > 
> > > Hmm. I get the feeling that perhaps the of the drm_driver callbacks
> > > was very muchintentional, and that the code presumably wants to be
> > > called purely through the PCI layer, and not through the "drm
> > > class" logic at all?
> > > 
> > > Your patch seems like it would always execute the silly class
> > > suspend even though we explicitly don't want to. And a much nicer
> > > fix would seem to register the thing properly as a PCI driver even
> > > if you don't then use KMS.
> > > 
> > > So it looks to me like the problem is that drm_init() will register
> > > the driver as a real PCI driver only if
> > > 
> > > 	driver->driver_features & DRIVER_MODESET
> > > 
> > > and otherwise it does that very odd "stealth mode manual scanning"
> > > thing which doesn't register it as a proper PCI driver.
> > > 
> > > So could we instead make that "disable KSM" _just_ disable the mode 
> > > setting part, not disable the "I'm a real driver" part?
> > > 
> > 
> > This was mainly due to pre-existing fb drivers binding to the device,
> > and the drm drivers having to work around that, with KMS since we
> > have fb in the drm driver its correct to bind, pre-kms its just a
> > mess I'd rather stay away from.
> 
> Linus, can we ever drop those old paths?  Maybe after the new bits have
> been around for awhile?  Users of really old userspace stacks would
> lose 3D support, but they'd still have 2D, so it wouldn't be a complete
> break.  The non-KMS paths sometimes break like this anyway without us
> noticing (especially some of the weirder 3D paths)...
> 
> Just thinking out loud, we could really kill a lot of really bad code...
> 
> -- 
> Jesse Barnes, Intel Open Source Technology Center

I among those who would love such things to happen :)

Cheers,
Jerome
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Linus Torvalds Jan. 9, 2010, 6:17 p.m. UTC | #13
On Sat, 9 Jan 2010, Jerome Glisse wrote:

> On Fri, Jan 08, 2010 at 06:50:41PM -0800, Jesse Barnes wrote:
> > 
> > Linus, can we ever drop those old paths?  Maybe after the new bits have
> > been around for awhile?  Users of really old userspace stacks would
> > lose 3D support, but they'd still have 2D, so it wouldn't be a complete
> > break.  The non-KMS paths sometimes break like this anyway without us
> > noticing (especially some of the weirder 3D paths)...
> > 
> > Just thinking out loud, we could really kill a lot of really bad code...
> 
> I among those who would love such things to happen :)

I don't want to drop it _yet_, but "ever"? Sure. When people are sure that 
KMS actually handles all the cases that old X does (maybe that's true 
now), and we've had more than just a couple of kernel releases of _stable_ 
Intel KMS, I suspect we can start thinking about "ok, nobody seriously 
uses 3D on Intel integrated graphics _and_ updates the kernel".

The fact that they'd still have a working X setup would make it generally 
much more palatable, I think. 

But we definitely need more than just a couple of kernel releases. So 
we're talking timescales of "more than a year of stable code". Whether 
that is "six months from now" or "two years from now", I can't judge. 

And people can try to convince me to be more or less aggressive about it, 
so take the above as a more of a personal opinion that is open to 
change than anything definite and final.

		Linus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Dave Airlie Jan. 9, 2010, 9:32 p.m. UTC | #14
On Sun, Jan 10, 2010 at 4:17 AM, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
>
>
> On Sat, 9 Jan 2010, Jerome Glisse wrote:
>
>> On Fri, Jan 08, 2010 at 06:50:41PM -0800, Jesse Barnes wrote:
>> >
>> > Linus, can we ever drop those old paths?  Maybe after the new bits have
>> > been around for awhile?  Users of really old userspace stacks would
>> > lose 3D support, but they'd still have 2D, so it wouldn't be a complete
>> > break.  The non-KMS paths sometimes break like this anyway without us
>> > noticing (especially some of the weirder 3D paths)...
>> >
>> > Just thinking out loud, we could really kill a lot of really bad code...
>>
>> I among those who would love such things to happen :)
>
> I don't want to drop it _yet_, but "ever"? Sure. When people are sure that
> KMS actually handles all the cases that old X does (maybe that's true
> now), and we've had more than just a couple of kernel releases of _stable_
> Intel KMS, I suspect we can start thinking about "ok, nobody seriously
> uses 3D on Intel integrated graphics _and_ updates the kernel".
>
> The fact that they'd still have a working X setup would make it generally
> much more palatable, I think.
>
> But we definitely need more than just a couple of kernel releases. So
> we're talking timescales of "more than a year of stable code". Whether
> that is "six months from now" or "two years from now", I can't judge.
>
> And people can try to convince me to be more or less aggressive about it,
> so take the above as a more of a personal opinion that is open to
> change than anything definite and final.

I'm in the 2-3 years at a minimum, with at least one kernel with no serious
regressions in Intel KMS, which we haven't gotten close to yet. I'm not even
sure the Intel guys are taking stable seriously enough yet. So far I don't think
there is one kernel release (even stable) that works on all Intel
chipsets without
backporting patches. 2.6.32 needs the changes to remove the messed up
render clock hacks which should really have been reverted a lot earlier since
we had a lot of regression reports. The number of users using powersave=0
to get anything approaching useable is growing etc.

We do have ppl who run latest kernels on RHEL5 userspace and I'd rather
not have that break badly, I'm guessing more than 3D will break if we remove
this, since we need the DRM to allocate memory for 2D stuff, and will probably
find the fallback to AGP is broken. Again Intel ppl would have to do a lot
of testing on the fallback before removing anything, which is time I don't see
anyone willing to spend.

Dave.
Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Jesse Barnes Jan. 11, 2010, 4:38 p.m. UTC | #15
On Sun, 10 Jan 2010 07:32:30 +1000
Dave Airlie <airlied@gmail.com> wrote:
> I'm in the 2-3 years at a minimum, with at least one kernel with no
> serious regressions in Intel KMS, which we haven't gotten close to
> yet. I'm not even sure the Intel guys are taking stable seriously
> enough yet. So far I don't think there is one kernel release (even
> stable) that works on all Intel chipsets without
> backporting patches. 2.6.32 needs the changes to remove the messed up
> render clock hacks which should really have been reverted a lot
> earlier since we had a lot of regression reports. The number of users
> using powersave=0 to get anything approaching useable is growing etc.

But you could apply that argument to the existing DRM code (not just
Intel) as well; lots of things are broken or unimplemented and never
get fixed.  I'd say the right metric isn't whether regressions are
introduced (usually due to new features) but whether the driver is
better than the old userspace code.  For Intel at least, I think we're
already there.  The quality of the kernel driver is higher and it has
many more features than the userspace implementation ever did.  That's
just my subjective opinion, but I've done a *lot* of work on our bugs
both in userspace and in the kernel, so I think it's an accurate
statement.

> We do have ppl who run latest kernels on RHEL5 userspace and I'd
> rather not have that break badly, I'm guessing more than 3D will
> break if we remove this, since we need the DRM to allocate memory for
> 2D stuff, and will probably find the fallback to AGP is broken. Again
> Intel ppl would have to do a lot of testing on the fallback before
> removing anything, which is time I don't see anyone willing to spend.

It doesn't have to happen anytime soon, I was just thinking that
removing the old, pre-KMS code would make it easier to avoid
introducing regressions since we'd have one less config (a bit one
atthat) to worry about.
Dave Airlie Jan. 11, 2010, 8:12 p.m. UTC | #16
On Tue, Jan 12, 2010 at 2:38 AM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> On Sun, 10 Jan 2010 07:32:30 +1000
> Dave Airlie <airlied@gmail.com> wrote:
>> I'm in the 2-3 years at a minimum, with at least one kernel with no
>> serious regressions in Intel KMS, which we haven't gotten close to
>> yet. I'm not even sure the Intel guys are taking stable seriously
>> enough yet. So far I don't think there is one kernel release (even
>> stable) that works on all Intel chipsets without
>> backporting patches. 2.6.32 needs the changes to remove the messed up
>> render clock hacks which should really have been reverted a lot
>> earlier since we had a lot of regression reports. The number of users
>> using powersave=0 to get anything approaching useable is growing etc.
>
> But you could apply that argument to the existing DRM code (not just
> Intel) as well; lots of things are broken or unimplemented and never
> get fixed.  I'd say the right metric isn't whether regressions are
> introduced (usually due to new features) but whether the driver is
> better than the old userspace code.  For Intel at least, I think we're
> already there.  The quality of the kernel driver is higher and it has
> many more features than the userspace implementation ever did.  That's
> just my subjective opinion, but I've done a *lot* of work on our bugs
> both in userspace and in the kernel, so I think it's an accurate
> statement.

The problem is at any single point in time I'm not sure a kms kernel
exists that works across all the Intel hw, which from a distro POV is a real
pain in the ass, a regression gets fixed on one piece of hw just as
another on a different piece gets introduced.

I'd really like if Intel devs could either slow it down and do more testing
before pushing to Linus, or be a lot quicker with the reverts when stuff
is identified. The main thing is the render reclocking lately, thats been a
nightmare and as far as I can see 2.6.32.3 still has all the issues,

>
> It doesn't have to happen anytime soon, I was just thinking that
> removing the old, pre-KMS code would make it easier to avoid
> introducing regressions since we'd have one less config (a bit one
> atthat) to worry about.

Maybe in 3-4 years.

Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Jesse Barnes Jan. 11, 2010, 8:22 p.m. UTC | #17
On Tue, 12 Jan 2010 06:12:37 +1000
Dave Airlie <airlied@gmail.com> wrote:

> On Tue, Jan 12, 2010 at 2:38 AM, Jesse Barnes
> <jbarnes@virtuousgeek.org> wrote:
> > On Sun, 10 Jan 2010 07:32:30 +1000
> > Dave Airlie <airlied@gmail.com> wrote:
> >> I'm in the 2-3 years at a minimum, with at least one kernel with no
> >> serious regressions in Intel KMS, which we haven't gotten close to
> >> yet. I'm not even sure the Intel guys are taking stable seriously
> >> enough yet. So far I don't think there is one kernel release (even
> >> stable) that works on all Intel chipsets without
> >> backporting patches. 2.6.32 needs the changes to remove the messed
> >> up render clock hacks which should really have been reverted a lot
> >> earlier since we had a lot of regression reports. The number of
> >> users using powersave=0 to get anything approaching useable is
> >> growing etc.
> >
> > But you could apply that argument to the existing DRM code (not just
> > Intel) as well; lots of things are broken or unimplemented and never
> > get fixed.  I'd say the right metric isn't whether regressions are
> > introduced (usually due to new features) but whether the driver is
> > better than the old userspace code.  For Intel at least, I think
> > we're already there.  The quality of the kernel driver is higher
> > and it has many more features than the userspace implementation
> > ever did.  That's just my subjective opinion, but I've done a *lot*
> > of work on our bugs both in userspace and in the kernel, so I think
> > it's an accurate statement.
> 
> The problem is at any single point in time I'm not sure a kms kernel
> exists that works across all the Intel hw, which from a distro POV is
> a real pain in the ass, a regression gets fixed on one piece of hw
> just as another on a different piece gets introduced.
> 
> I'd really like if Intel devs could either slow it down and do more
> testing before pushing to Linus, or be a lot quicker with the reverts
> when stuff is identified. The main thing is the render reclocking
> lately, thats been a nightmare and as far as I can see 2.6.32.3 still
> has all the issues,

Yeah, it may have been better to just revert that early on, but some
users really wanted the power saving features too, so it wasn't totally
clear cut (btw stable has a revert patch queued up now that fixes things
for several people).

> > It doesn't have to happen anytime soon, I was just thinking that
> > removing the old, pre-KMS code would make it easier to avoid
> > introducing regressions since we'd have one less config (a bit one
> > atthat) to worry about.
> 
> Maybe in 3-4 years.

Ouch, it just went from 2-3 to 3-4.  But really the other drm drivers
have to get converted anyway before we can really start killing code.
Rafael J. Wysocki Jan. 11, 2010, 9:04 p.m. UTC | #18
On Monday 11 January 2010, Dave Airlie wrote:
> On Tue, Jan 12, 2010 at 2:38 AM, Jesse Barnes <jbarnes@virtuousgeek.org> wrote:
> > On Sun, 10 Jan 2010 07:32:30 +1000
> > Dave Airlie <airlied@gmail.com> wrote:
> >> I'm in the 2-3 years at a minimum, with at least one kernel with no
> >> serious regressions in Intel KMS, which we haven't gotten close to
> >> yet. I'm not even sure the Intel guys are taking stable seriously
> >> enough yet. So far I don't think there is one kernel release (even
> >> stable) that works on all Intel chipsets without
> >> backporting patches. 2.6.32 needs the changes to remove the messed up
> >> render clock hacks which should really have been reverted a lot
> >> earlier since we had a lot of regression reports. The number of users
> >> using powersave=0 to get anything approaching useable is growing etc.
> >
> > But you could apply that argument to the existing DRM code (not just
> > Intel) as well; lots of things are broken or unimplemented and never
> > get fixed.  I'd say the right metric isn't whether regressions are
> > introduced (usually due to new features) but whether the driver is
> > better than the old userspace code.  For Intel at least, I think we're
> > already there.  The quality of the kernel driver is higher and it has
> > many more features than the userspace implementation ever did.  That's
> > just my subjective opinion, but I've done a *lot* of work on our bugs
> > both in userspace and in the kernel, so I think it's an accurate
> > statement.
> 
> The problem is at any single point in time I'm not sure a kms kernel
> exists that works across all the Intel hw, which from a distro POV is a real
> pain in the ass, a regression gets fixed on one piece of hw just as
> another on a different piece gets introduced.
> 
> I'd really like if Intel devs could either slow it down and do more testing
> before pushing to Linus, or be a lot quicker with the reverts when stuff
> is identified. The main thing is the render reclocking lately, thats been a
> nightmare and as far as I can see 2.6.32.3 still has all the issues,

Hmm, are you trying to say radeon is better at that?

My experience is quite the opposite to be honest.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Julien Cristau Jan. 11, 2010, 9:43 p.m. UTC | #19
On Mon, Jan 11, 2010 at 22:04:36 +0100, Rafael J. Wysocki wrote:

> Hmm, are you trying to say radeon is better at that?
> 
> My experience is quite the opposite to be honest.
> 
radeon kms is in staging, doesn't pretend to be stable and force all
users to the experimental paths.  So yes, I would say radeon is better
at that.

Cheers,
Julien
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Rafael J. Wysocki Jan. 11, 2010, 10:22 p.m. UTC | #20
On Monday 11 January 2010, Julien Cristau wrote:
> On Mon, Jan 11, 2010 at 22:04:36 +0100, Rafael J. Wysocki wrote:
> 
> > Hmm, are you trying to say radeon is better at that?
> > 
> > My experience is quite the opposite to be honest.
> > 
> radeon kms is in staging, doesn't pretend to be stable and force all
> users to the experimental paths.  So yes, I would say radeon is better
> at that.

I guess I should have been more precise.

All of my test boxes with ATI/AMD graphics hardware regressed after upgrading
from openSUSE 11.1 to openSUSE 11.2, in different ways, because of the user
space part of the radeon driver.  Of course, you can argue that the dristro
picked up particularly bad release of the driver, but from the user's point of
view it actually doesn't matter whether the breakage is in the kernel part or
in the user space part of the driver.  The difference is, however, that the
breakage in the kernel is fixed _way_ faster than the breakage in the user
space, so I very much prefer the Intel people pushing new features aggressively
and fixing bugs related to that, then the situation where I need to deal with
the broken user space driver, while the KMS radeon is still not reliable
enough.

IOW, if your user space driver worked 100% of the time, I'd totally agree, but
that's not the case, at least as far as I see it.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Dave Airlie Jan. 11, 2010, 11:05 p.m. UTC | #21
On Tue, Jan 12, 2010 at 8:22 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> On Monday 11 January 2010, Julien Cristau wrote:
>> On Mon, Jan 11, 2010 at 22:04:36 +0100, Rafael J. Wysocki wrote:
>>
>> > Hmm, are you trying to say radeon is better at that?
>> >
>> > My experience is quite the opposite to be honest.
>> >
>> radeon kms is in staging, doesn't pretend to be stable and force all
>> users to the experimental paths.  So yes, I would say radeon is better
>> at that.
>
> I guess I should have been more precise.
>
> All of my test boxes with ATI/AMD graphics hardware regressed after upgrading
> from openSUSE 11.1 to openSUSE 11.2, in different ways, because of the user
> space part of the radeon driver.  Of course, you can argue that the dristro
> picked up particularly bad release of the driver, but from the user's point of
> view it actually doesn't matter whether the breakage is in the kernel part or
> in the user space part of the driver.  The difference is, however, that the
> breakage in the kernel is fixed _way_ faster than the breakage in the user
> space, so I very much prefer the Intel people pushing new features aggressively
> and fixing bugs related to that, then the situation where I need to deal with
> the broken user space driver, while the KMS radeon is still not reliable
> enough.
>
> IOW, if your user space driver worked 100% of the time, I'd totally agree, but
> that's not the case, at least as far as I see it.
>

Are you using the Novell radeonhd driver? (I think SuSE default to this for all
cards > r500).

This isn't the driver that is developed by the opensource community and
really your distro is where you complain about that sort of regression.

The wierd thing is we see distro picking up fixes for userspace
drivers *much* quicker
if their teams are the on the ball since they are only a small
component to upgrade,
with the kernel you find most distro fire and forget, so if 2.6.31
doesn't work on your
hw you'll wait 6 months to find out that 2.634 doesn't work either.

Since ppl aren't targetting stable properly distros are left to fend
for themselves
when it comes to backporting large amounts of changes, and you find most
distros just don't bother.

Dave.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Rafael J. Wysocki Jan. 11, 2010, 11:16 p.m. UTC | #22
On Tuesday 12 January 2010, Dave Airlie wrote:
> On Tue, Jan 12, 2010 at 8:22 AM, Rafael J. Wysocki <rjw@sisk.pl> wrote:
> > On Monday 11 January 2010, Julien Cristau wrote:
> >> On Mon, Jan 11, 2010 at 22:04:36 +0100, Rafael J. Wysocki wrote:
> >>
> >> > Hmm, are you trying to say radeon is better at that?
> >> >
> >> > My experience is quite the opposite to be honest.
> >> >
> >> radeon kms is in staging, doesn't pretend to be stable and force all
> >> users to the experimental paths.  So yes, I would say radeon is better
> >> at that.
> >
> > I guess I should have been more precise.
> >
> > All of my test boxes with ATI/AMD graphics hardware regressed after upgrading
> > from openSUSE 11.1 to openSUSE 11.2, in different ways, because of the user
> > space part of the radeon driver.  Of course, you can argue that the dristro
> > picked up particularly bad release of the driver, but from the user's point of
> > view it actually doesn't matter whether the breakage is in the kernel part or
> > in the user space part of the driver.  The difference is, however, that the
> > breakage in the kernel is fixed _way_ faster than the breakage in the user
> > space, so I very much prefer the Intel people pushing new features aggressively
> > and fixing bugs related to that, then the situation where I need to deal with
> > the broken user space driver, while the KMS radeon is still not reliable
> > enough.
> >
> > IOW, if your user space driver worked 100% of the time, I'd totally agree, but
> > that's not the case, at least as far as I see it.
> >
> 
> Are you using the Novell radeonhd driver? (I think SuSE default to this for all
> cards > r500).

No I'm not.

> This isn't the driver that is developed by the opensource community and
> really your distro is where you complain about that sort of regression.

I know, I'm not using it.

> The wierd thing is we see distro picking up fixes for userspace
> drivers *much* quicker
> if their teams are the on the ball since they are only a small
> component to upgrade,
> with the kernel you find most distro fire and forget, so if 2.6.31
> doesn't work on your
> hw you'll wait 6 months to find out that 2.634 doesn't work either.

Well, openSUSE upgrades the kernel to -stable quite timely.  Which is not the
case with the Xorg drivers, so apparently it depends which distro you
are on. :-)

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
Eric Anholt Jan. 12, 2010, 10:33 p.m. UTC | #23
On Sat, 9 Jan 2010 00:45:33 +0100, "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> From: Rafael J. Wysocki <rjw@sisk.pl>
> 
> Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> new pm ops for i915), among other things, removed the .suspend and
> .resume pointers from the struct drm_driver object in i915_drv.c,
> which broke resume without KMS on my MSI Wind U100.
> 
> Fix this by reverting that part of commit cbda12d77ea59.
> 
> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>

Applied, with a little comment for the next poor person having to figure
out the difference between these two suspend/resume paths.

(And yes, I'd love to see the stealth mode die sometime soonish.  It's
not like attaching intelfb didn't make the user-mode 2D driver fail
frequently, so it's not a great "feature" for us to be maintaining
support for.  From what I understand most distros blacklisted the
intelfb driver anyway.)
Rafael J. Wysocki Jan. 12, 2010, 10:48 p.m. UTC | #24
On Tuesday 12 January 2010, Eric Anholt wrote:
> On Sat, 9 Jan 2010 00:45:33 +0100, "Rafael J. Wysocki" <rjw@sisk.pl> wrote:
> > From: Rafael J. Wysocki <rjw@sisk.pl>
> > 
> > Commit cbda12d77ea590082edb6d30bd342a67ebc459e0 (drm/i915: implement
> > new pm ops for i915), among other things, removed the .suspend and
> > .resume pointers from the struct drm_driver object in i915_drv.c,
> > which broke resume without KMS on my MSI Wind U100.
> > 
> > Fix this by reverting that part of commit cbda12d77ea59.
> > 
> > Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
> 
> Applied, with a little comment for the next poor person having to figure
> out the difference between these two suspend/resume paths.

Linus has applied this one already.

Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Patch
diff mbox series

Index: linux-2.6/drivers/gpu/drm/i915/i915_drv.c
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/i915_drv.c
+++ linux-2.6/drivers/gpu/drm/i915/i915_drv.c
@@ -464,6 +418,8 @@  static struct drm_driver driver = {
 	.lastclose = i915_driver_lastclose,
 	.preclose = i915_driver_preclose,
 	.postclose = i915_driver_postclose,
+	.suspend = i915_suspend,
+	.resume = i915_resume,
 	.device_is_agp = i915_driver_device_is_agp,
 	.enable_vblank = i915_enable_vblank,
 	.disable_vblank = i915_disable_vblank,