diff options
author | Jesse Barnes <jbarnes@virtuousgeek.org> | 2014-12-10 15:16:05 -0500 |
---|---|---|
committer | Jani Nikula <jani.nikula@intel.com> | 2014-12-11 08:31:59 -0500 |
commit | 9f49c37635d5c2a801f7670d5fbf0b25ec461f2c (patch) | |
tree | c5e6dd24ca741825e6c8eacf71c16d4a1cf802bb /drivers/gpu | |
parent | 26459343e0fac1ea4cb5192c490e3e519eed74dd (diff) |
drm/i915: save/restore GMBUS freq across suspend/resume on gen4
Should probably just init this in the GMbus code all the time, based on
the cdclk and HPLL like we do on newer platforms. Ville has code for
that in a rework branch, but until then we can fix this bug fairly
easily.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=76301
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Tested-by: Nikolay <mar.kolya@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r-- | drivers/gpu/drm/i915/i915_drv.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_reg.h | 1 | ||||
-rw-r--r-- | drivers/gpu/drm/i915/i915_suspend.c | 8 |
3 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index be910d249ea1..63bcda5541ec 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -924,6 +924,7 @@ struct i915_suspend_saved_registers { | |||
924 | u32 savePIPEB_LINK_N1; | 924 | u32 savePIPEB_LINK_N1; |
925 | u32 saveMCHBAR_RENDER_STANDBY; | 925 | u32 saveMCHBAR_RENDER_STANDBY; |
926 | u32 savePCH_PORT_HOTPLUG; | 926 | u32 savePCH_PORT_HOTPLUG; |
927 | u16 saveGCDGMBUS; | ||
927 | }; | 928 | }; |
928 | 929 | ||
929 | struct vlv_s0ix_state { | 930 | struct vlv_s0ix_state { |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index b607bbe55261..eefdc238f70b 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -85,6 +85,7 @@ | |||
85 | #define I915_GC_RENDER_CLOCK_166_MHZ (0 << 0) | 85 | #define I915_GC_RENDER_CLOCK_166_MHZ (0 << 0) |
86 | #define I915_GC_RENDER_CLOCK_200_MHZ (1 << 0) | 86 | #define I915_GC_RENDER_CLOCK_200_MHZ (1 << 0) |
87 | #define I915_GC_RENDER_CLOCK_333_MHZ (4 << 0) | 87 | #define I915_GC_RENDER_CLOCK_333_MHZ (4 << 0) |
88 | #define GCDGMBUS 0xcc | ||
88 | #define PCI_LBPC 0xf4 /* legacy/combination backlight modes, also called LBB */ | 89 | #define PCI_LBPC 0xf4 /* legacy/combination backlight modes, also called LBB */ |
89 | 90 | ||
90 | 91 | ||
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c index dfe661743398..26368822a33f 100644 --- a/drivers/gpu/drm/i915/i915_suspend.c +++ b/drivers/gpu/drm/i915/i915_suspend.c | |||
@@ -303,6 +303,10 @@ int i915_save_state(struct drm_device *dev) | |||
303 | } | 303 | } |
304 | } | 304 | } |
305 | 305 | ||
306 | if (IS_GEN4(dev)) | ||
307 | pci_read_config_word(dev->pdev, GCDGMBUS, | ||
308 | &dev_priv->regfile.saveGCDGMBUS); | ||
309 | |||
306 | /* Cache mode state */ | 310 | /* Cache mode state */ |
307 | if (INTEL_INFO(dev)->gen < 7) | 311 | if (INTEL_INFO(dev)->gen < 7) |
308 | dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); | 312 | dev_priv->regfile.saveCACHE_MODE_0 = I915_READ(CACHE_MODE_0); |
@@ -331,6 +335,10 @@ int i915_restore_state(struct drm_device *dev) | |||
331 | mutex_lock(&dev->struct_mutex); | 335 | mutex_lock(&dev->struct_mutex); |
332 | 336 | ||
333 | i915_gem_restore_fences(dev); | 337 | i915_gem_restore_fences(dev); |
338 | |||
339 | if (IS_GEN4(dev)) | ||
340 | pci_write_config_word(dev->pdev, GCDGMBUS, | ||
341 | dev_priv->regfile.saveGCDGMBUS); | ||
334 | i915_restore_display(dev); | 342 | i915_restore_display(dev); |
335 | 343 | ||
336 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) { | 344 | if (!drm_core_check_feature(dev, DRIVER_MODESET)) { |