]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Implement a function to process all gem objects of a region
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Wed, 22 Sep 2021 06:25:20 +0000 (08:25 +0200)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Fri, 24 Sep 2021 06:19:09 +0000 (08:19 +0200)
commit241cb08a1f7ba0f20a50b7a45fd2abad056257ce
tree11da62399531b23463f99a05bf74d0e4f6e25a6d
parent68fe019cdfc353cbad18c105c342a4ba59ea803f
drm/i915/gem: Implement a function to process all gem objects of a region

An upcoming common pattern is to traverse the region object list and
perform certain actions on all objects in a region. It's a little tricky
to get the list locking right, in particular since a gem object may
change region unless it's pinned or the object lock is held.

Define a function that does this for us and that takes an argument that
defines the action to be performed on each object.

v3:
- Improve structure documentation a bit (Matthew Auld)

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210922062527.865433-3-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/i915/gem/i915_gem_region.c
drivers/gpu/drm/i915/gem/i915_gem_region.h