[Intel-gfx] [PATCH][drm/i915] restore HWS_PGA if resuming from suspend

Li Peng peng.li at linux.intel.com
Mon Nov 17 11:14:49 CET 2008


This patch restore HWS_PGA for device who don't use gtt mapped hardware
status page.
It is to fix the suspend/resume failure of xf86-video-intel dri2 branch
on 945GME, as the dri2 branch doesn't call I830Resume() to restore
hardware status page anymore and we need to handle this in
i915_gem_entervt_ioctl()

Comments are welcome. Thanks

Peng
diff --git a/drivers/gpu/drm/i915/i915_gem.c
b/drivers/gpu/drm/i915/i915_gem.c
index a15b098..b6b451a 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -2924,8 +2924,13 @@ i915_gem_init_hws(struct drm_device *dev)
 	/* If we need a physical address for the status page, it's already
 	 * initialized at driver load time.
 	 */
-	if (!I915_NEED_GFX_HWS(dev))
+	if (!I915_NEED_GFX_HWS(dev)) {
+		if (dev_priv->mm.suspended) {
+			I915_WRITE(HWS_PGA, dev_priv->dma_status_page);
+			I915_READ(HWS_PGA); /* posting read */
+		}
 		return 0;
+	}
 
 	obj = drm_gem_object_alloc(dev, 4096);
 	if (obj == NULL) {





More information about the Intel-gfx mailing list