drm/i915: Make debugfs/per_file_stats scale better
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 8 Aug 2019 16:24:07 +0000 (17:24 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 8 Aug 2019 20:54:20 +0000 (21:54 +0100)
commit5b5efdf79abffb959cfbdf1dad063358d23069aa
tree219a5b1090c99150a5679ac7fec25fc8781b18bc
parentc990b4c3597d6c75dbc2937401ce32838adc77fc
drm/i915: Make debugfs/per_file_stats scale better

Currently we walk the entire list of obj->vma for each obj within a file
to find the matching vma of this context. Since we know we are searching
for a particular vma bound to a user context, we can use the rbtree to
search for it rather than repeatedly walk everything.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190808162407.28121-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_debugfs.c