Skip to contentSkip to conversation

drm/i915: s/MI_STORE_DWORD_IMM_GEN8/MI_STORE_DWORD_IMM_GEN4/

PATCH In review [email protected] 3 participants 5 messages Nov 14, 2014 – Dec 8, 2014

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

PATCH 1/1 drm/i915: s/MI_STORE_DWORD_IMM_GEN8/MI_STORE_DWORD_IMM_GEN4/

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

MI_STORE_DWORD_IMM length has been the same ever since gen4. Rename the define to avoid potential confusion if someone tries to use this on pre-gen8.

Also correct the comment on MI_MEM_VIRTUAL bit. It's present on 945,g33 and 965 only.

---
 drivers/gpu/drm/i915/i915_reg.h  | 4 ++--
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -2
index 3de58ac..5228493 100644
@@ -280,8 +280,8 @@
 #define   MI_SEMAPHORE_POLL		(1<<15)
 #define   MI_SEMAPHORE_SAD_GTE_SDD	(1<<12)
 #define MI_STORE_DWORD_IMM	MI_INSTR(0x20, 1)
-#define MI_STORE_DWORD_IMM_GEN8	MI_INSTR(0x20, 2)
-#define   MI_MEM_VIRTUAL	(1 << 22) /* 965+ only */
+#define MI_STORE_DWORD_IMM_GEN4	MI_INSTR(0x20, 2)
+#define   MI_MEM_VIRTUAL	(1 << 22) /* 945,g33,965 */
 #define MI_STORE_DWORD_INDEX	MI_INSTR(0x21, 1)
 #define   MI_STORE_DWORD_INDEX_SHIFT 2
 /* Official intel docs are somewhat sloppy concerning MI_LOAD_REGISTER_IMM:
drivers/gpu/drm/i915/intel_lrc.c +1 -1
index 6025ac7..649d9ba 100644
@@ -1188,7 +1188,7 @@ static int gen8_emit_request(struct intel_ringbuffer *ringbuf)
 	if (ret)
 		return ret;
 
-	cmd = MI_STORE_DWORD_IMM_GEN8;
+	cmd = MI_STORE_DWORD_IMM_GEN4;
 	cmd |= MI_GLOBAL_GTT;
 
 	intel_logical_ring_emit(ringbuf, cmd);
Signature · 6 lines
2.0.4

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

Re: [PATCH] drm/i915:

-------------------------------------Summary-------------------------------------
Platform: baseline_drm_intel_nightly_pass_rate->patch_applied_pass_rate
BYT: pass/total=290/291->290/291
PNV: pass/total=352/356->356/356
ILK: pass/total=371/372->371/372
IVB: pass/total=545/546->544/546
SNB: pass/total=424/425->424/425
HSW: pass/total=579/579->579/579
BDW: pass/total=434/435->434/435
-------------------------------------Detailed-------------------------------------
test_platform: test_suite, test_case, result_with_drm_intel_nightly(count, machine_id...)...->result_with_patch_applied(count, machine_id)...
PNV: Intel_gpu_tools, igt_gen3_mixed_blits, DMESG_WARN(1, M23) -> PASS(4, M25)
PNV: Intel_gpu_tools, igt_gen3_render_mixed_blits, CRASH(1, M23) -> PASS(1, M25)
PNV: Intel_gpu_tools, igt_gen3_render_tiledx_blits, CRASH(1, M23) -> PASS(1, M25)
PNV: Intel_gpu_tools, igt_gen3_render_tiledy_blits, CRASH(1, M23) -> PASS(1, M25)
IVB: Intel_gpu_tools, igt_kms_pipe_crc_basic_hang-read-crc-pipe-C, PASS(1, M4) -> TIMEOUT(1, M34)PASS(3, M34)
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

#2 lore raw
In reply to [email protected]
Quoted 11 lines · On Fri, Nov 14, 2014 at 06:16:56PM +0200, [email protected] wrote:

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

MI_STORE_DWORD_IMM length has been the same ever since gen4. Rename the define to avoid potential confusion if someone tries to use this on pre-gen8.

Also correct the comment on MI_MEM_VIRTUAL bit. It's present on 945,g33 and 965 only.

ping

Quoted 35 lines
---
 drivers/gpu/drm/i915/i915_reg.h  | 4 ++--
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -2
index 3de58ac..5228493 100644
@@ -280,8 +280,8 @@
 #define   MI_SEMAPHORE_POLL		(1<<15)
 #define   MI_SEMAPHORE_SAD_GTE_SDD	(1<<12)
 #define MI_STORE_DWORD_IMM	MI_INSTR(0x20, 1)
-#define MI_STORE_DWORD_IMM_GEN8	MI_INSTR(0x20, 2)
-#define   MI_MEM_VIRTUAL	(1 << 22) /* 965+ only */
+#define MI_STORE_DWORD_IMM_GEN4	MI_INSTR(0x20, 2)
+#define   MI_MEM_VIRTUAL	(1 << 22) /* 945,g33,965 */
 #define MI_STORE_DWORD_INDEX	MI_INSTR(0x21, 1)
 #define   MI_STORE_DWORD_INDEX_SHIFT 2
 /* Official intel docs are somewhat sloppy concerning MI_LOAD_REGISTER_IMM:
drivers/gpu/drm/i915/intel_lrc.c +1 -1
index 6025ac7..649d9ba 100644
@@ -1188,7 +1188,7 @@ static int gen8_emit_request(struct intel_ringbuffer *ringbuf)
 	if (ret)
 		return ret;
 
-	cmd = MI_STORE_DWORD_IMM_GEN8;
+	cmd = MI_STORE_DWORD_IMM_GEN4;
 	cmd |= MI_GLOBAL_GTT;
 
 	intel_logical_ring_emit(ringbuf, cmd);
Signature · 1 line
2.0.4
Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by
#3 lore raw
Quoted 43 lines · Ville Syrjälä
Quoted 11 lines · On Fri, Nov 14, 2014 at 06:16:56PM +0200, [email protected] wrote:

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

MI_STORE_DWORD_IMM length has been the same ever since gen4. Rename the define to avoid potential confusion if someone tries to use this on pre-gen8.

Also correct the comment on MI_MEM_VIRTUAL bit. It's present on 945,g33 and 965 only.

ping

Quoted 28 lines
---
 drivers/gpu/drm/i915/i915_reg.h  | 4 ++--
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -2
index 3de58ac..5228493 100644
@@ -280,8 +280,8 @@
 #define   MI_SEMAPHORE_POLL		(1<<15)
 #define   MI_SEMAPHORE_SAD_GTE_SDD	(1<<12)
 #define MI_STORE_DWORD_IMM	MI_INSTR(0x20, 1)
-#define MI_STORE_DWORD_IMM_GEN8	MI_INSTR(0x20, 2)
-#define   MI_MEM_VIRTUAL	(1 << 22) /* 965+ only */
+#define MI_STORE_DWORD_IMM_GEN4	MI_INSTR(0x20, 2)
+#define   MI_MEM_VIRTUAL	(1 << 22) /* 945,g33,965 */
 #define MI_STORE_DWORD_INDEX	MI_INSTR(0x21, 1)
 #define   MI_STORE_DWORD_INDEX_SHIFT 2
 /* Official intel docs are somewhat sloppy concerning MI_LOAD_REGISTER_IMM:
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index 6025ac7..649d9ba 100644
@@ -1188,7 +1188,7 @@ static int gen8_emit_request(struct intel_ringbuffer *ringbuf)
 	if (ret)
 		return ret;
 
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_lrc.c +1 -1
-	cmd = MI_STORE_DWORD_IMM_GEN8;
+	cmd = MI_STORE_DWORD_IMM_GEN4;
 	cmd |= MI_GLOBAL_GTT;
 
 	intel_logical_ring_emit(ringbuf, cmd);
Signature · 1 line
2.0.4

The GEN8->GEN4 change looks sensible to me. But I was puzzled over the definition of MI_STORE_DWORD_IMM -- presumably this apparently more generic definition is actually a pre-GEN4 legacy from the days when the instruction had only 3 words? Perhaps a comment here from somebody who knows -- or even something like

#define MI_STORE_DWORD_IMM_LEGACY MI_INSTR(0x20, 1) /* pre-GEN4 */
#define MI_STORE_DWORD_IMM_GEN4 MI_INSTR(0x20, 2) /* GEN4+ */
#define MI_STORE_DWORD_IMM MI_STORE_DWORD_IMM_LEGACY /* for source
backward compatibility */

so it's clearer that (for now) the generic definition is actually the legacy one.

The above bikeshedding notwithstanding, it gets my R-b anyway:

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

#4 lore raw
Quoted 58 lines · Dave Gordon
Quoted 43 lines · Ville Syrjälä
Quoted 11 lines · On Fri, Nov 14, 2014 at 06:16:56PM +0200, [email protected] wrote:

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

MI_STORE_DWORD_IMM length has been the same ever since gen4. Rename the define to avoid potential confusion if someone tries to use this on pre-gen8.

Also correct the comment on MI_MEM_VIRTUAL bit. It's present on 945,g33 and 965 only.

ping

Quoted 28 lines
---
 drivers/gpu/drm/i915/i915_reg.h  | 4 ++--
 drivers/gpu/drm/i915/intel_lrc.c | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/i915_reg.h +2 -2
index 3de58ac..5228493 100644
@@ -280,8 +280,8 @@
 #define   MI_SEMAPHORE_POLL		(1<<15)
 #define   MI_SEMAPHORE_SAD_GTE_SDD	(1<<12)
 #define MI_STORE_DWORD_IMM	MI_INSTR(0x20, 1)
-#define MI_STORE_DWORD_IMM_GEN8	MI_INSTR(0x20, 2)
-#define   MI_MEM_VIRTUAL	(1 << 22) /* 965+ only */
+#define MI_STORE_DWORD_IMM_GEN4	MI_INSTR(0x20, 2)
+#define   MI_MEM_VIRTUAL	(1 << 22) /* 945,g33,965 */
 #define MI_STORE_DWORD_INDEX	MI_INSTR(0x21, 1)
 #define   MI_STORE_DWORD_INDEX_SHIFT 2
 /* Official intel docs are somewhat sloppy concerning MI_LOAD_REGISTER_IMM:
drivers/gpu/drm/i915/intel_lrc.c +0 -0
index 6025ac7..649d9ba 100644
@@ -1188,7 +1188,7 @@ static int gen8_emit_request(struct intel_ringbuffer *ringbuf)
 	if (ret)
 		return ret;
 
Quoted 7 lines
Quoted 7 lines
drivers/gpu/drm/i915/intel_lrc.c +1 -1
-	cmd = MI_STORE_DWORD_IMM_GEN8;
+	cmd = MI_STORE_DWORD_IMM_GEN4;
 	cmd |= MI_GLOBAL_GTT;
 
 	intel_logical_ring_emit(ringbuf, cmd);
Signature · 1 line
2.0.4

The GEN8->GEN4 change looks sensible to me. But I was puzzled over the definition of MI_STORE_DWORD_IMM -- presumably this apparently more generic definition is actually a pre-GEN4 legacy from the days when the instruction had only 3 words? Perhaps a comment here from somebody who knows -- or even something like

Quoted 7 lines

#define MI_STORE_DWORD_IMM_LEGACY MI_INSTR(0x20, 1) /* pre-GEN4 */
#define MI_STORE_DWORD_IMM_GEN4 MI_INSTR(0x20, 2) /* GEN4+ */
#define MI_STORE_DWORD_IMM MI_STORE_DWORD_IMM_LEGACY /* for source
backward compatibility */

so it's clearer that (for now) the generic definition is actually the legacy one.

We tend to name things based on the oldest platform supporting it, so I think it's fairly clear the _IMM is for old stuff, and _IMM_GEN4 is for gen4+. To make it more clear we could add a _GEN2 suffix for the old platform define, but I don't see much point with that myself.

Oh and source backwards compatibility is something we never really have to worry about. All the code is in the same tree, so we can just change all the users at the same time. Doing otherwise would just lead to a mess.

Quoted 4 lines

The above bikeshedding notwithstanding, it gets my R-b anyway:

Signature · 6 lines
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/intel-gfx