summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/video/tegra/host/chip_support.h2
-rw-r--r--drivers/video/tegra/host/debug.c29
-rw-r--r--drivers/video/tegra/host/host1x/host1x_debug.c8
3 files changed, 24 insertions, 15 deletions
diff --git a/drivers/video/tegra/host/chip_support.h b/drivers/video/tegra/host/chip_support.h
index 17e7f4b165a0..6727e7a69fb4 100644
--- a/drivers/video/tegra/host/chip_support.h
+++ b/drivers/video/tegra/host/chip_support.h
@@ -88,9 +88,11 @@ struct nvhost_chip_support {
struct {
void (*debug_init)(struct dentry *de);
void (*show_channel_cdma)(struct nvhost_master *,
+ struct nvhost_channel *,
struct output *,
int chid);
void (*show_channel_fifo)(struct nvhost_master *,
+ struct nvhost_channel *,
struct output *,
int chid);
void (*show_mlocks)(struct nvhost_master *m,
diff --git a/drivers/video/tegra/host/debug.c b/drivers/video/tegra/host/debug.c
index f3059d599438..91436c903fc6 100644
--- a/drivers/video/tegra/host/debug.c
+++ b/drivers/video/tegra/host/debug.c
@@ -43,24 +43,31 @@ void nvhost_debug_output(struct output *o, const char* fmt, ...)
o->fn(o->ctx, o->buf, len);
}
-
-static void show_channels(struct nvhost_master *m, struct output *o)
+static int show_channels(struct device *dev, void *data)
{
- int i;
- nvhost_debug_output(o, "---- channels ----\n");
- for (i = 0; i < m->nb_channels; i++) {
- struct nvhost_channel *ch = &m->channels[i];
+ struct nvhost_channel *ch;
+ struct nvhost_device *nvdev = to_nvhost_device(dev);
+ struct output *o = data;
+ struct nvhost_master *m;
+
+ if (nvdev == NULL)
+ return 0;
+
+ m = nvhost_get_host(nvdev);
+ ch = nvdev->channel;
+ if (ch) {
mutex_lock(&ch->reflock);
if (ch->refcount) {
mutex_lock(&ch->cdma.lock);
- m->op.debug.show_channel_fifo(m, o, i);
- m->op.debug.show_channel_cdma(m, o, i);
+ m->op.debug.show_channel_fifo(m, ch, o, nvdev->index);
+ m->op.debug.show_channel_cdma(m, ch, o, nvdev->index);
mutex_unlock(&ch->cdma.lock);
}
mutex_unlock(&ch->reflock);
}
-}
+ return 0;
+}
static void show_syncpts(struct nvhost_master *m, struct output *o)
{
@@ -94,12 +101,12 @@ static void show_all(struct nvhost_master *m, struct output *o)
m->op.debug.show_mlocks(m, o);
show_syncpts(m, o);
- show_channels(m, o);
+ nvhost_debug_output(o, "---- channels ----\n");
+ bus_for_each_dev(&nvhost_bus_type, NULL, o, show_channels);
nvhost_module_idle(m->dev);
}
-
#ifdef CONFIG_DEBUG_FS
static int nvhost_debug_show(struct seq_file *s, void *unused)
{
diff --git a/drivers/video/tegra/host/host1x/host1x_debug.c b/drivers/video/tegra/host/host1x/host1x_debug.c
index 06b09d20c55b..1a1d764bbd63 100644
--- a/drivers/video/tegra/host/host1x/host1x_debug.c
+++ b/drivers/video/tegra/host/host1x/host1x_debug.c
@@ -259,9 +259,9 @@ u32 previous_oppair(struct nvhost_cdma *cdma, u32 cur)
}
static void t20_debug_show_channel_cdma(struct nvhost_master *m,
- struct output *o, int chid)
+ struct nvhost_channel *ch, struct output *o, int chid)
{
- struct nvhost_channel *channel = m->channels + chid;
+ struct nvhost_channel *channel = ch;
struct nvhost_cdma *cdma = &channel->cdma;
u32 dmaput, dmaget, dmactrl;
u32 cbstat, cbread;
@@ -322,10 +322,10 @@ static void t20_debug_show_channel_cdma(struct nvhost_master *m,
}
void t20_debug_show_channel_fifo(struct nvhost_master *m,
- struct output *o, int chid)
+ struct nvhost_channel *ch, struct output *o, int chid)
{
u32 val, rd_ptr, wr_ptr, start, end;
- struct nvhost_channel *channel = m->channels + chid;
+ struct nvhost_channel *channel = ch;
int state, count;
nvhost_debug_output(o, "%d: fifo:\n", chid);