diff mbox

[5/9] drm/i915: print object bindings in debugfs

Message ID 1384828358-31563-6-git-send-email-rodrigo.vivi@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi Nov. 19, 2013, 2:32 a.m. UTC
From: Daniel Vetter <daniel.vetter@ffwll.ch>

This is useful when we only have aliasing ppgtt and want to figure out
what exactly is accesssible and what not. Paulo can somehow overwrite
the fbcon framebuffer with the blitter on his hsw machine ...

v2: Actually make it compile.

Cc: Paulo Zanoni <przanoni@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
---
 drivers/gpu/drm/i915/i915_debugfs.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Chris Wilson Nov. 19, 2013, 1:52 p.m. UTC | #1
On Mon, Nov 18, 2013 at 06:32:34PM -0800, Rodrigo Vivi wrote:
> From: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> This is useful when we only have aliasing ppgtt and want to figure out
> what exactly is accesssible and what not. Paulo can somehow overwrite
> the fbcon framebuffer with the blitter on his hsw machine ...
> 
> v2: Actually make it compile.
> 
> Cc: Paulo Zanoni <przanoni@gmail.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

This is still too ugly.

(bindings: )
(bindings: g)
(bindings: pp)
(bindings: gpp)
-Chris
Rodrigo Vivi Nov. 19, 2013, 5:37 p.m. UTC | #2
On Tue, Nov 19, 2013 at 5:52 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Mon, Nov 18, 2013 at 06:32:34PM -0800, Rodrigo Vivi wrote:
>> From: Daniel Vetter <daniel.vetter@ffwll.ch>
>>
>> This is useful when we only have aliasing ppgtt and want to figure out
>> what exactly is accesssible and what not. Paulo can somehow overwrite
>> the fbcon framebuffer with the blitter on his hsw machine ...
>>
>> v2: Actually make it compile.
>>
>> Cc: Paulo Zanoni <przanoni@gmail.com>
>> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
>
> This is still too ugly.

at least should be the opposite pp before g and complemented with a tt
in the end.

>
> (bindings: )
> (bindings: g)
> (bindings: pp)
> (bindings: gpp)
> -Chris

But what are all real possible options?

nothing, gtt or ppgtt?

>
> --
> Chris Wilson, Intel Open Source Technology Centre
Chris Wilson Nov. 20, 2013, 11:03 a.m. UTC | #3
On Tue, Nov 19, 2013 at 09:37:16AM -0800, Rodrigo Vivi wrote:
> On Tue, Nov 19, 2013 at 5:52 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> > On Mon, Nov 18, 2013 at 06:32:34PM -0800, Rodrigo Vivi wrote:
> >> From: Daniel Vetter <daniel.vetter@ffwll.ch>
> >>
> >> This is useful when we only have aliasing ppgtt and want to figure out
> >> what exactly is accesssible and what not. Paulo can somehow overwrite
> >> the fbcon framebuffer with the blitter on his hsw machine ...
> >>
> >> v2: Actually make it compile.
> >>
> >> Cc: Paulo Zanoni <przanoni@gmail.com>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> >> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
> >
> > This is still too ugly.
> 
> at least should be the opposite pp before g and complemented with a tt
> in the end.
> 
> >
> > (bindings: )
> > (bindings: g)
> > (bindings: pp)
> > (bindings: gpp)
> > -Chris
> 
> But what are all real possible options?
> 
> nothing, gtt or ppgtt?

nothing, gtt, ppggt, both.
-Chris
Rodrigo Vivi Nov. 20, 2013, 4:52 p.m. UTC | #4
On Wed, Nov 20, 2013 at 3:03 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Tue, Nov 19, 2013 at 09:37:16AM -0800, Rodrigo Vivi wrote:
>> On Tue, Nov 19, 2013 at 5:52 AM, Chris Wilson <chris@chris-wilson.co.uk> wrote:
>> > On Mon, Nov 18, 2013 at 06:32:34PM -0800, Rodrigo Vivi wrote:
>> >> From: Daniel Vetter <daniel.vetter@ffwll.ch>
>> >>
>> >> This is useful when we only have aliasing ppgtt and want to figure out
>> >> what exactly is accesssible and what not. Paulo can somehow overwrite
>> >> the fbcon framebuffer with the blitter on his hsw machine ...
>> >>
>> >> v2: Actually make it compile.
>> >>
>> >> Cc: Paulo Zanoni <przanoni@gmail.com>
>> >> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
>> >> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
>> >
>> > This is still too ugly.
>>
>> at least should be the opposite pp before g and complemented with a tt
>> in the end.
>>
>> >
>> > (bindings: )
>> > (bindings: g)
>> > (bindings: pp)
>> > (bindings: gpp)
>> > -Chris
>>
>> But what are all real possible options?
>>
>> nothing, gtt or ppgtt?
>
> nothing, gtt, ppggt, both.

so, forget what I said...

what about this below?
 seq_printf(m, " (bindings: %s%s)",
                        obj->has_global_gtt_mapping ? "gtt" : "",
                        obj->has_aliasing_ppgtt_mapping ? " ppgtt" : "");

(bindings: )
(bindings: gtt)
(bindings:  ppgtt)
(bindings: gtt ppgtt)


with or without this bikeshed feel free to use:
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>

> -Chris
>
> --
> Chris Wilson, Intel Open Source Technology Centre
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index 7008aac..3426118 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -124,7 +124,9 @@  static inline const char *get_global_flag(struct drm_i915_gem_object *obj)
 static void
 describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
 {
+	struct drm_i915_private *dev_priv = obj->base.dev->dev_private;
 	struct i915_vma *vma;
+
 	seq_printf(m, "%pK: %s%s%s %8zdKiB %02x %02x %u %u %u%s%s%s",
 		   &obj->base,
 		   get_pin_flag(obj),
@@ -155,6 +157,10 @@  describe_obj(struct seq_file *m, struct drm_i915_gem_object *obj)
 		seq_printf(m, "gtt offset: %08lx, size: %08lx)",
 			   vma->node.start, vma->node.size);
 	}
+	if (dev_priv->mm.aliasing_ppgtt)
+		seq_printf(m, " (bindings: %s%s)",
+			   obj->has_global_gtt_mapping ? "g" : "",
+			   obj->has_aliasing_ppgtt_mapping ? "pp" : "");
 	if (obj->stolen)
 		seq_printf(m, " (stolen: %08lx)", obj->stolen->start);
 	if (obj->pin_mappable || obj->fault_mappable) {