aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/host1x/debug.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-07-15 21:23:50 -0400
committerDave Airlie <airlied@redhat.com>2016-07-15 21:23:50 -0400
commit877fa9a42ddc087dc46a3a3aac18db8adde2bdf1 (patch)
treec5189830c8d3fed08e92deda8681f0676aaea8a5 /drivers/gpu/host1x/debug.c
parente2b80bac213cdfd443df9b6e1c769f98d0553c0c (diff)
parent64ea25c3bc86c05c7da6c683b86663f4c90158d6 (diff)
Merge tag 'drm/tegra/for-4.8-rc1' of git://anongit.freedesktop.org/tegra/linux into drm-next
drm/tegra: Changes for v4.8-rc1 This set of changes contains a bunch of cleanups to the host1x driver as well as the addition of a pin controller for DPAUX, which is required by boards to configure the DPAUX pads in AUX mode (for DisplayPort) or I2C mode (for HDMI and DDC). Included is also a bit of rework of the SOR driver in preparation to add DisplayPort support as well as some refactoring and cleanup. Finally, all output drivers are converted to runtime PM, which greatly simplifies the handling of clocks and resets. * tag 'drm/tegra/for-4.8-rc1' of git://anongit.freedesktop.org/tegra/linux: (35 commits) drm/tegra: sor: Reject HDMI 2.0 modes drm/tegra: sor: Prepare for generic PM domain support drm/tegra: dsi: Prepare for generic PM domain support drm/tegra: sor: Make XBAR configurable per SoC drm/tegra: sor: Use sor1_src clock to set parent for HDMI dt-bindings: display: tegra: Add source clock for SOR drm/tegra: sor: Implement sor1_brick clock drm/tegra: sor: Implement runtime PM drm/tegra: hdmi: Implement runtime PM drm/tegra: dsi: Implement runtime PM drm/tegra: dc: Implement runtime PM drm/tegra: hdmi: Enable audio over HDMI drm/tegra: sor: Do not support deep color modes drm/tegra: sor: Extract tegra_sor_mode_set() drm/tegra: sor: Split out tegra_sor_apply_config() drm/tegra: sor: Rename tegra_sor_calc_config() drm/tegra: sor: Factor out tegra_sor_set_parent_clock() drm/tegra: dpaux: Add pinctrl support dt-bindings: Add bindings for Tegra DPAUX pinctrl driver drm/tegra: Prepare DPAUX for supporting generic PM domains ...
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}