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.
Showing the changes to include/uapi (1 of 4 files). Show all
Unified · Split
| @@ -200,6 +200,10 @@ struct drm_virtgpu_resource_create_blob { · 199 unmodified lines | ||
| 200 | 200 | __u32 cmd_size; |
| 201 | 201 | __u64 cmd; |
| 202 | 202 | __u64 blob_id; |
| 203 | + | |
| 204 | +#define DRM_VIRTGPU_BLOB_FLAG_HINT_DEFER_MAPPING 0x0001 | |
| 205 | + __u32 blob_hints; | |
| 206 | + __u32 pad2; | |
| 203 | 207 | }; |
| 204 | 208 | |
| 205 | 209 | #define VIRTGPU_CONTEXT_PARAM_CAPSET_ID 0x0001 |