intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/i915: unbreak lastclose for failed driver init
@ 2012-07-21 14:47 Daniel Vetter
  2012-07-23 20:17 ` Daniel Vetter
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Vetter @ 2012-07-21 14:47 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

We now refuse to load on gen6+ if kms is not enabled:

commit 26394d9251879231b85e6c8cf899fa43e75c68f1
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Mon Mar 26 21:33:18 2012 +0200

    drm/i915: refuse to load on gen6+ without kms

Which results in the drm core calling our lastclose function to clean
up the mess, but that one is neatly broken for such failure cases
since kms has been introduced in

commit 79e539453b34e35f39299a899d263b0a1f1670bd
Author: Jesse Barnes <jbarnes@virtuousgeek.org>
Date:   Fri Nov 7 14:24:08 2008 -0800

    DRM: i915: add mode setting support

Reported-by: Paulo Zanoni <przanoni@gmail.com>
Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/i915_dma.c |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 23868d3..25901c3 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1781,7 +1781,13 @@ void i915_driver_lastclose(struct drm_device * dev)
 {
 	drm_i915_private_t *dev_priv = dev->dev_private;
 
-	if (!dev_priv || drm_core_check_feature(dev, DRIVER_MODESET)) {
+	/* On gen6+ we refuse to init without kms enabled, but then the drm core
+	 * goes right around and calls lastclose. Check for this and don't clean
+	 * up anything. */
+	if (!dev_priv)
+		return;
+
+	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
 		intel_fb_restore_mode(dev);
 		vga_switcheroo_process_delayed_switch();
 		return;
-- 
1.7.10.4

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

* Re: [PATCH] drm/i915: unbreak lastclose for failed driver init
  2012-07-21 14:47 [PATCH] drm/i915: unbreak lastclose for failed driver init Daniel Vetter
@ 2012-07-23 20:17 ` Daniel Vetter
  0 siblings, 0 replies; 2+ messages in thread
From: Daniel Vetter @ 2012-07-23 20:17 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Sat, Jul 21, 2012 at 04:47:09PM +0200, Daniel Vetter wrote:
> We now refuse to load on gen6+ if kms is not enabled:
> 
> commit 26394d9251879231b85e6c8cf899fa43e75c68f1
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Mon Mar 26 21:33:18 2012 +0200
> 
>     drm/i915: refuse to load on gen6+ without kms
> 
> Which results in the drm core calling our lastclose function to clean
> up the mess, but that one is neatly broken for such failure cases
> since kms has been introduced in
> 
> commit 79e539453b34e35f39299a899d263b0a1f1670bd
> Author: Jesse Barnes <jbarnes@virtuousgeek.org>
> Date:   Fri Nov 7 14:24:08 2008 -0800
> 
>     DRM: i915: add mode setting support
> 
> Reported-by: Paulo Zanoni <przanoni@gmail.com>
> Signed-Off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
I've picked this one up for -fixes, although Paulo still has issues with
modeset=0 (but no longer this backtrace).
-Daniel

> ---
>  drivers/gpu/drm/i915/i915_dma.c |    8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
> index 23868d3..25901c3 100644
> --- a/drivers/gpu/drm/i915/i915_dma.c
> +++ b/drivers/gpu/drm/i915/i915_dma.c
> @@ -1781,7 +1781,13 @@ void i915_driver_lastclose(struct drm_device * dev)
>  {
>  	drm_i915_private_t *dev_priv = dev->dev_private;
>  
> -	if (!dev_priv || drm_core_check_feature(dev, DRIVER_MODESET)) {
> +	/* On gen6+ we refuse to init without kms enabled, but then the drm core
> +	 * goes right around and calls lastclose. Check for this and don't clean
> +	 * up anything. */
> +	if (!dev_priv)
> +		return;
> +
> +	if (drm_core_check_feature(dev, DRIVER_MODESET)) {
>  		intel_fb_restore_mode(dev);
>  		vga_switcheroo_process_delayed_switch();
>  		return;
> -- 
> 1.7.10.4
> 

-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

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

end of thread, other threads:[~2012-07-23 20:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-21 14:47 [PATCH] drm/i915: unbreak lastclose for failed driver init Daniel Vetter
2012-07-23 20:17 ` Daniel Vetter

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).