Skip to contentSkip to conversation

drm/i915: Shift driver's HWSP usage out of reserved range

PATCH In review Thomas Daniel 4 participants 6 messages Feb 18, 2015 – Feb 24, 2015

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

PATCH 1/1 drm/i915: Shift driver's HWSP usage out of reserved range

As of Gen6, the general purpose area of the hardware status page has shrunk and now begins at dword 0x30. i915 driver uses dword 0x20 to store the seqno which is now reserved. So shift our HWSP dwords up into the general purpose range before this bites us.

---
 drivers/gpu/drm/i915/intel_ringbuffer.h |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.h +4 -3
index b6c484f..39183fc 100644
@@ -373,11 +373,12 @@ intel_write_status_page(struct intel_engine_cs *ring,
  * 0x06: ring 2 head pointer (915-class)
  * 0x10-0x1b: Context status DWords (GM45)
  * 0x1f: Last written status offset. (GM45)
+ * 0x20-0x2f: Reserved (Gen6+)
  *
- * The area from dword 0x20 to 0x3ff is available for driver usage.
+ * The area from dword 0x30 to 0x3ff is available for driver usage.
  */
-#define I915_GEM_HWS_INDEX		0x20
-#define I915_GEM_HWS_SCRATCH_INDEX	0x30
+#define I915_GEM_HWS_INDEX		0x30
+#define I915_GEM_HWS_SCRATCH_INDEX	0x40
 #define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
 
 void intel_unpin_ringbuffer_obj(struct intel_ringbuffer *ringbuf);
Signature · 6 lines
1.7.9.5

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

Task id: 5787 -------------------------------------Summary-------------------------------------
Platform Delta drm-intel-nightly Series Applied
PNV -1 277/277 276/277

ILK                                  313/313              313/313
SNB                                  309/309              309/309
IVB                                  382/382              382/382
BYT                                  296/296              296/296
HSW                                  425/425              425/425

BDW -1 318/318 317/318
-------------------------------------Detailed-------------------------------------
Platform Test drm-intel-nightly Series Applied
PNV igt_gem_userptr_blits_coherency-unsync CRASH(2)PASS(2) CRASH(1)PASS(1)
*BDW igt_gem_gtt_hog PASS(6) DMESG_WARN(1)PASS(1)
Note: You need to pay more attention to line start with '*'
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Daniel
Quoted 20 lines · Thomas Daniel

As of Gen6, the general purpose area of the hardware status page has shrunk and now begins at dword 0x30. i915 driver uses dword 0x20 to store the seqno which is now reserved. So shift our HWSP dwords up into the general purpose range before this bites us.

---
 drivers/gpu/drm/i915/intel_ringbuffer.h |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.h +1 -0
index b6c484f..39183fc 100644
@@ -373,11 +373,12 @@ intel_write_status_page(struct intel_engine_cs *ring,
  * 0x06: ring 2 head pointer (915-class)
  * 0x10-0x1b: Context status DWords (GM45)
  * 0x1f: Last written status offset. (GM45)
+ * 0x20-0x2f: Reserved (Gen6+)
  *

drivers/gpu/drm/i915/intel_ringbuffer.h intel_write_status_page(struct intel_engine_cs *ring, · line 384

Quoted 10 lines
drivers/gpu/drm/i915/intel_ringbuffer.h +3 -3
- * The area from dword 0x20 to 0x3ff is available for driver usage.
+ * The area from dword 0x30 to 0x3ff is available for driver usage.
  */
-#define I915_GEM_HWS_INDEX		0x20
-#define I915_GEM_HWS_SCRATCH_INDEX	0x30
+#define I915_GEM_HWS_INDEX		0x30
+#define I915_GEM_HWS_SCRATCH_INDEX	0x40
 #define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
 
 void intel_unpin_ringbuffer_obj(struct intel_ringbuffer *ringbuf);

Well, nothing much can go wnorg here!

But just FYI, these will all get changed again when we add support for preemption (: because then we'll need more than one place to store 'sequence numbers' :)

.Dave.

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

#3 lore raw
Quoted 5 lines · Dave Gordon
Quoted 4 lines · Thomas Daniel

As of Gen6, the general purpose area of the hardware status page has shrunk and now begins at dword 0x30. i915 driver uses dword 0x20 to store the seqno which is now reserved. So shift our HWSP dwords up into the general purpose range before this bites us.

It would be really interesting to know what exactly the hw does with offsets below 0x30 ... it might explain some of the bugs we've seen. Can you please digg that out so that I can amend the commit message?

Quoted 24 lines
Quoted 24 lines
---
 drivers/gpu/drm/i915/intel_ringbuffer.h |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/intel_ringbuffer.h +4 -3
index b6c484f..39183fc 100644
@@ -373,11 +373,12 @@ intel_write_status_page(struct intel_engine_cs *ring,
  * 0x06: ring 2 head pointer (915-class)
  * 0x10-0x1b: Context status DWords (GM45)
  * 0x1f: Last written status offset. (GM45)
+ * 0x20-0x2f: Reserved (Gen6+)
  *
- * The area from dword 0x20 to 0x3ff is available for driver usage.
+ * The area from dword 0x30 to 0x3ff is available for driver usage.
  */
-#define I915_GEM_HWS_INDEX		0x20
-#define I915_GEM_HWS_SCRATCH_INDEX	0x30
+#define I915_GEM_HWS_INDEX		0x30
+#define I915_GEM_HWS_SCRATCH_INDEX	0x40
 #define I915_GEM_HWS_SCRATCH_ADDR (I915_GEM_HWS_SCRATCH_INDEX << MI_STORE_DWORD_INDEX_SHIFT)
 
Quoted 5 lines

drivers/gpu/drm/i915/intel_ringbuffer.h intel_write_status_page(struct intel_engine_cs *ring, · line 384

Quoted 1 line
drivers/gpu/drm/i915/intel_ringbuffer.h +0 -0
 void intel_unpin_ringbuffer_obj(struct intel_ringbuffer *ringbuf);

Well, nothing much can go wnorg here!

Anyway for now queued for -next, thanks for the patch. -Daniel

Quoted 11 lines

But just FYI, these will all get changed again when we add support for preemption (: because then we'll need more than one place to store 'sequence numbers' :)

.Dave.

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

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw
Quoted 13 lines

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, February 23, 2015 11:28 PM
To: Gordon, David S
Cc: Daniel, Thomas; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Shift driver's HWSP usage out of reserved range

Quoted 2 lines · Dave Gordon
Quoted 1 line · Thomas Daniel

As of Gen6, the general purpose area of the hardware status page has shrunk

and

Quoted 1 line
Quoted 1 line

now begins at dword 0x30. i915 driver uses dword 0x20 to store the seqno

Quoted 8 lines

which

Quoted 1 line
Quoted 1 line

is now reserved. So shift our HWSP dwords up into the general purpose

range

Quoted 1 line
Quoted 1 line

before this bites us.

It would be really interesting to know what exactly the hw does with offsets below 0x30 ... it might explain some of the bugs we've seen. Can you please digg that out so that I can amend the commit message?

All documentation I've seen just says "Reserved" for current hardware including SKL so we can't rely on any particular usage. That's why I just put "Reserved" for these dwords in the comment.

Thomas.

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

#5 lore raw
Quoted 18 lines · Thomas
Quoted 18 lines

-----Original Message-----
From: Daniel Vetter [mailto:[email protected]] On Behalf Of Daniel Vetter
Sent: Monday, February 23, 2015 11:28 PM
To: Gordon, David S
Cc: Daniel, Thomas; [email protected]
Subject: Re: [Intel-gfx] [PATCH] drm/i915: Shift driver's HWSP usage out of reserved range

Quoted 2 lines · Dave Gordon
Quoted 1 line · Thomas Daniel

As of Gen6, the general purpose area of the hardware status page has shrunk

and

Quoted 1 line
Quoted 1 line

now begins at dword 0x30. i915 driver uses dword 0x20 to store the seqno

which

Quoted 1 line
Quoted 1 line

is now reserved. So shift our HWSP dwords up into the general purpose

range

Quoted 1 line
Quoted 1 line

before this bites us.

Quoted 7 lines
Quoted 3 lines

It would be really interesting to know what exactly the hw does with offsets below 0x30 ... it might explain some of the bugs we've seen. Can you please digg that out so that I can amend the commit message?

All documentation I've seen just says "Reserved" for current hardware including SKL so we can't rely on any particular usage. That's why I just put "Reserved" for these dwords in the comment.

Thanks for the clarification, I've ammended the commit message. -Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx