aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/debug.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/host1x/debug.c')
-rw-r--r--drivers/gpu/host1x/debug.c38
1 files changed, 27 insertions, 11 deletions
diff --git a/drivers/gpu/host1x/debug.c b/drivers/gpu/host1x/debug.c
index ee3d12b51c50..d9330fcc62ad 100644
--- a/drivers/gpu/host1x/debug.c
+++ b/drivers/gpu/host1x/debug.c
@@ -39,6 +39,7 @@ void host1x_debug_output(struct output *o, const char *fmt, ...)
39 va_start(args, fmt); 39 va_start(args, fmt);
40 len = vsnprintf(o->buf, sizeof(o->buf), fmt, args); 40 len = vsnprintf(o->buf, sizeof(o->buf), fmt, args);
41 va_end(args); 41 va_end(args);
42
42 o->fn(o->ctx, o->buf, len); 43 o->fn(o->ctx, o->buf, len);
43} 44}
44 45
@@ -48,13 +49,17 @@ static int show_channels(struct host1x_channel *ch, void *data, bool show_fifo)
48 struct output *o = data; 49 struct output *o = data;
49 50
50 mutex_lock(&ch->reflock); 51 mutex_lock(&ch->reflock);
52
51 if (ch->refcount) { 53 if (ch->refcount) {
52 mutex_lock(&ch->cdma.lock); 54 mutex_lock(&ch->cdma.lock);
55
53 if (show_fifo) 56 if (show_fifo)
54 host1x_hw_show_channel_fifo(m, ch, o); 57 host1x_hw_show_channel_fifo(m, ch, o);
58
55 host1x_hw_show_channel_cdma(m, ch, o); 59 host1x_hw_show_channel_cdma(m, ch, o);
56 mutex_unlock(&ch->cdma.lock); 60 mutex_unlock(&ch->cdma.lock);
57 } 61 }
62
58 mutex_unlock(&ch->reflock); 63 mutex_unlock(&ch->reflock);
59 64
60 return 0; 65 return 0;
@@ -62,22 +67,27 @@ static int show_channels(struct host1x_channel *ch, void *data, bool show_fifo)
62 67
63static void show_syncpts(struct host1x *m, struct output *o) 68static void show_syncpts(struct host1x *m, struct output *o)
64{ 69{
65 int i; 70 unsigned int i;
71
66 host1x_debug_output(o, "---- syncpts ----\n"); 72 host1x_debug_output(o, "---- syncpts ----\n");
73
67 for (i = 0; i < host1x_syncpt_nb_pts(m); i++) { 74 for (i = 0; i < host1x_syncpt_nb_pts(m); i++) {
68 u32 max = host1x_syncpt_read_max(m->syncpt + i); 75 u32 max = host1x_syncpt_read_max(m->syncpt + i);
69 u32 min = host1x_syncpt_load(m->syncpt + i); 76 u32 min = host1x_syncpt_load(m->syncpt + i);
77
70 if (!min && !max) 78 if (!min && !max)
71 continue; 79 continue;
72 host1x_debug_output(o, "id %d (%s) min %d max %d\n", 80
81 host1x_debug_output(o, "id %u (%s) min %d max %d\n",
73 i, m->syncpt[i].name, min, max); 82 i, m->syncpt[i].name, min, max);
74 } 83 }
75 84
76 for (i = 0; i < host1x_syncpt_nb_bases(m); i++) { 85 for (i = 0; i < host1x_syncpt_nb_bases(m); i++) {
77 u32 base_val; 86 u32 base_val;
87
78 base_val = host1x_syncpt_load_wait_base(m->syncpt + i); 88 base_val = host1x_syncpt_load_wait_base(m->syncpt + i);
79 if (base_val) 89 if (base_val)
80 host1x_debug_output(o, "waitbase id %d val %d\n", i, 90 host1x_debug_output(o, "waitbase id %u val %d\n", i,
81 base_val); 91 base_val);
82 } 92 }
83 93
@@ -114,7 +124,9 @@ static int host1x_debug_show_all(struct seq_file *s, void *unused)
114 .fn = write_to_seqfile, 124 .fn = write_to_seqfile,
115 .ctx = s 125 .ctx = s
116 }; 126 };
127
117 show_all(s->private, &o); 128 show_all(s->private, &o);
129
118 return 0; 130 return 0;
119} 131}
120 132
@@ -124,7 +136,9 @@ static int host1x_debug_show(struct seq_file *s, void *unused)
124 .fn = write_to_seqfile, 136 .fn = write_to_seqfile,
125 .ctx = s 137 .ctx = s
126 }; 138 };
139
127 show_all_no_fifo(s->private, &o); 140 show_all_no_fifo(s->private, &o);
141
128 return 0; 142 return 0;
129} 143}
130 144
@@ -134,10 +148,10 @@ static int host1x_debug_open_all(struct inode *inode, struct file *file)
134} 148}
135 149
136static const struct file_operations host1x_debug_all_fops = { 150static const struct file_operations host1x_debug_all_fops = {
137 .open = host1x_debug_open_all, 151 .open = host1x_debug_open_all,
138 .read = seq_read, 152 .read = seq_read,
139 .llseek = seq_lseek, 153 .llseek = seq_lseek,
140 .release = single_release, 154 .release = single_release,
141}; 155};
142 156
143static int host1x_debug_open(struct inode *inode, struct file *file) 157static int host1x_debug_open(struct inode *inode, struct file *file)
@@ -146,10 +160,10 @@ static int host1x_debug_open(struct inode *inode, struct file *file)
146} 160}
147 161
148static const struct file_operations host1x_debug_fops = { 162static const struct file_operations host1x_debug_fops = {
149 .open = host1x_debug_open, 163 .open = host1x_debug_open,
150 .read = seq_read, 164 .read = seq_read,
151 .llseek = seq_lseek, 165 .llseek = seq_lseek,
152 .release = single_release, 166 .release = single_release,
153}; 167};
154 168
155static void host1x_debugfs_init(struct host1x *host1x) 169static void host1x_debugfs_init(struct host1x *host1x)
@@ -201,6 +215,7 @@ void host1x_debug_dump(struct host1x *host1x)
201 struct output o = { 215 struct output o = {
202 .fn = write_to_printk 216 .fn = write_to_printk
203 }; 217 };
218
204 show_all(host1x, &o); 219 show_all(host1x, &o);
205} 220}
206 221
@@ -209,5 +224,6 @@ void host1x_debug_dump_syncpts(struct host1x *host1x)
209 struct output o = { 224 struct output o = {
210 .fn = write_to_printk 225 .fn = write_to_printk
211 }; 226 };
227
212 show_syncpts(host1x, &o); 228 show_syncpts(host1x, &o);
213} 229}