diff mbox

[24/33] drm/i915: VLV doesn't seem to have VGA0/VGA1/VGA_PD registers

Message ID 1359034198-19678-25-git-send-email-ville.syrjala@linux.intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ville Syrjala Jan. 24, 2013, 1:29 p.m. UTC
From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Don't touch VGA0/VGA1/VGA_PD in suspend/resume paths.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_suspend.c | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

Comments

Daniel Vetter Jan. 24, 2013, 10:26 p.m. UTC | #1
On Thu, Jan 24, 2013 at 03:29:49PM +0200, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> Don't touch VGA0/VGA1/VGA_PD in suspend/resume paths.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

By sheer coincidence I'm working on a few patches to no longer
safe/restore the legacy vga regs for DRIVER_MODESET. Which means this here
isn't required any more. For the current wip:

http://cgit.freedesktop.org/~danvet/drm/log/?h=modeset_s-r

-Daniel

> ---
>  drivers/gpu/drm/i915/i915_suspend.c | 20 ++++++++++++--------
>  1 file changed, 12 insertions(+), 8 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> index 63d4d30..05d82dc 100644
> --- a/drivers/gpu/drm/i915/i915_suspend.c
> +++ b/drivers/gpu/drm/i915/i915_suspend.c
> @@ -691,9 +691,11 @@ static void i915_save_display(struct drm_device *dev)
>  	}
>  
>  	/* VGA state */
> -	dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
> -	dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
> -	dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
> +	if (!IS_VALLEYVIEW(dev)) {
> +		dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
> +		dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
> +		dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
> +	}
>  	if (HAS_PCH_SPLIT(dev))
>  		dev_priv->regfile.saveVGACNTRL = I915_READ(CPU_VGACNTRL);
>  	else
> @@ -793,11 +795,13 @@ static void i915_restore_display(struct drm_device *dev)
>  	else
>  		I915_WRITE(VGACNTRL, dev_priv->regfile.saveVGACNTRL);
>  
> -	I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
> -	I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
> -	I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
> -	POSTING_READ(VGA_PD);
> -	udelay(150);
> +	if (!IS_VALLEYVIEW(dev)) {
> +		I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
> +		I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
> +		I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
> +		POSTING_READ(VGA_PD);
> +		udelay(150);
> +	}
>  
>  	i915_restore_vga(dev);
>  }
> -- 
> 1.7.12.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Ville Syrjala Jan. 25, 2013, 10:51 a.m. UTC | #2
On Thu, Jan 24, 2013 at 11:26:10PM +0100, Daniel Vetter wrote:
> On Thu, Jan 24, 2013 at 03:29:49PM +0200, ville.syrjala@linux.intel.com wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > Don't touch VGA0/VGA1/VGA_PD in suspend/resume paths.
> > 
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> By sheer coincidence I'm working on a few patches to no longer
> safe/restore the legacy vga regs for DRIVER_MODESET. Which means this here
> isn't required any more. For the current wip:
> 
> http://cgit.freedesktop.org/~danvet/drm/log/?h=modeset_s-r

OK

> > ---
> >  drivers/gpu/drm/i915/i915_suspend.c | 20 ++++++++++++--------
> >  1 file changed, 12 insertions(+), 8 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
> > index 63d4d30..05d82dc 100644
> > --- a/drivers/gpu/drm/i915/i915_suspend.c
> > +++ b/drivers/gpu/drm/i915/i915_suspend.c
> > @@ -691,9 +691,11 @@ static void i915_save_display(struct drm_device *dev)
> >  	}
> >  
> >  	/* VGA state */
> > -	dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
> > -	dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
> > -	dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
> > +	if (!IS_VALLEYVIEW(dev)) {
> > +		dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
> > +		dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
> > +		dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
> > +	}
> >  	if (HAS_PCH_SPLIT(dev))
> >  		dev_priv->regfile.saveVGACNTRL = I915_READ(CPU_VGACNTRL);
> >  	else
> > @@ -793,11 +795,13 @@ static void i915_restore_display(struct drm_device *dev)
> >  	else
> >  		I915_WRITE(VGACNTRL, dev_priv->regfile.saveVGACNTRL);
> >  
> > -	I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
> > -	I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
> > -	I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
> > -	POSTING_READ(VGA_PD);
> > -	udelay(150);
> > +	if (!IS_VALLEYVIEW(dev)) {
> > +		I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
> > +		I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
> > +		I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
> > +		POSTING_READ(VGA_PD);
> > +		udelay(150);
> > +	}
> >  
> >  	i915_restore_vga(dev);
> >  }
> > -- 
> > 1.7.12.4
> > 
> > _______________________________________________
> > 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
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 63d4d30..05d82dc 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -691,9 +691,11 @@  static void i915_save_display(struct drm_device *dev)
 	}
 
 	/* VGA state */
-	dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
-	dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
-	dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
+	if (!IS_VALLEYVIEW(dev)) {
+		dev_priv->regfile.saveVGA0 = I915_READ(VGA0);
+		dev_priv->regfile.saveVGA1 = I915_READ(VGA1);
+		dev_priv->regfile.saveVGA_PD = I915_READ(VGA_PD);
+	}
 	if (HAS_PCH_SPLIT(dev))
 		dev_priv->regfile.saveVGACNTRL = I915_READ(CPU_VGACNTRL);
 	else
@@ -793,11 +795,13 @@  static void i915_restore_display(struct drm_device *dev)
 	else
 		I915_WRITE(VGACNTRL, dev_priv->regfile.saveVGACNTRL);
 
-	I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
-	I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
-	I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
-	POSTING_READ(VGA_PD);
-	udelay(150);
+	if (!IS_VALLEYVIEW(dev)) {
+		I915_WRITE(VGA0, dev_priv->regfile.saveVGA0);
+		I915_WRITE(VGA1, dev_priv->regfile.saveVGA1);
+		I915_WRITE(VGA_PD, dev_priv->regfile.saveVGA_PD);
+		POSTING_READ(VGA_PD);
+		udelay(150);
+	}
 
 	i915_restore_vga(dev);
 }