[Intel-gfx] [PATCH 27/29] drm/i915: Add save/restore of SWF for ILK+

ville.syrjala at linux.intel.com ville.syrjala at linux.intel.com
Wed Nov 4 13:20:15 PST 2015


From: Ville Syrjälä <ville.syrjala at linux.intel.com>

No idea if we might want these. Perhaps there is a "keep your paws off
my GPU" bit in there somewhere to avoid BIOS crap?

Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
---
 drivers/gpu/drm/i915/i915_drv.h     | 13 ++++++++++---
 drivers/gpu/drm/i915/i915_reg.h     |  1 +
 drivers/gpu/drm/i915/i915_suspend.c |  6 ++++++
 3 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index cfac5c3..88ab00b 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -1016,9 +1016,16 @@ struct i915_suspend_saved_registers {
 	u32 saveFBC_CONTROL;
 	u32 saveCACHE_MODE_0;
 	u32 saveMI_ARB_STATE;
-	u32 saveSWF0[16];
-	u32 saveSWF1[16];
-	u32 saveSWF3[3];
+	union {
+		struct {
+			u32 saveSWF0[16];
+			u32 saveSWF1[16];
+			u32 saveSWF3[3];
+		};
+		struct {
+			u32 saveSWF_ILK[36];
+		};
+	};
 	uint64_t saveFENCE[I915_MAX_NUM_FENCES];
 	u32 savePCH_PORT_HOTPLUG;
 	u16 saveGCDGMBUS;
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 2478267..96fd0f5 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -5030,6 +5030,7 @@ enum skl_disp_power_wells {
 #define SWF0(i)	(dev_priv->info.display_mmio_offset + 0x70410 + (i) * 4)
 #define SWF1(i)	(dev_priv->info.display_mmio_offset + 0x71410 + (i) * 4)
 #define SWF3(i)	(dev_priv->info.display_mmio_offset + 0x72414 + (i) * 4)
+#define SWF_ILK(i)	(0x4F000 + (i) * 4)
 
 /* Pipe B */
 #define _PIPEBDSL		(dev_priv->info.display_mmio_offset + 0x71000)
diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
index 2d91821..297afe9 100644
--- a/drivers/gpu/drm/i915/i915_suspend.c
+++ b/drivers/gpu/drm/i915/i915_suspend.c
@@ -139,6 +139,9 @@ int i915_save_state(struct drm_device *dev)
 		}
 		for (i = 0; i < 3; i++)
 			dev_priv->regfile.saveSWF3[i] = I915_READ(SWF3(i));
+	} else {
+		for (i = 0; i < 36; i++)
+			dev_priv->regfile.saveSWF_ILK[i] = I915_READ(SWF_ILK(i));
 	}
 
 	mutex_unlock(&dev->struct_mutex);
@@ -186,6 +189,9 @@ int i915_restore_state(struct drm_device *dev)
 		}
 		for (i = 0; i < 3; i++)
 			I915_WRITE(SWF3(i), dev_priv->regfile.saveSWF3[i]);
+	} else {
+		for (i = 0; i < 36; i++)
+			I915_WRITE(SWF_ILK(i), dev_priv->regfile.saveSWF_ILK[i]);
 	}
 
 	mutex_unlock(&dev->struct_mutex);
-- 
2.4.10



More information about the Intel-gfx mailing list