]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/gem: Pull phys pread/pwrite implementations to the backend
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 5 Nov 2020 15:49:34 +0000 (15:49 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 5 Nov 2020 19:24:19 +0000 (19:24 +0000)
commite0f0b9eaa1a0da15bafbcc34bf576936d433b0e0
tree0421ce3f0edb831d73990fdf07327207d0fb2831
parent1ff3d8817204812e24a6da7d20f3b3a1bbf2ebd0
drm/i915/gem: Pull phys pread/pwrite implementations to the backend

Move the specialised interactions with the physical GEM object from the
pread/pwrite ioctl handler into the phys backend.

Currently, if one is able to exhaust the entire aperture and then try to
pwrite into an object not backed by struct page, we accidentally invoked
the phys pwrite handler on a non-phys object; calamitous.

Fixes: 2e3583d3561a ("drm/i915: Wean off drm_pci_alloc/drm_pci_free")
Testcase: igt/gem_pwrite/exhaustion
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Cc: stable@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20201105154934.16022-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_phys.c
drivers/gpu/drm/i915/i915_gem.c