All of lore.kernel.org
 help / color / mirror / Atom feed
* VT switchless resume patches
@ 2013-02-15 20:42 Jesse Barnes
  2013-02-15 20:42 ` [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly Jesse Barnes
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 20:42 UTC (permalink / raw)
  To: intel-gfx

Had to fix up a few things:
  - LVDS blind restore from old suspend/resume code
  - cursor restore
  - sprite restore

Plus a couple of misc patches.  Enough to make things work in X, though
our handling of sprites still needs improvement; I think our watermarks
are programmed out of order even though the state seems to be getting
restored correctly.

Thanks,
Jesse

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

* [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly
  2013-02-15 20:42 VT switchless resume patches Jesse Barnes
@ 2013-02-15 20:42 ` Jesse Barnes
  2013-02-15 21:10   ` Daniel Vetter
  2013-02-15 20:42 ` [PATCH 2/6] drm/i915: add sprite restore function Jesse Barnes
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 20:42 UTC (permalink / raw)
  To: intel-gfx

We still rely on a few LVDS bits, but restoring the enable bit can cause
trouble at this point, so don't.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_suspend.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 2135f21..a81abed 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -268,9 +268,9 @@ static void i915_restore_display(struct drm_device *dev)
 		I915_WRITE(BLC_PWM_CTL2, dev_priv->regfile.saveBLC_PWM_CTL2);
 
 	if (HAS_PCH_SPLIT(dev)) {
-		I915_WRITE(PCH_LVDS, dev_priv->regfile.saveLVDS);
+		I915_WRITE(PCH_LVDS, dev_priv->regfile.saveLVDS & 0x7fffffff);
 	} else if (IS_MOBILE(dev) && !IS_I830(dev))
-		I915_WRITE(LVDS, dev_priv->regfile.saveLVDS);
+		I915_WRITE(LVDS, dev_priv->regfile.saveLVDS & 0x7fffffff);
 
 	if (!IS_I830(dev) && !IS_845G(dev) && !HAS_PCH_SPLIT(dev))
 		I915_WRITE(PFIT_CONTROL, dev_priv->regfile.savePFIT_CONTROL);
-- 
1.7.9.5

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

* [PATCH 2/6] drm/i915: add sprite restore function
  2013-02-15 20:42 VT switchless resume patches Jesse Barnes
  2013-02-15 20:42 ` [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly Jesse Barnes
@ 2013-02-15 20:42 ` Jesse Barnes
  2013-02-15 20:42 ` [PATCH 3/6] drm/i915: restore cursor and sprite state when forcing a config restore Jesse Barnes
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 20:42 UTC (permalink / raw)
  To: intel-gfx

To be used to restore sprite state on resume.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_drv.h    |    5 +++++
 drivers/gpu/drm/i915/intel_sprite.c |   23 +++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
index 005a91f..1b548e0 100644
--- a/drivers/gpu/drm/i915/intel_drv.h
+++ b/drivers/gpu/drm/i915/intel_drv.h
@@ -247,6 +247,10 @@ struct intel_plane {
 	bool can_scale;
 	int max_downscale;
 	u32 lut_r[1024], lut_g[1024], lut_b[1024];
+	int crtc_x, crtc_y;
+	unsigned int crtc_w, crtc_h;
+	uint32_t x, y;
+	uint32_t src_w, src_h;
 	void (*update_plane)(struct drm_plane *plane,
 			     struct drm_framebuffer *fb,
 			     struct drm_i915_gem_object *obj,
@@ -532,6 +536,7 @@ extern bool intel_encoder_check_is_cloned(struct intel_encoder *encoder);
 extern void intel_connector_dpms(struct drm_connector *, int mode);
 extern bool intel_connector_get_hw_state(struct intel_connector *connector);
 extern void intel_modeset_check_state(struct drm_device *dev);
+extern void intel_plane_restore(struct drm_plane *plane);
 
 
 static inline struct intel_encoder *intel_attached_encoder(struct drm_connector *connector)
diff --git a/drivers/gpu/drm/i915/intel_sprite.c b/drivers/gpu/drm/i915/intel_sprite.c
index 03cfd62..9ac9260 100644
--- a/drivers/gpu/drm/i915/intel_sprite.c
+++ b/drivers/gpu/drm/i915/intel_sprite.c
@@ -529,6 +529,15 @@ intel_update_plane(struct drm_plane *plane, struct drm_crtc *crtc,
 	if (disable_primary)
 		intel_disable_primary(crtc);
 
+	intel_plane->crtc_x = crtc_x;
+	intel_plane->crtc_y = crtc_y;
+	intel_plane->crtc_w = crtc_w;
+	intel_plane->crtc_h = crtc_h;
+	intel_plane->x = x;
+	intel_plane->y = y;
+	intel_plane->src_w = src_w;
+	intel_plane->src_h = src_h;
+
 	/* Unpin old obj after new one is active to avoid ugliness */
 	if (old_obj) {
 		/*
@@ -644,6 +653,20 @@ out_unlock:
 	return ret;
 }
 
+void intel_plane_restore(struct drm_plane *plane)
+{
+	struct intel_plane *intel_plane = to_intel_plane(plane);
+
+	if (!plane->crtc || !plane->fb)
+		return;
+
+	intel_update_plane(plane, plane->crtc, plane->fb,
+			   intel_plane->crtc_x, intel_plane->crtc_y,
+			   intel_plane->crtc_w, intel_plane->crtc_h,
+			   intel_plane->x, intel_plane->y,
+			   intel_plane->src_w, intel_plane->src_h);
+}
+
 static const struct drm_plane_funcs intel_plane_funcs = {
 	.update_plane = intel_update_plane,
 	.disable_plane = intel_disable_plane,
-- 
1.7.9.5

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

* [PATCH 3/6] drm/i915: restore cursor and sprite state when forcing a config restore
  2013-02-15 20:42 VT switchless resume patches Jesse Barnes
  2013-02-15 20:42 ` [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly Jesse Barnes
  2013-02-15 20:42 ` [PATCH 2/6] drm/i915: add sprite restore function Jesse Barnes
@ 2013-02-15 20:42 ` Jesse Barnes
  2013-02-15 20:42 ` [PATCH 4/6] drm/i915: enable VT switchless resume Jesse Barnes
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 20:42 UTC (permalink / raw)
  To: intel-gfx

Needed for VT switchless resume.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_display.c |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 3e6dadf..2bf076e 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -8985,6 +8985,7 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
 	struct drm_i915_private *dev_priv = dev->dev_private;
 	enum pipe pipe;
 	u32 tmp;
+	struct drm_plane *plane;
 	struct intel_crtc *crtc;
 	struct intel_encoder *encoder;
 	struct intel_connector *connector;
@@ -9081,8 +9082,20 @@ void intel_modeset_setup_hw_state(struct drm_device *dev,
 
 	if (force_restore) {
 		for_each_pipe(pipe) {
-			intel_crtc_restore_mode(dev_priv->pipe_to_crtc_mapping[pipe]);
+			struct drm_crtc *crtc =
+				dev_priv->pipe_to_crtc_mapping[pipe];
+			struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
+
+			intel_crtc_restore_mode(crtc);
+			if (intel_crtc->cursor_visible) {
+				/* Force update for previously enabled cursor */
+				intel_crtc->cursor_visible = false;
+				intel_crtc_update_cursor(&intel_crtc->base,
+							 true);
+			}
 		}
+		list_for_each_entry(plane, &dev->mode_config.plane_list, head)
+			intel_plane_restore(plane);
 
 		i915_redisable_vga(dev);
 	} else {
-- 
1.7.9.5

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

* [PATCH 4/6] drm/i915: enable VT switchless resume
  2013-02-15 20:42 VT switchless resume patches Jesse Barnes
                   ` (2 preceding siblings ...)
  2013-02-15 20:42 ` [PATCH 3/6] drm/i915: restore cursor and sprite state when forcing a config restore Jesse Barnes
@ 2013-02-15 20:42 ` Jesse Barnes
  2013-02-15 21:14   ` Daniel Vetter
  2013-02-15 20:42 ` [PATCH 5/6] drm/i915: emit a hotplug event on resume Jesse Barnes
  2013-02-15 20:42 ` [PATCH 6/6] drm/i915: remove disabled memset of framebuffer from intel_fb Jesse Barnes
  5 siblings, 1 reply; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 20:42 UTC (permalink / raw)
  To: intel-gfx

With the other bits in place, we can do this safely.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_drv.c |    9 ++++++---
 drivers/gpu/drm/i915/intel_fb.c |    3 +++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index c5b8c81..12a14e1 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -492,8 +492,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 		cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);
 
-		intel_modeset_disable(dev);
-
 		drm_irq_uninstall(dev);
 	}
 
@@ -569,9 +567,14 @@ static int __i915_drm_thaw(struct drm_device *dev)
 		mutex_unlock(&dev->struct_mutex);
 
 		intel_modeset_init_hw(dev);
-		intel_modeset_setup_hw_state(dev, false);
+
 		drm_irq_install(dev);
 		intel_hpd_init(dev);
+
+		/* Resume the modeset for every activated CRTC */
+		drm_modeset_lock_all(dev);
+		intel_modeset_setup_hw_state(dev, true);
+		drm_modeset_unlock_all(dev);
 	}
 
 	intel_opregion_init(dev);
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 1c510da..987bc33 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -149,6 +149,9 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 	}
 	info->screen_size = size;
 
+	/* This driver doesn't need a VT switch to restore the mode on resume */
+	info->skip_vt_switch = true;
+
 //	memset(info->screen_base, 0, size);
 
 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
-- 
1.7.9.5

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

* [PATCH 5/6] drm/i915: emit a hotplug event on resume
  2013-02-15 20:42 VT switchless resume patches Jesse Barnes
                   ` (3 preceding siblings ...)
  2013-02-15 20:42 ` [PATCH 4/6] drm/i915: enable VT switchless resume Jesse Barnes
@ 2013-02-15 20:42 ` Jesse Barnes
  2013-02-15 20:42 ` [PATCH 6/6] drm/i915: remove disabled memset of framebuffer from intel_fb Jesse Barnes
  5 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 20:42 UTC (permalink / raw)
  To: intel-gfx

This will poke userspace into probing for configuration changes that may
have occurred across suspend/resume.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_drv.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index 12a14e1..5e4f76b 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -548,6 +548,24 @@ void intel_console_resume(struct work_struct *work)
 	console_unlock();
 }
 
+static void intel_resume_hotplug(struct drm_device *dev)
+{
+	struct drm_mode_config *mode_config = &dev->mode_config;
+	struct intel_encoder *encoder;
+
+	mutex_lock(&mode_config->mutex);
+	DRM_DEBUG_KMS("running encoder hotplug functions\n");
+
+	list_for_each_entry(encoder, &mode_config->encoder_list, base.head)
+		if (encoder->hot_plug)
+			encoder->hot_plug(encoder);
+
+	mutex_unlock(&mode_config->mutex);
+
+	/* Just fire off a uevent and let userspace tell us what to do */
+	drm_helper_hpd_irq_event(dev);
+}
+
 static int __i915_drm_thaw(struct drm_device *dev)
 {
 	struct drm_i915_private *dev_priv = dev->dev_private;
@@ -575,6 +593,8 @@ static int __i915_drm_thaw(struct drm_device *dev)
 		drm_modeset_lock_all(dev);
 		intel_modeset_setup_hw_state(dev, true);
 		drm_modeset_unlock_all(dev);
+
+		intel_resume_hotplug(dev);
 	}
 
 	intel_opregion_init(dev);
-- 
1.7.9.5

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

* [PATCH 6/6] drm/i915: remove disabled memset of framebuffer from intel_fb
  2013-02-15 20:42 VT switchless resume patches Jesse Barnes
                   ` (4 preceding siblings ...)
  2013-02-15 20:42 ` [PATCH 5/6] drm/i915: emit a hotplug event on resume Jesse Barnes
@ 2013-02-15 20:42 ` Jesse Barnes
  5 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 20:42 UTC (permalink / raw)
  To: intel-gfx

Commented out and unneeded.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/intel_fb.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 987bc33..f4e0b88 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -152,8 +152,6 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 	/* This driver doesn't need a VT switch to restore the mode on resume */
 	info->skip_vt_switch = true;
 
-//	memset(info->screen_base, 0, size);
-
 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
 	drm_fb_helper_fill_var(info, &ifbdev->helper, sizes->fb_width, sizes->fb_height);
 
-- 
1.7.9.5

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

* Re: [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly
  2013-02-15 20:42 ` [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly Jesse Barnes
@ 2013-02-15 21:10   ` Daniel Vetter
  2013-02-15 21:15     ` Jesse Barnes
  0 siblings, 1 reply; 11+ messages in thread
From: Daniel Vetter @ 2013-02-15 21:10 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Fri, Feb 15, 2013 at 12:42:32PM -0800, Jesse Barnes wrote:
> We still rely on a few LVDS bits, but restoring the enable bit can cause
> trouble at this point, so don't.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_suspend.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index 2135f21..a81abed 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -268,9 +268,9 @@ static void i915_restore_display(struct drm_device *dev)
>  		I915_WRITE(BLC_PWM_CTL2, dev_priv->regfile.saveBLC_PWM_CTL2);
>  
>  	if (HAS_PCH_SPLIT(dev)) {
> -		I915_WRITE(PCH_LVDS, dev_priv->regfile.saveLVDS);
> +		I915_WRITE(PCH_LVDS, dev_priv->regfile.saveLVDS & 0x7fffffff);

~LVDS_PORT_EN and I think you need to make this conditional on kms.
-Daniel

>  	} else if (IS_MOBILE(dev) && !IS_I830(dev))
> -		I915_WRITE(LVDS, dev_priv->regfile.saveLVDS);
> +		I915_WRITE(LVDS, dev_priv->regfile.saveLVDS & 0x7fffffff);
>  
>  	if (!IS_I830(dev) && !IS_845G(dev) && !HAS_PCH_SPLIT(dev))
>  		I915_WRITE(PFIT_CONTROL, dev_priv->regfile.savePFIT_CONTROL);
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH 4/6] drm/i915: enable VT switchless resume
  2013-02-15 20:42 ` [PATCH 4/6] drm/i915: enable VT switchless resume Jesse Barnes
@ 2013-02-15 21:14   ` Daniel Vetter
  0 siblings, 0 replies; 11+ messages in thread
From: Daniel Vetter @ 2013-02-15 21:14 UTC (permalink / raw)
  To: Jesse Barnes; +Cc: intel-gfx

On Fri, Feb 15, 2013 at 12:42:35PM -0800, Jesse Barnes wrote:
> With the other bits in place, we can do this safely.
> 
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
>  drivers/gpu/drm/i915/i915_drv.c |    9 ++++++---
>  drivers/gpu/drm/i915/intel_fb.c |    3 +++
>  2 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
> index c5b8c81..12a14e1 100644
> --- a/drivers/gpu/drm/i915/i915_drv.c
> +++ b/drivers/gpu/drm/i915/i915_drv.c
> @@ -492,8 +492,6 @@ static int i915_drm_freeze(struct drm_device *dev)
>  
>  		cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);
>  
> -		intel_modeset_disable(dev);

I think we still need to turn off the backlight here (or teach the
register restore code more smarts, but that's more work). Otherwise we'll
turn on the backlight before the panel mode is restored ...
-Daniel

> -
>  		drm_irq_uninstall(dev);
>  	}
>  
> @@ -569,9 +567,14 @@ static int __i915_drm_thaw(struct drm_device *dev)
>  		mutex_unlock(&dev->struct_mutex);
>  
>  		intel_modeset_init_hw(dev);
> -		intel_modeset_setup_hw_state(dev, false);
> +
>  		drm_irq_install(dev);
>  		intel_hpd_init(dev);
> +
> +		/* Resume the modeset for every activated CRTC */
> +		drm_modeset_lock_all(dev);
> +		intel_modeset_setup_hw_state(dev, true);
> +		drm_modeset_unlock_all(dev);
>  	}
>  
>  	intel_opregion_init(dev);
> diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
> index 1c510da..987bc33 100644
> --- a/drivers/gpu/drm/i915/intel_fb.c
> +++ b/drivers/gpu/drm/i915/intel_fb.c
> @@ -149,6 +149,9 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
>  	}
>  	info->screen_size = size;
>  
> +	/* This driver doesn't need a VT switch to restore the mode on resume */
> +	info->skip_vt_switch = true;
> +
>  //	memset(info->screen_base, 0, size);
>  
>  	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly
  2013-02-15 21:10   ` Daniel Vetter
@ 2013-02-15 21:15     ` Jesse Barnes
  0 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 21:15 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Fri, 15 Feb 2013 22:10:39 +0100
Daniel Vetter <daniel@ffwll.ch> wrote:

> On Fri, Feb 15, 2013 at 12:42:32PM -0800, Jesse Barnes wrote:
> > We still rely on a few LVDS bits, but restoring the enable bit can cause
> > trouble at this point, so don't.
> > 
> > Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> > ---
> >  drivers/gpu/drm/i915/i915_suspend.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> > index 2135f21..a81abed 100644
> > --- a/drivers/gpu/drm/i915/i915_suspend.c
> > +++ b/drivers/gpu/drm/i915/i915_suspend.c
> > @@ -268,9 +268,9 @@ static void i915_restore_display(struct drm_device *dev)
> >  		I915_WRITE(BLC_PWM_CTL2, dev_priv->regfile.saveBLC_PWM_CTL2);
> >  
> >  	if (HAS_PCH_SPLIT(dev)) {
> > -		I915_WRITE(PCH_LVDS, dev_priv->regfile.saveLVDS);
> > +		I915_WRITE(PCH_LVDS, dev_priv->regfile.saveLVDS & 0x7fffffff);
> 
> ~LVDS_PORT_EN and I think you need to make this conditional on kms.
> -Daniel

Good call, will respin.

-- 
Jesse Barnes, Intel Open Source Technology Center

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

* [PATCH 4/6] drm/i915: enable VT switchless resume
  2013-02-15 21:07 VT switchless resume v2 Jesse Barnes
@ 2013-02-15 21:07 ` Jesse Barnes
  0 siblings, 0 replies; 11+ messages in thread
From: Jesse Barnes @ 2013-02-15 21:07 UTC (permalink / raw)
  To: intel-gfx

With the other bits in place, we can do this safely.

Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
---
 drivers/gpu/drm/i915/i915_drv.c |    9 ++++++---
 drivers/gpu/drm/i915/intel_fb.c |    3 +++
 2 files changed, 9 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
index c5b8c81..12a14e1 100644
--- a/drivers/gpu/drm/i915/i915_drv.c
+++ b/drivers/gpu/drm/i915/i915_drv.c
@@ -492,8 +492,6 @@ static int i915_drm_freeze(struct drm_device *dev)
 
 		cancel_delayed_work_sync(&dev_priv->rps.delayed_resume_work);
 
-		intel_modeset_disable(dev);
-
 		drm_irq_uninstall(dev);
 	}
 
@@ -569,9 +567,14 @@ static int __i915_drm_thaw(struct drm_device *dev)
 		mutex_unlock(&dev->struct_mutex);
 
 		intel_modeset_init_hw(dev);
-		intel_modeset_setup_hw_state(dev, false);
+
 		drm_irq_install(dev);
 		intel_hpd_init(dev);
+
+		/* Resume the modeset for every activated CRTC */
+		drm_modeset_lock_all(dev);
+		intel_modeset_setup_hw_state(dev, true);
+		drm_modeset_unlock_all(dev);
 	}
 
 	intel_opregion_init(dev);
diff --git a/drivers/gpu/drm/i915/intel_fb.c b/drivers/gpu/drm/i915/intel_fb.c
index 1c510da..987bc33 100644
--- a/drivers/gpu/drm/i915/intel_fb.c
+++ b/drivers/gpu/drm/i915/intel_fb.c
@@ -149,6 +149,9 @@ static int intelfb_create(struct intel_fbdev *ifbdev,
 	}
 	info->screen_size = size;
 
+	/* This driver doesn't need a VT switch to restore the mode on resume */
+	info->skip_vt_switch = true;
+
 //	memset(info->screen_base, 0, size);
 
 	drm_fb_helper_fill_fix(info, fb->pitches[0], fb->depth);
-- 
1.7.9.5

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

end of thread, other threads:[~2013-02-15 21:14 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-02-15 20:42 VT switchless resume patches Jesse Barnes
2013-02-15 20:42 ` [PATCH 1/6] drm/i915: don't restore LVDS enable state blindly Jesse Barnes
2013-02-15 21:10   ` Daniel Vetter
2013-02-15 21:15     ` Jesse Barnes
2013-02-15 20:42 ` [PATCH 2/6] drm/i915: add sprite restore function Jesse Barnes
2013-02-15 20:42 ` [PATCH 3/6] drm/i915: restore cursor and sprite state when forcing a config restore Jesse Barnes
2013-02-15 20:42 ` [PATCH 4/6] drm/i915: enable VT switchless resume Jesse Barnes
2013-02-15 21:14   ` Daniel Vetter
2013-02-15 20:42 ` [PATCH 5/6] drm/i915: emit a hotplug event on resume Jesse Barnes
2013-02-15 20:42 ` [PATCH 6/6] drm/i915: remove disabled memset of framebuffer from intel_fb Jesse Barnes
2013-02-15 21:07 VT switchless resume v2 Jesse Barnes
2013-02-15 21:07 ` [PATCH 4/6] drm/i915: enable VT switchless resume Jesse Barnes

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.