Skip to content

Commit c2122b6

Browse files
committed
tools headers UAPI: Update tools's copy of drm.h headers
Picking the changes from: ad9ee11 ("drm/doc: document that PRIME import/export is always supported") 2ff4f6d ("drm/doc: document drm_event and its types") 9a2eabf ("drm/doc: use proper cross-references for sections") c7a4722 ("drm/syncobj: add IOCTL to register an eventfd") Addressing these perf build warnings: Warning: Kernel ABI header differences: diff -u tools/include/uapi/drm/drm.h include/uapi/drm/drm.h Now 'perf trace' and other code that might use the tools/perf/trace/beauty autogenerated tables will be able to translate this new ioctl code into a string: $ tools/perf/trace/beauty/drm_ioctl.sh > before $ cp include/uapi/drm/drm.h tools/include/uapi/drm/drm.h $ tools/perf/trace/beauty/drm_ioctl.sh > after $ diff -u before after --- before 2023-09-13 08:54:45.170134002 -0300 +++ after 2023-09-13 08:55:06.612712776 -0300 @@ -108,6 +108,7 @@ [0xCC] = "SYNCOBJ_TRANSFER", [0xCD] = "SYNCOBJ_TIMELINE_SIGNAL", [0xCE] = "MODE_GETFB2", + [0xCF] = "SYNCOBJ_EVENTFD", [DRM_COMMAND_BASE + 0x00] = "I915_INIT", [DRM_COMMAND_BASE + 0x01] = "I915_FLUSH", [DRM_COMMAND_BASE + 0x02] = "I915_FLIP", $ Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Cc: Simon Ser <[email protected]> Link: https://lore.kernel.org/lkml/ZQGkh9qlhpKA%[email protected]/ Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 15ca354 commit c2122b6

File tree

1 file changed

+69
-15
lines changed
  • tools/include/uapi/drm

1 file changed

+69
-15
lines changed

tools/include/uapi/drm/drm.h

Lines changed: 69 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -673,22 +673,29 @@ struct drm_gem_open {
673673
* Bitfield of supported PRIME sharing capabilities. See &DRM_PRIME_CAP_IMPORT
674674
* and &DRM_PRIME_CAP_EXPORT.
675675
*
676-
* PRIME buffers are exposed as dma-buf file descriptors. See
677-
* Documentation/gpu/drm-mm.rst, section "PRIME Buffer Sharing".
676+
* Starting from kernel version 6.6, both &DRM_PRIME_CAP_IMPORT and
677+
* &DRM_PRIME_CAP_EXPORT are always advertised.
678+
*
679+
* PRIME buffers are exposed as dma-buf file descriptors.
680+
* See :ref:`prime_buffer_sharing`.
678681
*/
679682
#define DRM_CAP_PRIME 0x5
680683
/**
681684
* DRM_PRIME_CAP_IMPORT
682685
*
683686
* If this bit is set in &DRM_CAP_PRIME, the driver supports importing PRIME
684687
* buffers via the &DRM_IOCTL_PRIME_FD_TO_HANDLE ioctl.
688+
*
689+
* Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
685690
*/
686691
#define DRM_PRIME_CAP_IMPORT 0x1
687692
/**
688693
* DRM_PRIME_CAP_EXPORT
689694
*
690695
* If this bit is set in &DRM_CAP_PRIME, the driver supports exporting PRIME
691696
* buffers via the &DRM_IOCTL_PRIME_HANDLE_TO_FD ioctl.
697+
*
698+
* Starting from kernel version 6.6, this bit is always set in &DRM_CAP_PRIME.
692699
*/
693700
#define DRM_PRIME_CAP_EXPORT 0x2
694701
/**
@@ -756,15 +763,14 @@ struct drm_gem_open {
756763
/**
757764
* DRM_CAP_SYNCOBJ
758765
*
759-
* If set to 1, the driver supports sync objects. See
760-
* Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
766+
* If set to 1, the driver supports sync objects. See :ref:`drm_sync_objects`.
761767
*/
762768
#define DRM_CAP_SYNCOBJ 0x13
763769
/**
764770
* DRM_CAP_SYNCOBJ_TIMELINE
765771
*
766772
* If set to 1, the driver supports timeline operations on sync objects. See
767-
* Documentation/gpu/drm-mm.rst, section "DRM Sync Objects".
773+
* :ref:`drm_sync_objects`.
768774
*/
769775
#define DRM_CAP_SYNCOBJ_TIMELINE 0x14
770776

@@ -909,6 +915,27 @@ struct drm_syncobj_timeline_wait {
909915
__u32 pad;
910916
};
911917

918+
/**
919+
* struct drm_syncobj_eventfd
920+
* @handle: syncobj handle.
921+
* @flags: Zero to wait for the point to be signalled, or
922+
* &DRM_SYNCOBJ_WAIT_FLAGS_WAIT_AVAILABLE to wait for a fence to be
923+
* available for the point.
924+
* @point: syncobj timeline point (set to zero for binary syncobjs).
925+
* @fd: Existing eventfd to sent events to.
926+
* @pad: Must be zero.
927+
*
928+
* Register an eventfd to be signalled by a syncobj. The eventfd counter will
929+
* be incremented by one.
930+
*/
931+
struct drm_syncobj_eventfd {
932+
__u32 handle;
933+
__u32 flags;
934+
__u64 point;
935+
__s32 fd;
936+
__u32 pad;
937+
};
938+
912939

913940
struct drm_syncobj_array {
914941
__u64 handles;
@@ -1169,6 +1196,8 @@ extern "C" {
11691196
*/
11701197
#define DRM_IOCTL_MODE_GETFB2 DRM_IOWR(0xCE, struct drm_mode_fb_cmd2)
11711198

1199+
#define DRM_IOCTL_SYNCOBJ_EVENTFD DRM_IOWR(0xCF, struct drm_syncobj_eventfd)
1200+
11721201
/*
11731202
* Device specific ioctls should only be in their respective headers
11741203
* The device specific ioctl range is from 0x40 to 0x9f.
@@ -1180,25 +1209,50 @@ extern "C" {
11801209
#define DRM_COMMAND_BASE 0x40
11811210
#define DRM_COMMAND_END 0xA0
11821211

1183-
/*
1184-
* Header for events written back to userspace on the drm fd. The
1185-
* type defines the type of event, the length specifies the total
1186-
* length of the event (including the header), and user_data is
1187-
* typically a 64 bit value passed with the ioctl that triggered the
1188-
* event. A read on the drm fd will always only return complete
1189-
* events, that is, if for example the read buffer is 100 bytes, and
1190-
* there are two 64 byte events pending, only one will be returned.
1212+
/**
1213+
* struct drm_event - Header for DRM events
1214+
* @type: event type.
1215+
* @length: total number of payload bytes (including header).
11911216
*
1192-
* Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and
1193-
* up are chipset specific.
1217+
* This struct is a header for events written back to user-space on the DRM FD.
1218+
* A read on the DRM FD will always only return complete events: e.g. if the
1219+
* read buffer is 100 bytes large and there are two 64 byte events pending,
1220+
* only one will be returned.
1221+
*
1222+
* Event types 0 - 0x7fffffff are generic DRM events, 0x80000000 and
1223+
* up are chipset specific. Generic DRM events include &DRM_EVENT_VBLANK,
1224+
* &DRM_EVENT_FLIP_COMPLETE and &DRM_EVENT_CRTC_SEQUENCE.
11941225
*/
11951226
struct drm_event {
11961227
__u32 type;
11971228
__u32 length;
11981229
};
11991230

1231+
/**
1232+
* DRM_EVENT_VBLANK - vertical blanking event
1233+
*
1234+
* This event is sent in response to &DRM_IOCTL_WAIT_VBLANK with the
1235+
* &_DRM_VBLANK_EVENT flag set.
1236+
*
1237+
* The event payload is a struct drm_event_vblank.
1238+
*/
12001239
#define DRM_EVENT_VBLANK 0x01
1240+
/**
1241+
* DRM_EVENT_FLIP_COMPLETE - page-flip completion event
1242+
*
1243+
* This event is sent in response to an atomic commit or legacy page-flip with
1244+
* the &DRM_MODE_PAGE_FLIP_EVENT flag set.
1245+
*
1246+
* The event payload is a struct drm_event_vblank.
1247+
*/
12011248
#define DRM_EVENT_FLIP_COMPLETE 0x02
1249+
/**
1250+
* DRM_EVENT_CRTC_SEQUENCE - CRTC sequence event
1251+
*
1252+
* This event is sent in response to &DRM_IOCTL_CRTC_QUEUE_SEQUENCE.
1253+
*
1254+
* The event payload is a struct drm_event_crtc_sequence.
1255+
*/
12021256
#define DRM_EVENT_CRTC_SEQUENCE 0x03
12031257

12041258
struct drm_event_vblank {

0 commit comments

Comments
 (0)