]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/ttm: Correctly handle waiting for gpu when shrinking
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Mon, 22 Nov 2021 21:45:52 +0000 (22:45 +0100)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 25 Nov 2021 08:36:18 +0000 (09:36 +0100)
commit9cb621ba09f7cd54758ced6c08027185017c3fae
tree5229b164e7c1d47005903ba1b5a3444ca9478bc0
parent59c0730ec2fa835e73731f5f6378e85e0c3ce17d
drm/i915/ttm: Correctly handle waiting for gpu when shrinking

With async migration, the shrinker may end up wanting to release the
pages of an object while the migration blit is still running, since
the GT migration code doesn't set up VMAs and the shrinker is thus
oblivious to the fact that the GPU is still using the pages.

Add waiting for gpu in the shrinker_release_pages() op and an
argument to that function indicating whether the shrinker expects it
to not wait for gpu. In the latter case the shrinker_release_pages()
op will return -EBUSY if the object is not idle.

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/20211122214554.371864-5-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/i915/gem/i915_gem_object_types.h
drivers/gpu/drm/i915/gem/i915_gem_shrinker.c
drivers/gpu/drm/i915/gem/i915_gem_ttm.c