summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLingfeng Yang <lfy@google.com>2020-04-16 09:45:10 -0700
committerAlistair Delva <adelva@google.com>2020-04-22 13:34:20 -0700
commita643c88ccb437130c853bb0d46c7af33cb19a371 (patch)
tree564d2b26892a39ea9d6c589661fe87658235275c
parentc8776caae8aa433622bed98c9650af799ade2a0e (diff)
downloadcuttlefish-modules-a643c88ccb437130c853bb0d46c7af33cb19a371.tar.gz
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
-rw-r--r--uapi/drm/virtgpu_drm.h53
1 files changed, 53 insertions, 0 deletions
diff --git a/uapi/drm/virtgpu_drm.h b/uapi/drm/virtgpu_drm.h
index 4567080..d6f0a2e 100644
--- a/uapi/drm/virtgpu_drm.h
+++ b/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