Module: Mesa
Branch: main
Commit: b0deba6210ea84227f78ee40e7cc28e766c4a0f6
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=b0deba6210ea84227f78ee40e7cc28e766c4a0f6

Author: Rob Clark <[email protected]>
Date:   Fri May 19 13:33:11 2023 -0700

drm-uapi: Update virtgpu header

Signed-off-by: Rob Clark <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23533>

---

 include/drm-uapi/README        |  8 ++--
 include/drm-uapi/amdgpu_drm.h  |  2 +
 include/drm-uapi/drm.h         | 84 ++++++++++++++++++++++++++++++++++--------
 include/drm-uapi/drm_mode.h    |  7 +++-
 include/drm-uapi/virtgpu_drm.h | 16 +++++++-
 5 files changed, 95 insertions(+), 22 deletions(-)

diff --git a/include/drm-uapi/README b/include/drm-uapi/README
index 8ef6fd4f8f2..e72aef05e7f 100644
--- a/include/drm-uapi/README
+++ b/include/drm-uapi/README
@@ -13,9 +13,9 @@ $ make headers_install INSTALL_HDR_PATH=/path/to/install
 
 The last update was done at the following kernel commit :
 
-commit 2e1492835e439fceba57a5b0f9b17da8e78ffa3d
-Merge: 85d712f033d2 43049f17b526
+commit d9aa1da9a8cfb0387eb5703c15bd1f54421460ac
+Merge: 7c9aa0f7463e 28e671114fb0
 Author: Dave Airlie <[email protected]>
-Date:   Fri Jun 2 13:38:48 2023 +1000
+Date:   Mon Aug 7 13:49:24 2023 +1000
 
-    Merge tag 'drm-misc-next-2023-06-01' of 
git://anongit.freedesktop.org/drm/drm-misc into drm-next
+    Merge tag 'drm-intel-gt-next-2023-08-04' of 
git://anongit.freedesktop.org/drm/drm-intel into drm-next
diff --git a/include/drm-uapi/amdgpu_drm.h b/include/drm-uapi/amdgpu_drm.h
index 95b5dd0dbed..79b14828d54 100644
--- a/include/drm-uapi/amdgpu_drm.h
+++ b/include/drm-uapi/amdgpu_drm.h
@@ -888,6 +888,8 @@ struct drm_amdgpu_cs_chunk_cp_gfx_shadow {
        #define AMDGPU_INFO_VIDEO_CAPS_DECODE           0
        /* Subquery id: Encode */
        #define AMDGPU_INFO_VIDEO_CAPS_ENCODE           1
+/* Query the max number of IBs per gang per submission */
+#define AMDGPU_INFO_MAX_IBS                    0x22
 
 #define AMDGPU_INFO_MMR_SE_INDEX_SHIFT 0
 #define AMDGPU_INFO_MMR_SE_INDEX_MASK  0xff
diff --git a/include/drm-uapi/drm.h b/include/drm-uapi/drm.h
index 581a7f6301e..02540248deb 100644
--- a/include/drm-uapi/drm.h
+++ b/include/drm-uapi/drm.h
@@ -667,8 +667,11 @@ struct drm_gem_open {
  * Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT
  * and &DRM_PRIME_CAP_EXPORT.
  *
- * PRIME buffers are exposed as dma-buf file descriptors. See
- * Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing".
+ * Starting from kernel version 6.6, both &DRM_PRIME_CAP_IMPORT and
+ * &DRM_PRIME_CAP_EXPORT are always advertised.
+ *
+ * PRIME buffers are exposed as dma-buf file descriptors.
+ * See :ref:`prime_buffer_sharing`.
  */
 #define DRM_CAP_PRIME                  0x5
 /**
@@ -676,6 +679,8 @@ struct drm_gem_open {
  *
  * If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME
  * buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl.
+ *
+ * Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
  */
 #define  DRM_PRIME_CAP_IMPORT          0x1
 /**
@@ -683,6 +688,8 @@ struct drm_gem_open {
  *
  * If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME
  * buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl.
+ *
+ * Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
  */
 #define  DRM_PRIME_CAP_EXPORT          0x2
 /**
@@ -750,15 +757,14 @@ struct drm_gem_open {
 /**
  * DRM_CAP_SYNCOBJ
  *
- * If set to 1, the driver supports sync objects. See
- * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
+ * If set to 1, the driver supports sync objects. See :ref:`drm_sync_objects`.
  */
 #define DRM_CAP_SYNCOBJ                0x13
 /**
  * DRM_CAP_SYNCOBJ_TIMELINE
  *
  * If set to 1, the driver supports timeline operations on sync objects. See
- * Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
+ * :ref:`drm_sync_objects`.
  */
 #define DRM_CAP_SYNCOBJ_TIMELINE       0x14
 
@@ -903,6 +909,27 @@ struct drm_syncobj_timeline_wait {
        __u32 pad;
 };
 
+/**
+ * struct drm_syncobj_eventfd
+ * @handle: syncobj handle.
+ * @flags: Zero to wait for the point to be signalled, or
+ *         &DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE to wait for a fence to be
+ *         available for the point.
+ * @point: syncobj timeline point (set to zero for binary syncobjs).
+ * @fd: Existing eventfd to sent events to.
+ * @pad: Must be zero.
+ *
+ * Register an eventfd to be signalled by a syncobj. The eventfd counter will
+ * be incremented by one.
+ */
+struct drm_syncobj_eventfd {
+       __u32 handle;
+       __u32 flags;
+       __u64 point;
+       __s32 fd;
+       __u32 pad;
+};
+
 
 struct drm_syncobj_array {
        __u64 handles;
@@ -1163,6 +1190,8 @@ extern "C" {
  */
 #define DRM_IOCTL_MODE_GETFB2          DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
 
+#define DRM_IOCTL_SYNCOBJ_EVENTFD      DRM_IOWR(0xCF, struct 
drm_syncobj_eventfd)
+
 /*
  * Device specific ioctls should only be in their respective headers
  * The device specific ioctl range is from 0x40 to 0x9f.
@@ -1174,25 +1203,50 @@ extern "C" {
 #define DRM_COMMAND_BASE                0x40
 #define DRM_COMMAND_END                        0xA0
 
-/*
- * Header for events written back to userspace on the drm fd.  The
- * type defines the type of event, the length specifies the total
- * length of the event (including the header), and user_data is
- * typically a 64 bit value passed with the ioctl that triggered the
- * event.  A read on the drm fd will always only return complete
- * events, that is, if for example the read buffer is 100 bytes, and
- * there are two 64 byte events pending, only one will be returned.
+/**
+ * struct drm_event - Header for DRM events
+ * @type: event type.
+ * @length: total number of payload bytes (including header).
  *
- * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and
- * up are chipset specific.
+ * This struct is a header for events written back to user-space on the DRM FD.
+ * A read on the DRM FD will always only return complete events: e.g. if the
+ * read buffer is 100 bytes large and there are two 64 byte events pending,
+ * only one will be returned.
+ *
+ * Event types 0 - 0x7fffffff are generic DRM events, 0x80000000 and
+ * up are chipset specific. Generic DRM events include &DRM_EVENT_VBLANK,
+ * &DRM_EVENT_FLIP_COMPLETE and &DRM_EVENT_CRTC_SEQUENCE.
  */
 struct drm_event {
        __u32 type;
        __u32 length;
 };
 
+/**
+ * DRM_EVENT_VBLANK - vertical blanking event
+ *
+ * This event is sent in response to &DRM_IOCTL_WAIT_VBLANK with the
+ * &_DRM_VBLANK_EVENT flag set.
+ *
+ * The event payload is a struct drm_event_vblank.
+ */
 #define DRM_EVENT_VBLANK 0x01
+/**
+ * DRM_EVENT_FLIP_COMPLETE - page-flip completion event
+ *
+ * This event is sent in response to an atomic commit or legacy page-flip with
+ * the &DRM_MODE_PAGE_FLIP_EVENT flag set.
+ *
+ * The event payload is a struct drm_event_vblank.
+ */
 #define DRM_EVENT_FLIP_COMPLETE 0x02
+/**
+ * DRM_EVENT_CRTC_SEQUENCE - CRTC sequence event
+ *
+ * This event is sent in response to &DRM_IOCTL_CRTC_QUEUE_SEQUENCE.
+ *
+ * The event payload is a struct drm_event_crtc_sequence.
+ */
 #define DRM_EVENT_CRTC_SEQUENCE        0x03
 
 struct drm_event_vblank {
diff --git a/include/drm-uapi/drm_mode.h b/include/drm-uapi/drm_mode.h
index 43691058d28..ea1b639bcb2 100644
--- a/include/drm-uapi/drm_mode.h
+++ b/include/drm-uapi/drm_mode.h
@@ -488,6 +488,9 @@ struct drm_mode_get_connector {
         * This is not an object ID. This is a per-type connector number. Each
         * (type, type_id) combination is unique across all connectors of a DRM
         * device.
+        *
+        * The (type, type_id) combination is not a stable identifier: the
+        * type_id can change depending on the driver probe order.
         */
        __u32 connector_type_id;
 
@@ -883,7 +886,7 @@ struct hdr_metadata_infoframe {
         */
        struct {
                __u16 x, y;
-               } display_primaries[3];
+       } display_primaries[3];
        /**
         * @white_point: White Point of Colorspace Data.
         * These are coded as unsigned 16-bit values in units of
@@ -894,7 +897,7 @@ struct hdr_metadata_infoframe {
         */
        struct {
                __u16 x, y;
-               } white_point;
+       } white_point;
        /**
         * @max_display_mastering_luminance: Max Mastering Display Luminance.
         * This value is coded as an unsigned 16-bit value in units of 1 cd/m2,
diff --git a/include/drm-uapi/virtgpu_drm.h b/include/drm-uapi/virtgpu_drm.h
index 7b158fcb02b..b1d0e56565b 100644
--- a/include/drm-uapi/virtgpu_drm.h
+++ b/include/drm-uapi/virtgpu_drm.h
@@ -64,6 +64,16 @@ struct drm_virtgpu_map {
        __u32 pad;
 };
 
+#define VIRTGPU_EXECBUF_SYNCOBJ_RESET          0x01
+#define VIRTGPU_EXECBUF_SYNCOBJ_FLAGS ( \
+               VIRTGPU_EXECBUF_SYNCOBJ_RESET | \
+               0)
+struct drm_virtgpu_execbuffer_syncobj {
+       __u32 handle;
+       __u32 flags;
+       __u64 point;
+};
+
 /* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is 
set. */
 struct drm_virtgpu_execbuffer {
        __u32 flags;
@@ -73,7 +83,11 @@ struct drm_virtgpu_execbuffer {
        __u32 num_bo_handles;
        __s32 fence_fd; /* in/out fence fd (see 
VIRTGPU_EXECBUF_FENCE_FD_IN/OUT) */
        __u32 ring_idx; /* command ring index (see VIRTGPU_EXECBUF_RING_IDX) */
-       __u32 pad;
+       __u32 syncobj_stride; /* size of @drm_virtgpu_execbuffer_syncobj */
+       __u32 num_in_syncobjs;
+       __u32 num_out_syncobjs;
+       __u64 in_syncobjs;
+       __u64 out_syncobjs;
 };
 
 #define VIRTGPU_PARAM_3D_FEATURES 1 /* do we have 3D features in the hw */

Reply via email to