With the atomic API, it is possible that a single commit affects multiple crtcs. If the user requests an event with that commit, one event will be sent for each CRTC, but it is not possible to distinguish which crtc an event is for in user space. To solve this, the reserved field in struct drm_vblank_event is repurposed to include the crtc_id which the event is for. The DRM_CAP_CRTC_IN_VBLANK_EVENT is added to allow userspace to query if the crtc field will be set properly. [daniels: Rebased, using Maarten's forward-port.]
Showing the changes to include/uapi (1 of 3 files). Show all
Unified · Split
| @@ -647,6 +647,7 @@ struct drm_gem_open { · 646 unmodified lines | |||
| 647 | #define DRM_CAP_CURSOR_HEIGHT 0x9 | 647 | #define DRM_CAP_CURSOR_HEIGHT 0x9 |
| 648 | #define DRM_CAP_ADDFB2_MODIFIERS 0x10 | 648 | #define DRM_CAP_ADDFB2_MODIFIERS 0x10 |
| 649 | #define DRM_CAP_PAGE_FLIP_TARGET 0x11 | 649 | #define DRM_CAP_PAGE_FLIP_TARGET 0x11 |
| 650 | #define DRM_CAP_CRTC_IN_VBLANK_EVENT 0x12 | ||
| 650 | 651 | ||
| 651 | /** DRM_IOCTL_GET_CAP ioctl argument type */ | 652 | /** DRM_IOCTL_GET_CAP ioctl argument type */ |
| 652 | struct drm_get_cap { | 653 | struct drm_get_cap { |
| @@ -851,7 +852,7 @@ struct drm_event_vblank { · 198 unmodified lines | |||
| 851 | __u32 tv_sec; | 852 | __u32 tv_sec; |
| 852 | __u32 tv_usec; | 853 | __u32 tv_usec; |
| 853 | __u32 sequence; | 854 | __u32 sequence; |
| 854 | __u32 reserved; | 855 | __u32 crtc_id; /* 0 on older kernels that do not support this */ |
| 855 | }; | 856 | }; |
| 856 | 857 | ||
| 857 | /* typedef area */ | 858 | /* typedef area */ |