All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] gpu: host1x: Show all allocated syncpts via debugfs
@ 2022-01-14 14:04 ` Jon Hunter
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Hunter @ 2022-01-14 14:04 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen; +Cc: dri-devel, linux-tegra, Jon Hunter

When the host1x syncpts status is dumped via the debugfs, syncpts that
have been allocated but not yet used are not shown and so currently it
is not possible to see all the allocated syncpts. Update the path for
dumping the syncpt status via the debugfs to show all allocated syncpts
even if they have not been used yet. Note that when the syncpt status
is dumped by the kernel itself for debugging only the active syncpt are
shown.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/gpu/host1x/debug.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/host1x/debug.c b/drivers/gpu/host1x/debug.c
index 18d9c8d206e3..34c2e36d09e9 100644
--- a/drivers/gpu/host1x/debug.c
+++ b/drivers/gpu/host1x/debug.c
@@ -75,7 +75,7 @@ static int show_channel(struct host1x_channel *ch, void *data, bool show_fifo)
 	return 0;
 }
 
-static void show_syncpts(struct host1x *m, struct output *o)
+static void show_syncpts(struct host1x *m, struct output *o, bool show_all)
 {
 	struct list_head *pos;
 	unsigned int i;
@@ -97,7 +97,10 @@ static void show_syncpts(struct host1x *m, struct output *o)
 			waiters++;
 		spin_unlock(&m->syncpt[i].intr.lock);
 
-		if (!min && !max && !waiters)
+		if (!kref_read(&m->syncpt[i].ref))
+			continue;
+
+		if (!show_all && !min && !max && !waiters)
 			continue;
 
 		host1x_debug_output(o,
@@ -124,7 +127,7 @@ static void show_all(struct host1x *m, struct output *o, bool show_fifo)
 	unsigned int i;
 
 	host1x_hw_show_mlocks(m, o);
-	show_syncpts(m, o);
+	show_syncpts(m, o, true);
 	host1x_debug_output(o, "---- channels ----\n");
 
 	for (i = 0; i < m->info->nb_channels; ++i) {
@@ -241,5 +244,5 @@ void host1x_debug_dump_syncpts(struct host1x *host1x)
 		.fn = write_to_printk
 	};
 
-	show_syncpts(host1x, &o);
+	show_syncpts(host1x, &o, false);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH] gpu: host1x: Show all allocated syncpts via debugfs
@ 2022-01-14 14:04 ` Jon Hunter
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Hunter @ 2022-01-14 14:04 UTC (permalink / raw)
  To: Thierry Reding, Mikko Perttunen; +Cc: linux-tegra, dri-devel, Jon Hunter

When the host1x syncpts status is dumped via the debugfs, syncpts that
have been allocated but not yet used are not shown and so currently it
is not possible to see all the allocated syncpts. Update the path for
dumping the syncpt status via the debugfs to show all allocated syncpts
even if they have not been used yet. Note that when the syncpt status
is dumped by the kernel itself for debugging only the active syncpt are
shown.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/gpu/host1x/debug.c | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/host1x/debug.c b/drivers/gpu/host1x/debug.c
index 18d9c8d206e3..34c2e36d09e9 100644
--- a/drivers/gpu/host1x/debug.c
+++ b/drivers/gpu/host1x/debug.c
@@ -75,7 +75,7 @@ static int show_channel(struct host1x_channel *ch, void *data, bool show_fifo)
 	return 0;
 }
 
-static void show_syncpts(struct host1x *m, struct output *o)
+static void show_syncpts(struct host1x *m, struct output *o, bool show_all)
 {
 	struct list_head *pos;
 	unsigned int i;
@@ -97,7 +97,10 @@ static void show_syncpts(struct host1x *m, struct output *o)
 			waiters++;
 		spin_unlock(&m->syncpt[i].intr.lock);
 
-		if (!min && !max && !waiters)
+		if (!kref_read(&m->syncpt[i].ref))
+			continue;
+
+		if (!show_all && !min && !max && !waiters)
 			continue;
 
 		host1x_debug_output(o,
@@ -124,7 +127,7 @@ static void show_all(struct host1x *m, struct output *o, bool show_fifo)
 	unsigned int i;
 
 	host1x_hw_show_mlocks(m, o);
-	show_syncpts(m, o);
+	show_syncpts(m, o, true);
 	host1x_debug_output(o, "---- channels ----\n");
 
 	for (i = 0; i < m->info->nb_channels; ++i) {
@@ -241,5 +244,5 @@ void host1x_debug_dump_syncpts(struct host1x *host1x)
 		.fn = write_to_printk
 	};
 
-	show_syncpts(host1x, &o);
+	show_syncpts(host1x, &o, false);
 }
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu: host1x: Show all allocated syncpts via debugfs
  2022-01-14 14:04 ` Jon Hunter
@ 2022-04-06 13:34   ` Thierry Reding
  -1 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2022-04-06 13:34 UTC (permalink / raw)
  To: Jon Hunter; +Cc: linux-tegra, dri-devel, Mikko Perttunen

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

On Fri, Jan 14, 2022 at 02:04:53PM +0000, Jon Hunter wrote:
> When the host1x syncpts status is dumped via the debugfs, syncpts that
> have been allocated but not yet used are not shown and so currently it
> is not possible to see all the allocated syncpts. Update the path for
> dumping the syncpt status via the debugfs to show all allocated syncpts
> even if they have not been used yet. Note that when the syncpt status
> is dumped by the kernel itself for debugging only the active syncpt are
> shown.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/gpu/host1x/debug.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] gpu: host1x: Show all allocated syncpts via debugfs
@ 2022-04-06 13:34   ` Thierry Reding
  0 siblings, 0 replies; 4+ messages in thread
From: Thierry Reding @ 2022-04-06 13:34 UTC (permalink / raw)
  To: Jon Hunter; +Cc: Mikko Perttunen, dri-devel, linux-tegra

[-- Attachment #1: Type: text/plain, Size: 709 bytes --]

On Fri, Jan 14, 2022 at 02:04:53PM +0000, Jon Hunter wrote:
> When the host1x syncpts status is dumped via the debugfs, syncpts that
> have been allocated but not yet used are not shown and so currently it
> is not possible to see all the allocated syncpts. Update the path for
> dumping the syncpt status via the debugfs to show all allocated syncpts
> even if they have not been used yet. Note that when the syncpt status
> is dumped by the kernel itself for debugging only the active syncpt are
> shown.
> 
> Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
> ---
>  drivers/gpu/host1x/debug.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)

Applied, thanks.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-06 16:02 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-14 14:04 [PATCH] gpu: host1x: Show all allocated syncpts via debugfs Jon Hunter
2022-01-14 14:04 ` Jon Hunter
2022-04-06 13:34 ` Thierry Reding
2022-04-06 13:34   ` Thierry Reding

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.