drm/vmwgfx: Add basic support for external buffers
authorZack Rusin <zack.rusin@broadcom.com>
Mon, 22 Jul 2024 18:41:16 +0000 (14:41 -0400)
committerZack Rusin <zack.rusin@broadcom.com>
Thu, 25 Jul 2024 02:21:53 +0000 (22:21 -0400)
commit12bed149a3460bb6efbca697b4a46e11c819db86
treef6fd70f1f3dd39f64b5f605978ee0081a5e4af6b
parentd6667f0ddf46c671d379cd5fe66ce0a54d2a743a
drm/vmwgfx: Add basic support for external buffers

Make vmwgfx go through the dma-buf interface to map/unmap imported
buffers. The driver used to try to directly manipulate external
buffers, assuming that everything that was coming to it had to live
in cpu accessible memory. While technically true because what's in the
vms is controlled by us, it's semantically completely broken.

Fix importing of external buffers by forwarding all memory access
requests to the importer.

Tested by the vmw_prime basic_vgem test.

Signed-off-by: Zack Rusin <zack.rusin@broadcom.com>
Reviewed-by: Maaz Mombasawala <maaz.mombasawala@broadcom.com>
Reviewed-by: Martin Krastev <martin.krastev@broadcom.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240722184313.181318-5-zack.rusin@broadcom.com
drivers/gpu/drm/vmwgfx/vmwgfx_gem.c