Skip to contentSkip to conversation

drm/i915: fix swizzling on gen6+

PATCH In review Daniel Vetter 4 participants 6 messages Sep 12, 2011 – Sep 23, 2011

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/i915: fix swizzling on gen6+

Fixes tests/gem_tiled_pread on my snb. I know, mesa doesn't use this on gen6+, but I also hate failing testcases.

---
 drivers/gpu/drm/i915/i915_gem_tiling.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/gpu/drm/i915/i915_gem_tiling.c +4 -1
index 99c4faa..103da6f 100644
@@ -92,7 +92,10 @@ i915_gem_detect_bit_6_swizzle(struct drm_device *dev)
 	uint32_t swizzle_x = I915_BIT_6_SWIZZLE_UNKNOWN;
 	uint32_t swizzle_y = I915_BIT_6_SWIZZLE_UNKNOWN;
 
-	if (INTEL_INFO(dev)->gen >= 5) {
+	if (INTEL_INFO(dev)->gen >= 6) {
+		swizzle_x = I915_BIT_6_SWIZZLE_NONE;
+		swizzle_y = I915_BIT_6_SWIZZLE_NONE;
+	} else if (IS_GEN5(dev)) {
 		/* On Ironlake whatever DRAM config, GPU always do
 		 * same swizzling setup.
 		 */
Signature · 1 line
1.7.6
#2 lore raw
In reply to Daniel Vetter
Quoted 2 lines · Daniel Vetter

Fixes tests/gem_tiled_pread on my snb. I know, mesa doesn't use this on gen6+, but I also hate failing testcases.

Hmm, I thought gen6 also has DRAM configuration registers that we were meant to set and to follow. Not that I could actually find the cross-references! I've been surprised that it works and scared to poke too hard just in case it was broken underneath. ;-) -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#3 lore raw
Quoted 8 lines · Chris Wilson
Quoted 2 lines · Daniel Vetter

Fixes tests/gem_tiled_pread on my snb. I know, mesa doesn't use this on gen6+, but I also hate failing testcases.

Hmm, I thought gen6 also has DRAM configuration registers that we were meant to set and to follow. Not that I could actually find the cross-references! I've been surprised that it works and scared to poke too hard just in case it was broken underneath. ;-)

Well, I've checked with my ilk and snb, and now it works for both. ymmv. The other options is to return SWIZZLE_UNKOWN back to userspace and disable the tests on gen5+. I don't care too much either way, but I think making it work is less risky. And now that qa actually runs our tests, we might even catch this earlier.
-Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48
#4 lore raw
Quoted 10 lines · Daniel Vetter
Quoted 8 lines · Chris Wilson
Quoted 2 lines · Daniel Vetter

Fixes tests/gem_tiled_pread on my snb. I know, mesa doesn't use this on gen6+, but I also hate failing testcases.

Hmm, I thought gen6 also has DRAM configuration registers that we were meant to set and to follow. Not that I could actually find the cross-references! I've been surprised that it works and scared to poke too hard just in case it was broken underneath. ;-)

Quoted 5 lines

Well, I've checked with my ilk and snb, and now it works for both. ymmv. The other options is to return SWIZZLE_UNKOWN back to userspace and disable the tests on gen5+. I don't care too much either way, but I think making it work is less risky. And now that qa actually runs our tests, we might even catch this earlier.

I suspect we are missing some code to handle atypical configurations. -Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre
#5 lore raw
In reply to Daniel Vetter

Hi Keith,

This one fixes a testcase from intel-gpu-tools. No actual userspace depends upon it, afaics. The other option is to stop supporting this on gen6+ and return SWIZZLE_UNKOWN. I don't mind either way, I just don't like broken interfaces ;-)

Yours, Daniel

Signature · 3 lines
Daniel Vetter
Mail: [email protected]
Mobile: +41 (0)79 365 57 48