FROMLIST: 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)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 11 May 2017 07:38:50 +0000 (15:38 +0800)
commit398e38d802598838fb1227ee0fd8bd2bc1576996
treef52b159b8bf92b59e83950110aad266dc2cced64
parente469f94ad87cef45dda8111525b1bed8081707fc
FROMLIST: 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>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
(am from https://patchwork.kernel.org/patch/9662099/)

Change-Id: Ibe6949782e5df5363d4eaa3e98b3ff413239cf26
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
drivers/gpu/drm/drm_ioctl.c
include/uapi/drm/drm.h