drm/i915: Focus debugfs/i915_gem_pinned to show only display pins
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Aug 2016 09:48:44 +0000 (10:48 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 15 Aug 2016 10:00:52 +0000 (11:00 +0100)
Only those objects pinned to the display have semi-permanent pins of a
global nature (other pins are transient within their local vm). Simplify
i915_gem_pinned to only show the pertinent information about the pinned
objects within the GGTT.

v2: i915_gem_gtt_info is still shared with debugfs/i915_gem_gtt,
rename i915_gem_pinned to i915_gem_pin_display to better reflect its
contents

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1471254551-25805-5-git-send-email-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c

index 470512d5e5d71ee5dac2d32d95b07243efb51b9a..859dc0e032f9874aa1dccafc02d23526b617795d 100644 (file)
 #include <drm/i915_drm.h>
 #include "i915_drv.h"
 
-enum {
-       ACTIVE_LIST,
-       INACTIVE_LIST,
-       PINNED_LIST,
-};
-
 /* As the drm_debugfs_init() routines are called before dev->dev_private is
  * allocated we need to hook into the minor for release. */
 static int
@@ -537,8 +531,8 @@ static int i915_gem_gtt_info(struct seq_file *m, void *data)
 {
        struct drm_info_node *node = m->private;
        struct drm_device *dev = node->minor->dev;
-       uintptr_t list = (uintptr_t) node->info_ent->data;
        struct drm_i915_private *dev_priv = to_i915(dev);
+       bool show_pin_display_only = !!data;
        struct drm_i915_gem_object *obj;
        u64 total_obj_size, total_gtt_size;
        int count, ret;
@@ -549,7 +543,7 @@ static int i915_gem_gtt_info(struct seq_file *m, void *data)
 
        total_obj_size = total_gtt_size = count = 0;
        list_for_each_entry(obj, &dev_priv->mm.bound_list, global_list) {
-               if (list == PINNED_LIST && !i915_gem_obj_is_pinned(obj))
+               if (show_pin_display_only && !obj->pin_display)
                        continue;
 
                seq_puts(m, "   ");
@@ -5372,7 +5366,7 @@ static const struct drm_info_list i915_debugfs_list[] = {
        {"i915_capabilities", i915_capabilities, 0},
        {"i915_gem_objects", i915_gem_object_info, 0},
        {"i915_gem_gtt", i915_gem_gtt_info, 0},
-       {"i915_gem_pinned", i915_gem_gtt_info, 0, (void *) PINNED_LIST},
+       {"i915_gem_pin_display", i915_gem_gtt_info, 0, (void *)1},
        {"i915_gem_stolen", i915_gem_stolen_list_info },
        {"i915_gem_pageflip", i915_gem_pageflip_info, 0},
        {"i915_gem_request", i915_gem_request_info, 0},