drm: Pass CRTC ID in userspace vblank events
authorAo Xu <ao.xu@amlogic.com>
Mon, 29 Jul 2019 08:35:36 +0000 (16:35 +0800)
committerTao Zeng <tao.zeng@amlogic.com>
Mon, 29 Jul 2019 10:46:57 +0000 (03:46 -0700)
commit37c98ae7785bedbea04266880dc2e24fe2403a7c
treea1cfc33e88e401e8bb57f647130dd09fdd57ece7
parent0b3f192ebf2c35b0d1ed0491d201017a9d8e1898
drm: Pass CRTC ID in userspace vblank events

PD#SWPL-4863

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
Change-Id: Ide7657bdc38563d2de91edc2d649b53262002c39
Signed-off-by: Ao Xu <ao.xu@amlogic.com>
drivers/gpu/drm/drm_ioctl.c
drivers/gpu/drm/drm_irq.c
include/uapi/drm/drm.h