drm: Pass CRTC ID in userspace vblank events
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Tue, 4 Apr 2017 16:52:21 +0000 (17:52 +0100)
committerNitin Garg <nitin.garg@nxp.com>
Tue, 20 Mar 2018 19:52:19 +0000 (14:52 -0500)
commite7a5426b6891e7827e64bac5203ba85e8fc15254
treed2e72d7da7de8275cf03ad2e884810e55d2450dd
parentd48ce126f189d29b127f5410b3cd17c82a8cc2c1
drm: Pass CRTC ID in userspace vblank events

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.]

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
Signed-off-by: Daniel Stone <daniels@collabora.com>
Cc: Maarten Lankhorst <maarten.lankhorst@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170404165221.28240-2-daniels@collabora.com
drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_irq.c
include/uapi/drm/drm.h