Skip to contentSkip to conversation

drm/i915: Add ECOBITS_SNB_BIT

PATCH Applied [email protected] 3 participants 5 messages Apr 4, 2013 – Apr 9, 2013

Subsystems (2)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 drm/i915: Add ECOBITS_SNB_BIT

From: Ville Syrjälä <[email protected]>

GAC_ECO_BITS has a bit similar to GAM_ECOCHK's ECOCHK_SNB_BIT. Add the define, and enable it on SNB.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 3 ++-
 drivers/gpu/drm/i915/i915_reg.h     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -1
index 24a23b3..593137b 100644
@@ -312,7 +312,8 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
 		uint32_t ecochk, gab_ctl, ecobits;
 
 		ecobits = I915_READ(GAC_ECO_BITS);
-		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_PPGTT_CACHE64B);
+		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_SNB_BIT |
+					 ECOBITS_PPGTT_CACHE64B);
 
 		gab_ctl = I915_READ(GAB_CTL);
 		I915_WRITE(GAB_CTL, gab_ctl | GAB_CTL_CONT_AFTER_PAGEFAULT);
drivers/gpu/drm/i915/i915_reg.h +1 -0
index 058686c..4b8fd4d 100644
@@ -127,6 +127,7 @@
 #define   ECOCHK_PPGTT_CACHE4B		(0x0<<3)
 
 #define GAC_ECO_BITS			0x14090
+#define   ECOBITS_SNB_BIT		(1<<13)
 #define   ECOBITS_PPGTT_CACHE64B	(3<<8)
 #define   ECOBITS_PPGTT_CACHE4B		(0<<8)
 
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#1 lore raw

PATCH 2/3 drm/i915: Set GAC_ECO_BITS register on Gen7+

From: Ville Syrjälä <[email protected]>

According to BSpec GAC_ECO_BITS register exists on Gen7 platforms as well. Configure it accordingly.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_gem_gtt.c +5 -0
index 593137b..a851362 100644
@@ -323,6 +323,11 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
 				       ECOCHK_PPGTT_CACHE64B);
 		I915_WRITE(GFX_MODE, _MASKED_BIT_ENABLE(GFX_PPGTT_ENABLE));
 	} else if (INTEL_INFO(dev)->gen >= 7) {
+		uint32_t ecobits;
+
+		ecobits = I915_READ(GAC_ECO_BITS);
+		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_PPGTT_CACHE64B);
+
 		I915_WRITE(GAM_ECOCHK, ECOCHK_PPGTT_CACHE64B);
 		/* GFX_MODE is per-ring on gen7+ */
 	}
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH 3/3 drm/i915: Configure GAM_ECOCHK appropriatly for Gen7

In reply to [email protected]

From: Ville Syrjälä <[email protected]>

IVB and HSW use different encodings for the PPGTT cacheability bits in the GAM_ECOCHK register.

---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 11 +++++++++--
 drivers/gpu/drm/i915/i915_reg.h     |  5 +++++
 2 files changed, 14 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +9 -2
index a851362..4d86fe4 100644
@@ -323,12 +323,19 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
 				       ECOCHK_PPGTT_CACHE64B);
 		I915_WRITE(GFX_MODE, _MASKED_BIT_ENABLE(GFX_PPGTT_ENABLE));
 	} else if (INTEL_INFO(dev)->gen >= 7) {
-		uint32_t ecobits;
+		uint32_t ecochk, ecobits;
 
 		ecobits = I915_READ(GAC_ECO_BITS);
 		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_PPGTT_CACHE64B);
 
-		I915_WRITE(GAM_ECOCHK, ECOCHK_PPGTT_CACHE64B);
+		ecochk = I915_READ(GAM_ECOCHK);
+		if (IS_HASWELL(dev)) {
+			ecochk |= ECOCHK_PPGTT_WB_HSW;
+		} else {
+			ecochk |= ECOCHK_PPGTT_LLC_IVB;
+			ecochk &= ~ECOCHK_PPGTT_GFDT_IVB;
+		}
+		I915_WRITE(GAM_ECOCHK, ecochk);
 		/* GFX_MODE is per-ring on gen7+ */
 	}
 
drivers/gpu/drm/i915/i915_reg.h +5 -0
index 4b8fd4d..44051fa 100644
@@ -125,6 +125,11 @@
 #define   HSW_ECOCHK_ARB_PRIO_SOL	(1<<6)
 #define   ECOCHK_PPGTT_CACHE64B		(0x3<<3)
 #define   ECOCHK_PPGTT_CACHE4B		(0x0<<3)
+#define   ECOCHK_PPGTT_GFDT_IVB		(0x1<<4)
+#define   ECOCHK_PPGTT_LLC_IVB		(0x1<<3)
+#define   ECOCHK_PPGTT_UC_HSW		(0x1<<3)
+#define   ECOCHK_PPGTT_WT_HSW		(0x2<<3)
+#define   ECOCHK_PPGTT_WB_HSW		(0x3<<3)
 
 #define GAC_ECO_BITS			0x14090
 #define   ECOBITS_SNB_BIT		(1<<13)
Signature · 6 lines
1.8.1.5

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on v1 1/3
#3 lore raw
In reply to [email protected]
Quoted 6 lines · On Thu, 2013-04-04 at 15:13 +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

GAC_ECO_BITS has a bit similar to GAM_ECOCHK's ECOCHK_SNB_BIT. Add the define, and enable it on SNB.

On the series:

Quoted 24 lines
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 3 ++-
 drivers/gpu/drm/i915/i915_reg.h     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -1
index 24a23b3..593137b 100644
@@ -312,7 +312,8 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
 		uint32_t ecochk, gab_ctl, ecobits;
 
 		ecobits = I915_READ(GAC_ECO_BITS);
-		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_PPGTT_CACHE64B);
+		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_SNB_BIT |
+					 ECOBITS_PPGTT_CACHE64B);
 
 		gab_ctl = I915_READ(GAB_CTL);
 		I915_WRITE(GAB_CTL, gab_ctl | GAB_CTL_CONT_AFTER_PAGEFAULT);
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 058686c..4b8fd4d 100644

drivers/gpu/drm/i915/i915_reg.h line 133

Quoted 7 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -127,6 +127,7 @@
 #define   ECOCHK_PPGTT_CACHE4B		(0x0<<3)
 
 #define GAC_ECO_BITS			0x14090
+#define   ECOBITS_SNB_BIT		(1<<13)
 #define   ECOBITS_PPGTT_CACHE64B	(3<<8)
 #define   ECOBITS_PPGTT_CACHE4B		(0<<8)
 

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#4 lore raw
Quoted 10 lines · Imre Deak
Quoted 6 lines · On Thu, 2013-04-04 at 15:13 +0300, [email protected] wrote:

From: Ville Syrjälä <[email protected]>

GAC_ECO_BITS has a bit similar to GAM_ECOCHK's ECOCHK_SNB_BIT. Add the define, and enable it on SNB.

On the series:

Queued for -next, thanks for the patches.
-Daniel

Quoted 38 lines
Quoted 25 lines
---
 drivers/gpu/drm/i915/i915_gem_gtt.c | 3 ++-
 drivers/gpu/drm/i915/i915_reg.h     | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_gem_gtt.c +2 -1
index 24a23b3..593137b 100644
@@ -312,7 +312,8 @@ void i915_gem_init_ppgtt(struct drm_device *dev)
 		uint32_t ecochk, gab_ctl, ecobits;
 
 		ecobits = I915_READ(GAC_ECO_BITS);
-		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_PPGTT_CACHE64B);
+		I915_WRITE(GAC_ECO_BITS, ecobits | ECOBITS_SNB_BIT |
+					 ECOBITS_PPGTT_CACHE64B);
 
 		gab_ctl = I915_READ(GAB_CTL);
 		I915_WRITE(GAB_CTL, gab_ctl | GAB_CTL_CONT_AFTER_PAGEFAULT);
drivers/gpu/drm/i915/i915_reg.h +0 -0
index 058686c..4b8fd4d 100644

drivers/gpu/drm/i915/i915_reg.h line 133

Quoted 7 lines
drivers/gpu/drm/i915/i915_reg.h +1 -0
@@ -127,6 +127,7 @@
 #define   ECOCHK_PPGTT_CACHE4B		(0x0<<3)
 
 #define GAC_ECO_BITS			0x14090
+#define   ECOBITS_SNB_BIT		(1<<13)
 #define   ECOBITS_PPGTT_CACHE64B	(3<<8)
 #define   ECOBITS_PPGTT_CACHE4B		(0<<8)
 

_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 3 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch