From 766aa1c42362eafc53f5939cd3f83113e9d062ed Mon Sep 17 00:00:00 2001 From: Ville Syrjälä Date: Fri, 25 Jan 2013 21:44:46 +0200 Subject: drm/i915: Introduce i915_vgacntrl_reg() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The VGACNTRL register has moved around between different platforms. To handle the differences add i915_vgacntrl_reg() which returns the correct offset for the VGACNTRL register. Signed-off-by: Ville Syrjälä Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/i915_suspend.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'drivers/gpu/drm/i915/i915_suspend.c') diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index 3911e0450bb..2135f21ea45 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c @@ -73,10 +73,7 @@ static void i915_save_vga(struct drm_device *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 - dev_priv->regfile.saveVGACNTRL = I915_READ(VGACNTRL); + dev_priv->regfile.saveVGACNTRL = I915_READ(i915_vgacntrl_reg(dev)); /* VGA color palette registers */ dev_priv->regfile.saveDACMASK = I915_READ8(VGA_DACMASK); @@ -137,10 +134,7 @@ static void i915_restore_vga(struct drm_device *dev) u16 cr_index, cr_data, st01; /* VGA state */ - if (HAS_PCH_SPLIT(dev)) - I915_WRITE(CPU_VGACNTRL, dev_priv->regfile.saveVGACNTRL); - else - I915_WRITE(VGACNTRL, dev_priv->regfile.saveVGACNTRL); + I915_WRITE(i915_vgacntrl_reg(dev), dev_priv->regfile.saveVGACNTRL); I915_WRITE(VGA0, dev_priv->regfile.saveVGA0); I915_WRITE(VGA1, dev_priv->regfile.saveVGA1); -- cgit v1.2.3-70-g09d2