yeahuh / rpms / qemu-kvm

Forked from rpms/qemu-kvm 2 years ago
Clone
169b9a
From 2065c7a1c75f56c8ea23952fd4de4b031a96552c Mon Sep 17 00:00:00 2001
169b9a
From: Tarun Gupta <tgupta@redhat.com>
169b9a
Date: Wed, 20 Jun 2018 18:54:21 +0200
169b9a
Subject: [PATCH 13/17] linux-headers: Update to include region based display
169b9a
 support.
169b9a
169b9a
RH-Author: Tarun Gupta <tgupta@redhat.com>
169b9a
Message-id: <1529520865-18127-8-git-send-email-tgupta@redhat.com>
169b9a
Patchwork-id: 80913
169b9a
O-Subject: [RHEL7.6 qemu-kvm PATCH v3 07/11] linux-headers: Update to include region based display support.
169b9a
Bugzilla: 1555246
169b9a
RH-Acked-by: Alex Williamson <alex.williamson@redhat.com>
169b9a
RH-Acked-by: Gerd Hoffmann <kraxel@redhat.com>
169b9a
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
169b9a
169b9a
update Linux headers to 4.16-rc5
169b9a
169b9a
Note that VIRTIO_GPU_CAPSET_VIRGL2 was added manually so it has to
169b9a
be added manually after re-running scripts/update-linux-headers.sh.
169b9a
169b9a
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
169b9a
(cherry picked from 9f2d175db5c29b23bc1a560041043d0b10ee57dc)
169b9a
169b9a
Conflict: Only cherry-picking macros for adding region based display
169b9a
support
169b9a
169b9a
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
169b9a
---
169b9a
 linux-headers/linux/vfio.h | 52 ++++++++++++++++++++++++++++++++++++++++++++++
169b9a
 1 file changed, 52 insertions(+)
169b9a
169b9a
diff --git a/linux-headers/linux/vfio.h b/linux-headers/linux/vfio.h
169b9a
index 8995a34..0dab0cc 100644
169b9a
--- a/linux-headers/linux/vfio.h
169b9a
+++ b/linux-headers/linux/vfio.h
169b9a
@@ -414,6 +414,58 @@ struct vfio_pci_hot_reset {
169b9a
 
169b9a
 #define VFIO_DEVICE_PCI_HOT_RESET	_IO(VFIO_TYPE, VFIO_BASE + 13)
169b9a
 
169b9a
+/**
169b9a
+ * VFIO_DEVICE_QUERY_GFX_PLANE - _IOW(VFIO_TYPE, VFIO_BASE + 14,
169b9a
+ *                                    struct vfio_device_query_gfx_plane)
169b9a
+ *
169b9a
+ * Set the drm_plane_type and flags, then retrieve the gfx plane info.
169b9a
+ *
169b9a
+ * flags supported:
169b9a
+ * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_DMABUF are set
169b9a
+ *   to ask if the mdev supports dma-buf. 0 on support, -EINVAL on no
169b9a
+ *   support for dma-buf.
169b9a
+ * - VFIO_GFX_PLANE_TYPE_PROBE and VFIO_GFX_PLANE_TYPE_REGION are set
169b9a
+ *   to ask if the mdev supports region. 0 on support, -EINVAL on no
169b9a
+ *   support for region.
169b9a
+ * - VFIO_GFX_PLANE_TYPE_DMABUF or VFIO_GFX_PLANE_TYPE_REGION is set
169b9a
+ *   with each call to query the plane info.
169b9a
+ * - Others are invalid and return -EINVAL.
169b9a
+ *
169b9a
+ * Note:
169b9a
+ * 1. Plane could be disabled by guest. In that case, success will be
169b9a
+ *    returned with zero-initialized drm_format, size, width and height
169b9a
+ *    fields.
169b9a
+ * 2. x_hot/y_hot is set to 0xFFFFFFFF if no hotspot information available
169b9a
+ *
169b9a
+ * Return: 0 on success, -errno on other failure.
169b9a
+ */
169b9a
+struct vfio_device_gfx_plane_info {
169b9a
+	__u32 argsz;
169b9a
+	__u32 flags;
169b9a
+#define VFIO_GFX_PLANE_TYPE_PROBE (1 << 0)
169b9a
+#define VFIO_GFX_PLANE_TYPE_DMABUF (1 << 1)
169b9a
+#define VFIO_GFX_PLANE_TYPE_REGION (1 << 2)
169b9a
+	/* in */
169b9a
+	__u32 drm_plane_type;	/* type of plane: DRM_PLANE_TYPE_* */
169b9a
+	/* out */
169b9a
+	__u32 drm_format;	/* drm format of plane */
169b9a
+	__u64 drm_format_mod;   /* tiled mode */
169b9a
+	__u32 width;	/* width of plane */
169b9a
+	__u32 height;	/* height of plane */
169b9a
+	__u32 stride;	/* stride of plane */
169b9a
+	__u32 size;	/* size of plane in bytes, align on page*/
169b9a
+	__u32 x_pos;	/* horizontal position of cursor plane */
169b9a
+	__u32 y_pos;	/* vertical position of cursor plane*/
169b9a
+	__u32 x_hot;    /* horizontal position of cursor hotspot */
169b9a
+	__u32 y_hot;    /* vertical position of cursor hotspot */
169b9a
+	union {
169b9a
+		__u32 region_index;	/* region index */
169b9a
+		__u32 dmabuf_id;	/* dma-buf id */
169b9a
+	};
169b9a
+};
169b9a
+
169b9a
+#define VFIO_DEVICE_QUERY_GFX_PLANE _IO(VFIO_TYPE, VFIO_BASE + 14)
169b9a
+
169b9a
 /* -------- API for Type1 VFIO IOMMU -------- */
169b9a
 
169b9a
 /**
169b9a
-- 
169b9a
1.8.3.1
169b9a