Skip to contentSkip to conversation

Fix VMID of chained IBs

PATCH In review Tom St Denis 2 participants 2 messages Apr 10, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix VMID of chained IBs

We were using the VMID field literally when inside an IB it's inherited instead

---
 src/lib/dump_ib.c     | 8 ++++----
 src/lib/ring_decode.c | 2 +-
 2 files changed, 5 insertions(+), 5 deletions(-)
src/lib/dump_ib.c +4 -4
index 74a3241c309e..cbf859e3633b 100644
@@ -39,10 +39,10 @@ void umr_dump_ib(struct umr_asic *asic, struct umr_ring_decoder *decoder)
 	if (decoder->src.ib_addr == 0)
 		printf("ring[%s%u%s]", BLUE, (unsigned)decoder->src.addr, RST);
 	else
-		printf("IB[%s%u%s] at %s%d%s@%s0x%llx%s",
-			BLUE, (unsigned)decoder->src.addr, RST,
-			YELLOW, (int)decoder->src.vmid, RST,
-			YELLOW, (unsigned long long)decoder->src.ib_addr, RST);
+		printf("IB[%s%u%s@%s0x%llx%s + %s0x%x%s]",
+			BLUE, (int)decoder->src.vmid, RST,
+			YELLOW, (unsigned long long)decoder->src.ib_addr, RST,
+			YELLOW, (unsigned)decoder->src.addr * 4, RST);
 
 	printf("\n");
 
src/lib/ring_decode.c +1 -1
index c1d6bcb98bae..42265e0a74c9 100644
@@ -540,7 +540,7 @@ static void print_decode_pm4_pkt3(struct umr_asic *asic, struct umr_ring_decoder
 					break;
 				case 2: printf("IB_SIZE:%s%lu%s, VMID: %s%lu%s", BLUE, BITS(ib, 0, 20), RST, BLUE, BITS(ib, 24, 32), RST);
 					decoder->pm4.next_ib_state.ib_size = BITS(ib, 0, 20) * 4;
-					decoder->pm4.next_ib_state.ib_vmid = BITS(ib, 24, 32);
+					decoder->pm4.next_ib_state.ib_vmid = decoder->next_ib_info.vmid ? decoder->next_ib_info.vmid : BITS(ib, 24, 32);
 					add_ib_pm4(decoder);
 					break;
 				default: printf("Invalid word for opcode 0x%02lx", (unsigned long)decoder->pm4.cur_opcode);
Signature · 6 lines
2.14.3

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
#2 lore raw
In reply to a message not in the archive

Am 10.04.2018 um 17:23 schrieb Tom St Denis:

Quoted 3 lines

We were using the VMID field literally when inside an IB it's inherited instead

Quoted 29 lines
---
  src/lib/dump_ib.c     | 8 ++++----
  src/lib/ring_decode.c | 2 +-
  2 files changed, 5 insertions(+), 5 deletions(-)
src/lib/dump_ib.c +4 -4
index 74a3241c309e..cbf859e3633b 100644
@@ -39,10 +39,10 @@ void umr_dump_ib(struct umr_asic *asic, struct umr_ring_decoder *decoder)
  	if (decoder->src.ib_addr == 0)
  		printf("ring[%s%u%s]", BLUE, (unsigned)decoder->src.addr, RST);
  	else
-		printf("IB[%s%u%s] at %s%d%s@%s0x%llx%s",
-			BLUE, (unsigned)decoder->src.addr, RST,
-			YELLOW, (int)decoder->src.vmid, RST,
-			YELLOW, (unsigned long long)decoder->src.ib_addr, RST);
+		printf("IB[%s%u%s@%s0x%llx%s + %s0x%x%s]",
+			BLUE, (int)decoder->src.vmid, RST,
+			YELLOW, (unsigned long long)decoder->src.ib_addr, RST,
+			YELLOW, (unsigned)decoder->src.addr * 4, RST);
 
  	printf("\n");
 
src/lib/ring_decode.c +0 -0
index c1d6bcb98bae..42265e0a74c9 100644

src/lib/ring_decode.c static void print_decode_pm4_pkt3(struct umr_asic *asic, struct umr_ring_decoder · line 546

Quoted 8 lines
src/lib/ring_decode.c +1 -1
@@ -540,7 +540,7 @@ static void print_decode_pm4_pkt3(struct umr_asic *asic, struct umr_ring_decoder
  					break;
  				case 2: printf("IB_SIZE:%s%lu%s, VMID: %s%lu%s", BLUE, BITS(ib, 0, 20), RST, BLUE, BITS(ib, 24, 32), RST);
  					decoder->pm4.next_ib_state.ib_size = BITS(ib, 0, 20) * 4;
-					decoder->pm4.next_ib_state.ib_vmid = BITS(ib, 24, 32);
+					decoder->pm4.next_ib_state.ib_vmid = decoder->next_ib_info.vmid ? decoder->next_ib_info.vmid : BITS(ib, 24, 32);
  					add_ib_pm4(decoder);
  					break;
  				default: printf("Invalid word for opcode 0x%02lx", (unsigned long)decoder->pm4.cur_opcode);

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx