Headers: Sync drm{,_mode}.h with the kernel
Subsystems (2)
PATCH v3 1/2 Headers: Sync drm{,_mode}.h with the kernel
Generated using make headers_install, based on drm-misc-next commit 5db06a8a98f515f67446a69c57577c4c363ec65d.
This clarifies the comments around modifiers such that they are per-framebuffer rather than per-plane, adds the beginnings of aspect ratio mode flags, link status properties, and updates the 'reserved' field from vblank events to include the CRTC ID.
v2: Split into separate patch, pull in full kernel changes.
v3: Undo revert of connector-type enums, since it is not actually
harmful.
--- include/drm/drm.h | 3 ++- include/drm/drm_mode.h | 45 +++++++++++++++++++++++++++++++-------------- 2 files changed, 33 insertions(+), 15 deletions(-)
include/drm/drm.h +2 -1
@@ -641,6 +641,7 @@ struct drm_gem_open {#define DRM_CAP_CURSOR_HEIGHT 0x9#define DRM_CAP_ADDFB2_MODIFIERS 0x10#define DRM_CAP_PAGE_FLIP_TARGET 0x11 +#define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12/** DRM_IOCTL_GET_CAP ioctl argument type */ struct drm_get_cap {
@@ -845,7 +846,7 @@ struct drm_event_vblank {__u32 tv_sec;__u32 tv_usec;__u32 sequence; -__u32 reserved; +__u32 crtc_id;/* 0 on older kernels that do not support this */ };/* typedef area */
include/drm/drm_mode.h +31 -14
75 lines not on this page · raw message
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v3 2/2 Add CRTC ID to vblank event
From: Ander Conselvan de Oliveira <[email protected]>
When using the atomic API, one request can span multiple CRTCs, however one event is generated per CRTC. As we cannot disambiguate the CRTC with user data (since we only have one piece of user data to pass in), newer kernels can include the CRTC ID in the page flip event.
Add a new vfunc to dispatch vblank events carrying a CRTC ID to clients who negotiate a higher interface version.
[daniels: Rebased, include new cap, call page_flip_handler if it is set
but page_flip_handler2 isn't even on newer contexts, write a commit message.]
v2: Split into separate commit.
--- xf86drm.h | 9 ++++++++- xf86drmMode.c | 24 ++++++++++++++++-------- 2 files changed, 24 insertions(+), 9 deletions(-)
xf86drm.h +8 -1
@@ -728,7 +728,7 @@ extern void drmMsg(const char *format, ...) DRM_PRINTFLIKE(1, 2);extern int drmSetMaster (int fd);extern int drmDropMaster (int fd); -#define DRM_EVENT_CONTEXT_VERSION 2 +#define DRM_EVENT_CONTEXT_VERSION 3 typedef struct _drmEventContext {
@@ -748,6 +748,13 @@ typedef struct _drmEventContext {unsigned int tv_usec, void *user_data); +void (*page_flip_handler2)(int fd, +unsigned int sequence, +unsigned int tv_sec, +unsigned int tv_usec, +unsigned int crtc_id, +void *user_data); + } drmEventContext, *drmEventContextPtr;extern int drmHandleEvent (int fd,drmEventContextPtr evctx);
xf86drmMode.c +16 -8
@@ -889,6 +889,7 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx)int len, i;struct drm_event *e;struct drm_event_vblank *vblank; +void *user_data;/* The DRM read semantics guarantees that we always get only * complete events. */
@@ -915,15 +916,22 @@ int drmHandleEvent(int fd, drmEventContextPtr evctx) U642VOID (vblank->user_data));break ;case DRM_EVENT_FLIP_COMPLETE : -if (evctx->version <2 || - evctx->page_flip_handler ==NULL ) -break ; vblank = (struct drm_event_vblank *) e; - evctx->page_flip_handler (fd, - vblank->sequence, - vblank->tv_sec, - vblank->tv_usec, -U642VOID (vblank->user_data)); + user_data =U642VOID (vblank->user_data); + +if (evctx->version >=3 && evctx->page_flip_handler2) + evctx->page_flip_handler2 (fd, + vblank->sequence, + vblank->tv_sec, + vblank->tv_usec, + vblank->crtc_id, + user_data); +else if (evctx->version >=2 && evctx->page_flip_handler) + evctx->page_flip_handler (fd, + vblank->sequence, + vblank->tv_sec, + vblank->tv_usec, + user_data);break ;default :break ;
Signature · 6 lines
2.11.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Re: [PATCH libdrm v3 1/2] Headers: Sync drm{, _mode}.h with the kernel
In reply to Daniel StoneQuoted 11 lines · Daniel Stone
Generated using make
headers_install, based on drm-misc-next commit5db06a8a98f515f67446a69c57577c4c363ec65d.This clarifies the comments around modifiers such that they are per-framebuffer rather than per-plane, adds the beginnings of aspect ratio mode flags, link status properties, and updates the 'reserved' field from vblank events to include the CRTC ID.
v2: Split into separate patch, pull in full kernel changes.
v3: Undo revert of connector-type enums, since it is not actually
harmful.
Glad to hear, thanks for checking.
-Emil
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel