]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915: Require the vm mutex for i915_vma_bind()
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Tue, 21 Dec 2021 20:00:50 +0000 (21:00 +0100)
committerThomas Hellström <thomas.hellstrom@linux.intel.com>
Wed, 22 Dec 2021 07:52:57 +0000 (08:52 +0100)
commitcead2caa3dd1c42550fc5215543df252e4add690
treeb3f56f8cc2e3d3e92b66e237eb5890961a399003
parenta85fe1bebaedcc31aec34bb0366b2ec307d7b4ae
drm/i915: Require the vm mutex for i915_vma_bind()

Protect updates of struct i915_vma flags and async binding / unbinding
with the vm::mutex. This means that i915_vma_bind() needs to assert
vm::mutex held. In order to make that possible drop the caching of
kmap_atomic() maps around i915_vma_bind().

An alternative would be to use kmap_local() but since we block cpu
unplugging during sleeps inside kmap_local() sections this may have
unwanted side-effects. Particularly since we might wait for gpu while
holding the vm mutex.

This change may theoretically increase execbuf cpu-usage on snb, but
at least on non-highmem systems that increase should be very small.

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/20211221200050.436316-5-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/i915_vma.c