* [PATCH] drm/i915: Expand ggtt_view paramters for debugfs
@ 2017-01-12 10:35 Chris Wilson
2017-01-12 10:47 ` Tvrtko Ursulin
2017-01-12 11:06 ` [PATCH v2] " Chris Wilson
0 siblings, 2 replies; 5+ messages in thread
From: Chris Wilson @ 2017-01-12 10:35 UTC (permalink / raw)
To: intel-gfx
When dumping the VMA, include the parameters of the different GGTT views
so that we can distinguish them.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 25 +++++++++++++++++++++++--
1 file changed, 23 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 9d7b5a8c8dea..54cdfcb926c7 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -159,8 +159,29 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
seq_printf(m, " (%sgtt offset: %08llx, size: %08llx",
i915_vma_is_ggtt(vma) ? "g" : "pp",
vma->node.start, vma->node.size);
- if (i915_vma_is_ggtt(vma))
- seq_printf(m, ", type: %u", vma->ggtt_view.type);
+ if (i915_vma_is_ggtt(vma)) {
+ switch (vma->ggtt_view.type) {
+ case I915_GGTT_VIEW_NORMAL:
+ seq_puts(m, ", normal");
+ break;
+
+ case I915_GGTT_VIEW_PARTIAL:
+ seq_printf(m, ", partial offset %08llx + %x",
+ vma->ggtt_view.params.partial.offset,
+ vma->ggtt_view.params.partial.size << PAGE_SHIFT);
+ break;
+
+ case I915_GGTT_VIEW_ROTATED:
+ seq_printf(m, ", rotated [0]=(%d, %d, %d) [1]=(%d, %d, %d)",
+ vma->ggtt_view.params.rotated.plane[0].width,
+ vma->ggtt_view.params.rotated.plane[0].height,
+ vma->ggtt_view.params.rotated.plane[0].stride,
+ vma->ggtt_view.params.rotated.plane[1].width,
+ vma->ggtt_view.params.rotated.plane[1].height,
+ vma->ggtt_view.params.rotated.plane[1].stride);
+ break;
+ }
+ }
if (vma->fence)
seq_printf(m, " , fence: %d%s",
vma->fence->id,
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/i915: Expand ggtt_view paramters for debugfs
2017-01-12 10:35 [PATCH] drm/i915: Expand ggtt_view paramters for debugfs Chris Wilson
@ 2017-01-12 10:47 ` Tvrtko Ursulin
2017-01-12 11:06 ` [PATCH v2] " Chris Wilson
1 sibling, 0 replies; 5+ messages in thread
From: Tvrtko Ursulin @ 2017-01-12 10:47 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On 12/01/2017 10:35, Chris Wilson wrote:
> When dumping the VMA, include the parameters of the different GGTT views
> so that we can distinguish them.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 25 +++++++++++++++++++++++--
> 1 file changed, 23 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 9d7b5a8c8dea..54cdfcb926c7 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -159,8 +159,29 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
> seq_printf(m, " (%sgtt offset: %08llx, size: %08llx",
> i915_vma_is_ggtt(vma) ? "g" : "pp",
> vma->node.start, vma->node.size);
> - if (i915_vma_is_ggtt(vma))
> - seq_printf(m, ", type: %u", vma->ggtt_view.type);
> + if (i915_vma_is_ggtt(vma)) {
> + switch (vma->ggtt_view.type) {
> + case I915_GGTT_VIEW_NORMAL:
> + seq_puts(m, ", normal");
> + break;
> +
> + case I915_GGTT_VIEW_PARTIAL:
> + seq_printf(m, ", partial offset %08llx + %x",
Maybe compact a bit, like "partial [%08llx+%x]" ?
> + vma->ggtt_view.params.partial.offset,
> + vma->ggtt_view.params.partial.size << PAGE_SHIFT);
> + break;
> +
> + case I915_GGTT_VIEW_ROTATED:
> + seq_printf(m, ", rotated [0]=(%d, %d, %d) [1]=(%d, %d, %d)",
Type is %u, and maybe again compact like "rotated [[%ux%u, %u], [%ux%u,
%u]]"?
> + vma->ggtt_view.params.rotated.plane[0].width,
> + vma->ggtt_view.params.rotated.plane[0].height,
> + vma->ggtt_view.params.rotated.plane[0].stride,
> + vma->ggtt_view.params.rotated.plane[1].width,
> + vma->ggtt_view.params.rotated.plane[1].height,
> + vma->ggtt_view.params.rotated.plane[1].stride);
> + break;
> + }
Add default with MISSED_CASE and print the numerical representation?
> + }
> if (vma->fence)
> seq_printf(m, " , fence: %d%s",
> vma->fence->id,
>
Overall this approach solves the concerns with the map solution I
proposed nicely. :)
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v2] drm/i915: Expand ggtt_view paramters for debugfs
2017-01-12 10:35 [PATCH] drm/i915: Expand ggtt_view paramters for debugfs Chris Wilson
2017-01-12 10:47 ` Tvrtko Ursulin
@ 2017-01-12 11:06 ` Chris Wilson
2017-01-12 11:14 ` Tvrtko Ursulin
1 sibling, 1 reply; 5+ messages in thread
From: Chris Wilson @ 2017-01-12 11:06 UTC (permalink / raw)
To: intel-gfx
When dumping the VMA, include the parameters of the different GGTT views
so that we can distinguish them.
v2: Contract output and add MISSING_CASE for any unknown types.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
---
drivers/gpu/drm/i915/i915_debugfs.c | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 9d7b5a8c8dea..72bec5eb2f18 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -159,8 +159,32 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
seq_printf(m, " (%sgtt offset: %08llx, size: %08llx",
i915_vma_is_ggtt(vma) ? "g" : "pp",
vma->node.start, vma->node.size);
- if (i915_vma_is_ggtt(vma))
- seq_printf(m, ", type: %u", vma->ggtt_view.type);
+ if (i915_vma_is_ggtt(vma)) {
+ switch (vma->ggtt_view.type) {
+ case I915_GGTT_VIEW_NORMAL:
+ seq_puts(m, ", normal");
+ break;
+
+ case I915_GGTT_VIEW_PARTIAL:
+ seq_printf(m, ", partial [%08llx+%x]",
+ vma->ggtt_view.params.partial.offset,
+ vma->ggtt_view.params.partial.size << PAGE_SHIFT);
+ break;
+
+ case I915_GGTT_VIEW_ROTATED:
+ seq_printf(m, ", rotated [(%ux%u, %d), (%ux%u, %d)]",
+ vma->ggtt_view.params.rotated.plane[0].width,
+ vma->ggtt_view.params.rotated.plane[0].height,
+ vma->ggtt_view.params.rotated.plane[0].stride,
+ vma->ggtt_view.params.rotated.plane[1].width,
+ vma->ggtt_view.params.rotated.plane[1].height,
+ vma->ggtt_view.params.rotated.plane[1].stride);
+ break;
+ default:
+ MISSING_CASE(vma->ggtt_view.type);
+ break;
+ }
+ }
if (vma->fence)
seq_printf(m, " , fence: %d%s",
vma->fence->id,
--
2.11.0
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm/i915: Expand ggtt_view paramters for debugfs
2017-01-12 11:06 ` [PATCH v2] " Chris Wilson
@ 2017-01-12 11:14 ` Tvrtko Ursulin
2017-01-12 11:18 ` Chris Wilson
0 siblings, 1 reply; 5+ messages in thread
From: Tvrtko Ursulin @ 2017-01-12 11:14 UTC (permalink / raw)
To: Chris Wilson, intel-gfx
On 12/01/2017 11:06, Chris Wilson wrote:
> When dumping the VMA, include the parameters of the different GGTT views
> so that we can distinguish them.
>
> v2: Contract output and add MISSING_CASE for any unknown types.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> ---
> drivers/gpu/drm/i915/i915_debugfs.c | 28 ++++++++++++++++++++++++++--
> 1 file changed, 26 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> index 9d7b5a8c8dea..72bec5eb2f18 100644
> --- a/drivers/gpu/drm/i915/i915_debugfs.c
> +++ b/drivers/gpu/drm/i915/i915_debugfs.c
> @@ -159,8 +159,32 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
> seq_printf(m, " (%sgtt offset: %08llx, size: %08llx",
> i915_vma_is_ggtt(vma) ? "g" : "pp",
> vma->node.start, vma->node.size);
> - if (i915_vma_is_ggtt(vma))
> - seq_printf(m, ", type: %u", vma->ggtt_view.type);
> + if (i915_vma_is_ggtt(vma)) {
> + switch (vma->ggtt_view.type) {
> + case I915_GGTT_VIEW_NORMAL:
> + seq_puts(m, ", normal");
> + break;
> +
> + case I915_GGTT_VIEW_PARTIAL:
> + seq_printf(m, ", partial [%08llx+%x]",
> + vma->ggtt_view.params.partial.offset,
> + vma->ggtt_view.params.partial.size << PAGE_SHIFT);
> + break;
> +
> + case I915_GGTT_VIEW_ROTATED:
> + seq_printf(m, ", rotated [(%ux%u, %d), (%ux%u, %d)]",
It's all %u AFAICS. Also there is offset which I missed previously. If
you add it we probably need to name the stride and offset fields then?
Like (%ux%u, stride=%u, offset=%u)?
> + vma->ggtt_view.params.rotated.plane[0].width,
> + vma->ggtt_view.params.rotated.plane[0].height,
> + vma->ggtt_view.params.rotated.plane[0].stride,
> + vma->ggtt_view.params.rotated.plane[1].width,
> + vma->ggtt_view.params.rotated.plane[1].height,
> + vma->ggtt_view.params.rotated.plane[1].stride);
> + break;
> + default:
> + MISSING_CASE(vma->ggtt_view.type);
> + break;
> + }
> + }
> if (vma->fence)
> seq_printf(m, " , fence: %d%s",
> vma->fence->id,
>
With the above you can add my r-b.
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2] drm/i915: Expand ggtt_view paramters for debugfs
2017-01-12 11:14 ` Tvrtko Ursulin
@ 2017-01-12 11:18 ` Chris Wilson
0 siblings, 0 replies; 5+ messages in thread
From: Chris Wilson @ 2017-01-12 11:18 UTC (permalink / raw)
To: Tvrtko Ursulin; +Cc: intel-gfx
On Thu, Jan 12, 2017 at 11:14:55AM +0000, Tvrtko Ursulin wrote:
>
> On 12/01/2017 11:06, Chris Wilson wrote:
> >When dumping the VMA, include the parameters of the different GGTT views
> >so that we can distinguish them.
> >
> >v2: Contract output and add MISSING_CASE for any unknown types.
> >
> >Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> >Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> >---
> > drivers/gpu/drm/i915/i915_debugfs.c | 28 ++++++++++++++++++++++++++--
> > 1 file changed, 26 insertions(+), 2 deletions(-)
> >
> >diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
> >index 9d7b5a8c8dea..72bec5eb2f18 100644
> >--- a/drivers/gpu/drm/i915/i915_debugfs.c
> >+++ b/drivers/gpu/drm/i915/i915_debugfs.c
> >@@ -159,8 +159,32 @@ describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
> > seq_printf(m, " (%sgtt offset: %08llx, size: %08llx",
> > i915_vma_is_ggtt(vma) ? "g" : "pp",
> > vma->node.start, vma->node.size);
> >- if (i915_vma_is_ggtt(vma))
> >- seq_printf(m, ", type: %u", vma->ggtt_view.type);
> >+ if (i915_vma_is_ggtt(vma)) {
> >+ switch (vma->ggtt_view.type) {
> >+ case I915_GGTT_VIEW_NORMAL:
> >+ seq_puts(m, ", normal");
> >+ break;
> >+
> >+ case I915_GGTT_VIEW_PARTIAL:
> >+ seq_printf(m, ", partial [%08llx+%x]",
> >+ vma->ggtt_view.params.partial.offset,
> >+ vma->ggtt_view.params.partial.size << PAGE_SHIFT);
> >+ break;
> >+
> >+ case I915_GGTT_VIEW_ROTATED:
> >+ seq_printf(m, ", rotated [(%ux%u, %d), (%ux%u, %d)]",
>
> It's all %u AFAICS. Also there is offset which I missed previously.
> If you add it we probably need to name the stride and offset fields
> then? Like (%ux%u, stride=%u, offset=%u)?
I honestly don't know how I missed the %d. And I forgot entirely about
the offset.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2017-01-12 11:18 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-12 10:35 [PATCH] drm/i915: Expand ggtt_view paramters for debugfs Chris Wilson
2017-01-12 10:47 ` Tvrtko Ursulin
2017-01-12 11:06 ` [PATCH v2] " Chris Wilson
2017-01-12 11:14 ` Tvrtko Ursulin
2017-01-12 11:18 ` Chris Wilson
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.