Skip to content

Commit 2ff4f6d

Browse files
committed
drm/doc: document drm_event and its types
Convert struct drm_event to a kernel doc comment. Link to the generic DRM event types. Add a basic description of each event type. Signed-off-by: Simon Ser <[email protected]> Acked-by: Pekka Paalanen <[email protected]> Acked-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent f1bfcad commit 2ff4f6d

File tree

1 file changed

+35
-10
lines changed

1 file changed

+35
-10
lines changed

include/uapi/drm/drm.h

Lines changed: 35 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1202,25 +1202,50 @@ extern "C" {
12021202
#define DRM_COMMAND_BASE 0x40
12031203
#define DRM_COMMAND_END 0xA0
12041204

1205-
/*
1206-
* Header for events written back to userspace on the drm fd. The
1207-
* type defines the type of event, the length specifies the total
1208-
* length of the event (including the header), and user_data is
1209-
* typically a 64 bit value passed with the ioctl that triggered the
1210-
* event. A read on the drm fd will always only return complete
1211-
* events, that is, if for example the read buffer is 100 bytes, and
1212-
* there are two 64 byte events pending, only one will be returned.
1205+
/**
1206+
* struct drm_event - Header for DRM events
1207+
* @type: event type.
1208+
* @length: total number of payload bytes (including header).
12131209
*
1214-
* Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and
1215-
* up are chipset specific.
1210+
* This struct is a header for events written back to user-space on the DRM FD.
1211+
* A read on the DRM FD will always only return complete events: e.g. if the
1212+
* read buffer is 100 bytes large and there are two 64 byte events pending,
1213+
* only one will be returned.
1214+
*
1215+
* Event types 0 - 0x7fffffff are generic DRM events, 0x80000000 and
1216+
* up are chipset specific. Generic DRM events include &DRM_EVENT_VBLANK,
1217+
* &DRM_EVENT_FLIP_COMPLETE and &DRM_EVENT_CRTC_SEQUENCE.
12161218
*/
12171219
struct drm_event {
12181220
__u32 type;
12191221
__u32 length;
12201222
};
12211223

1224+
/**
1225+
* DRM_EVENT_VBLANK - vertical blanking event
1226+
*
1227+
* This event is sent in response to &DRM_IOCTL_WAIT_VBLANK with the
1228+
* &_DRM_VBLANK_EVENT flag set.
1229+
*
1230+
* The event payload is a struct drm_event_vblank.
1231+
*/
12221232
#define DRM_EVENT_VBLANK 0x01
1233+
/**
1234+
* DRM_EVENT_FLIP_COMPLETE - page-flip completion event
1235+
*
1236+
* This event is sent in response to an atomic commit or legacy page-flip with
1237+
* the &DRM_MODE_PAGE_FLIP_EVENT flag set.
1238+
*
1239+
* The event payload is a struct drm_event_vblank.
1240+
*/
12231241
#define DRM_EVENT_FLIP_COMPLETE 0x02
1242+
/**
1243+
* DRM_EVENT_CRTC_SEQUENCE - CRTC sequence event
1244+
*
1245+
* This event is sent in response to &DRM_IOCTL_CRTC_QUEUE_SEQUENCE.
1246+
*
1247+
* The event payload is a struct drm_event_crtc_sequence.
1248+
*/
12241249
#define DRM_EVENT_CRTC_SEQUENCE 0x03
12251250

12261251
struct drm_event_vblank {

0 commit comments

Comments
 (0)