aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/hw/debug_hw.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/host1x/hw/debug_hw.c')
-rw-r--r--drivers/gpu/host1x/hw/debug_hw.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/drivers/gpu/host1x/hw/debug_hw.c b/drivers/gpu/host1x/hw/debug_hw.c
index 770d92e62d69..1e67667e308c 100644
--- a/drivers/gpu/host1x/hw/debug_hw.c
+++ b/drivers/gpu/host1x/hw/debug_hw.c
@@ -40,48 +40,59 @@ enum {
40 40
41static unsigned int show_channel_command(struct output *o, u32 val) 41static unsigned int show_channel_command(struct output *o, u32 val)
42{ 42{
43 unsigned int mask, subop; 43 unsigned int mask, subop, num;
44 44
45 switch (val >> 28) { 45 switch (val >> 28) {
46 case HOST1X_OPCODE_SETCLASS: 46 case HOST1X_OPCODE_SETCLASS:
47 mask = val & 0x3f; 47 mask = val & 0x3f;
48 if (mask) { 48 if (mask) {
49 host1x_debug_output(o, "SETCL(class=%03x, offset=%03x, mask=%02x, [", 49 host1x_debug_cont(o, "SETCL(class=%03x, offset=%03x, mask=%02x, [",
50 val >> 6 & 0x3ff, 50 val >> 6 & 0x3ff,
51 val >> 16 & 0xfff, mask); 51 val >> 16 & 0xfff, mask);
52 return hweight8(mask); 52 return hweight8(mask);
53 } 53 }
54 54
55 host1x_debug_output(o, "SETCL(class=%03x)\n", val >> 6 & 0x3ff); 55 host1x_debug_cont(o, "SETCL(class=%03x)\n", val >> 6 & 0x3ff);
56 return 0; 56 return 0;
57 57
58 case HOST1X_OPCODE_INCR: 58 case HOST1X_OPCODE_INCR:
59 host1x_debug_output(o, "INCR(offset=%03x, [", 59 num = val & 0xffff;
60 host1x_debug_cont(o, "INCR(offset=%03x, [",
60 val >> 16 & 0xfff); 61 val >> 16 & 0xfff);
61 return val & 0xffff; 62 if (!num)
63 host1x_debug_cont(o, "])\n");
64
65 return num;
62 66
63 case HOST1X_OPCODE_NONINCR: 67 case HOST1X_OPCODE_NONINCR:
64 host1x_debug_output(o, "NONINCR(offset=%03x, [", 68 num = val & 0xffff;
69 host1x_debug_cont(o, "NONINCR(offset=%03x, [",
65 val >> 16 & 0xfff); 70 val >> 16 & 0xfff);
66 return val & 0xffff; 71 if (!num)
72 host1x_debug_cont(o, "])\n");
73
74 return num;
67 75
68 case HOST1X_OPCODE_MASK: 76 case HOST1X_OPCODE_MASK:
69 mask = val & 0xffff; 77 mask = val & 0xffff;
70 host1x_debug_output(o, "MASK(offset=%03x, mask=%03x, [", 78 host1x_debug_cont(o, "MASK(offset=%03x, mask=%03x, [",
71 val >> 16 & 0xfff, mask); 79 val >> 16 & 0xfff, mask);
80 if (!mask)
81 host1x_debug_cont(o, "])\n");
82
72 return hweight16(mask); 83 return hweight16(mask);
73 84
74 case HOST1X_OPCODE_IMM: 85 case HOST1X_OPCODE_IMM:
75 host1x_debug_output(o, "IMM(offset=%03x, data=%03x)\n", 86 host1x_debug_cont(o, "IMM(offset=%03x, data=%03x)\n",
76 val >> 16 & 0xfff, val & 0xffff); 87 val >> 16 & 0xfff, val & 0xffff);
77 return 0; 88 return 0;
78 89
79 case HOST1X_OPCODE_RESTART: 90 case HOST1X_OPCODE_RESTART:
80 host1x_debug_output(o, "RESTART(offset=%08x)\n", val << 4); 91 host1x_debug_cont(o, "RESTART(offset=%08x)\n", val << 4);
81 return 0; 92 return 0;
82 93
83 case HOST1X_OPCODE_GATHER: 94 case HOST1X_OPCODE_GATHER:
84 host1x_debug_output(o, "GATHER(offset=%03x, insert=%d, type=%d, count=%04x, addr=[", 95 host1x_debug_cont(o, "GATHER(offset=%03x, insert=%d, type=%d, count=%04x, addr=[",
85 val >> 16 & 0xfff, val >> 15 & 0x1, 96 val >> 16 & 0xfff, val >> 15 & 0x1,
86 val >> 14 & 0x1, val & 0x3fff); 97 val >> 14 & 0x1, val & 0x3fff);
87 return 1; 98 return 1;
@@ -89,16 +100,17 @@ static unsigned int show_channel_command(struct output *o, u32 val)
89 case HOST1X_OPCODE_EXTEND: 100 case HOST1X_OPCODE_EXTEND:
90 subop = val >> 24 & 0xf; 101 subop = val >> 24 & 0xf;
91 if (subop == HOST1X_OPCODE_EXTEND_ACQUIRE_MLOCK) 102 if (subop == HOST1X_OPCODE_EXTEND_ACQUIRE_MLOCK)
92 host1x_debug_output(o, "ACQUIRE_MLOCK(index=%d)\n", 103 host1x_debug_cont(o, "ACQUIRE_MLOCK(index=%d)\n",
93 val & 0xff); 104 val & 0xff);
94 else if (subop == HOST1X_OPCODE_EXTEND_RELEASE_MLOCK) 105 else if (subop == HOST1X_OPCODE_EXTEND_RELEASE_MLOCK)
95 host1x_debug_output(o, "RELEASE_MLOCK(index=%d)\n", 106 host1x_debug_cont(o, "RELEASE_MLOCK(index=%d)\n",
96 val & 0xff); 107 val & 0xff);
97 else 108 else
98 host1x_debug_output(o, "EXTEND_UNKNOWN(%08x)\n", val); 109 host1x_debug_cont(o, "EXTEND_UNKNOWN(%08x)\n", val);
99 return 0; 110 return 0;
100 111
101 default: 112 default:
113 host1x_debug_cont(o, "UNKNOWN\n");
102 return 0; 114 return 0;
103 } 115 }
104} 116}
@@ -126,11 +138,11 @@ static void show_gather(struct output *o, phys_addr_t phys_addr,
126 u32 val = *(map_addr + offset / 4 + i); 138 u32 val = *(map_addr + offset / 4 + i);
127 139
128 if (!data_count) { 140 if (!data_count) {
129 host1x_debug_output(o, "%08x: %08x:", addr, val); 141 host1x_debug_output(o, "%08x: %08x: ", addr, val);
130 data_count = show_channel_command(o, val); 142 data_count = show_channel_command(o, val);
131 } else { 143 } else {
132 host1x_debug_output(o, "%08x%s", val, 144 host1x_debug_cont(o, "%08x%s", val,
133 data_count > 0 ? ", " : "])\n"); 145 data_count > 1 ? ", " : "])\n");
134 data_count--; 146 data_count--;
135 } 147 }
136 } 148 }