diff options
author | Lingfeng Yang <lfy@google.com> | 2020-04-16 09:45:10 -0700 |
---|---|---|
committer | Alistair Delva <adelva@google.com> | 2020-04-17 15:31:00 -0700 |
commit | b47c175e70b5e93f88c907b893a81fb713fc507d (patch) | |
tree | ca373003efc6f092f71aee6f28276c48d8f9adf4 /include/uapi | |
parent | 58d064884c8926e012b8c0bf53d1b4d1422b9477 (diff) |
CHROMIUM: drm/virtgpu: expose new ioctls to userspace
These are necessary for creating new types of resources and
memories.
BUG=chromium:924405
TEST=compile
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/kernel/+/1629910
Reviewed-by: Robert Tarasov <tutankhamen@chromium.org>
Commit-Queue: Gurchetan Singh <gurchetansingh@chromium.org>
Tested-by: Gurchetan Singh <gurchetansingh@chromium.org>
Bug: 153580313
Signed-off-by: Lingfeng Yang <lfy@google.com>
Change-Id: Iec22f634000bad1a8713e690db3774d0ab96408d
Diffstat (limited to 'include/uapi')
-rw-r--r-- | include/uapi/drm/virtgpu_drm.h | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/include/uapi/drm/virtgpu_drm.h b/include/uapi/drm/virtgpu_drm.h index f06a789f34cd..a7c2ce87773b 100644 --- a/include/uapi/drm/virtgpu_drm.h +++ b/include/uapi/drm/virtgpu_drm.h @@ -46,6 +46,9 @@ extern "C" { #define DRM_VIRTGPU_TRANSFER_TO_HOST 0x07 #define DRM_VIRTGPU_WAIT 0x08 #define DRM_VIRTGPU_GET_CAPS 0x09 +#define DRM_VIRTGPU_RESOURCE_CREATE_V2 0x0a +#define DRM_VIRTGPU_ALLOCATION_METADATA_REQUEST 0x0b +#define DRM_VIRTGPU_ALLOCATION_METADATA_RESPONSE 0x0c #define VIRTGPU_EXECBUF_FENCE_FD_IN 0x01 #define VIRTGPU_EXECBUF_FENCE_FD_OUT 0x02 @@ -71,6 +74,19 @@ struct drm_virtgpu_execbuffer { #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */ #define VIRTGPU_PARAM_CAPSET_QUERY_FIX 2 /* do we have the capset fix */ +#define VIRTGPU_PARAM_RESOURCE_V2 3 +#define VIRTGPU_PARAM_SHARED_GUEST 4 +#define VIRTGPU_PARAM_HOST_COHERENT 5 + +#define VIRTGPU_MEMORY_UNDEFINED 0 +#define VIRTGPU_MEMORY_TRANSFER 1 +#define VIRTGPU_MEMORY_SHARED_GUEST 2 +#define VIRTGPU_MEMORY_HOST_COHERENT 3 + +#define VIRTGPU_UNDEFINED_CACHING 0 +#define VIRTGPU_CACHED 1 +#define VIRTGPU_WRITE_COMBINE 2 +#define VIRTGPU_UNCACHED 3 struct drm_virtgpu_getparam { __u64 param; @@ -140,6 +156,31 @@ struct drm_virtgpu_get_caps { __u32 pad; }; +struct drm_virtgpu_resource_create_v2 { + __u32 resource_id; + __u32 guest_memory_type; + __u32 caching_type; + __u32 args_size; + __u32 gem_handle; + __u64 size; + __u64 args; /* void */ +}; + +struct drm_virtgpu_allocation_metadata_request { + __u32 request_id; + __u32 pad; + __u32 request_size; + __u32 response_size; + __u64 request; /* void */ +}; + +struct drm_virtgpu_allocation_metadata_response { + __u32 request_id; + __u32 pad; + __u32 response_size; + __u64 response; /* void */ +}; + #define DRM_IOCTL_VIRTGPU_MAP \ DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_MAP, struct drm_virtgpu_map) @@ -175,6 +216,18 @@ struct drm_virtgpu_get_caps { DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_GET_CAPS, \ struct drm_virtgpu_get_caps) +#define DRM_IOCTL_VIRTGPU_RESOURCE_CREATE_V2 \ + DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_RESOURCE_CREATE_V2, \ + struct drm_virtgpu_resource_create_v2) + +#define DRM_IOCTL_VIRTGPU_ALLOCATION_METADATA_REQUEST \ + DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_ALLOCATION_METADATA_REQUEST, \ + struct drm_virtgpu_allocation_metadata_request) + +#define DRM_IOCTL_VIRTGPU_ALLOCATION_METADATA_RESPONSE \ + DRM_IOWR(DRM_COMMAND_BASE + DRM_VIRTGPU_ALLOCATION_METADATA_RESPONSE, \ + struct drm_virtgpu_allocation_metadata_response) + #if defined(__cplusplus) } #endif |