drm/virtio: Extend blob UAPI with deferred-mapping hinting

If userspace never maps GEM object, then BO wastes hostmem space
because VirtIO-GPU driver maps VRAM BO at the BO's creating time.

Make mappings on-demand by adding new RESOURCE_CREATE_BLOB IOCTL/UAPI
hinting flag telling that host mapping should be deferred until first
mapping is made when the flag is set by userspace.

Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Link: https://patch.msgid.link/20260501000043.2483678-1-dmitry.osipenko@collabora.com
This commit is contained in:
Dmitry Osipenko
2026-05-01 03:00:43 +03:00
parent d989f135f7
commit 4c26e16294
4 changed files with 32 additions and 5 deletions

View File

@@ -200,6 +200,10 @@ struct drm_virtgpu_resource_create_blob {
__u32 cmd_size;
__u64 cmd;
__u64 blob_id;
#define DRM_VIRTGPU_BLOB_FLAG_HINT_DEFER_MAPPING 0x0001
__u32 blob_hints;
__u32 pad2;
};
#define VIRTGPU_CONTEXT_PARAM_CAPSET_ID 0x0001