summaryrefslogtreecommitdiff
path: root/include/drm/drm_vblank.h
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-07-06 00:34:23 +0300
committerDave Airlie <airlied@redhat.com>2017-10-21 00:23:40 +0300
commitbd386e51805632abed4a0873a84af35f0c6461e3 (patch)
tree5c31397e1799da9a3ef5af1eeb562e47a212a23f /include/drm/drm_vblank.h
parent570e86963a511c1b404e81c72d2c42169faf9324 (diff)
downloadlinux-bd386e51805632abed4a0873a84af35f0c6461e3.tar.xz
drm: Reorganize drm_pending_event to support future event types [v2]
Place drm_event_vblank in a new union that includes that and a bare drm_event structure. This will allow new members of that union to be added in the future without changing code related to the existing vbl event type. Assignments to the crtc_id field are now done when the event is allocated, rather than when delievered. This way, delivery doesn't need to have the crtc ID available. v2: * Remove 'dev' argument from create_vblank_event It wasn't being used anyways, and if we need it in the future, we can always get it from crtc->dev. * Check for MODESETTING before looking for crtc in queue_vblank_event UMS drivers will oops if we try to get a crtc, so make sure we're modesetting before we try to find a crtc_id to fill into the event. Signed-off-by: Keith Packard <keithp@keithp.com> Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit dc695b85fde88eca3ef3b03fcd82f15b6bc6e462)
Diffstat (limited to 'include/drm/drm_vblank.h')
-rw-r--r--include/drm/drm_vblank.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/drm/drm_vblank.h b/include/drm/drm_vblank.h
index cce53130510f..bf8e07035a0a 100644
--- a/include/drm/drm_vblank.h
+++ b/include/drm/drm_vblank.h
@@ -54,7 +54,10 @@ struct drm_pending_vblank_event {
/**
* @event: Actual event which will be sent to userspace.
*/
- struct drm_event_vblank event;
+ union {
+ struct drm_event base;
+ struct drm_event_vblank vbl;
+ } event;
};
/**
@@ -163,6 +166,9 @@ void drm_crtc_send_vblank_event(struct drm_crtc *crtc,
struct drm_pending_vblank_event *e);
void drm_crtc_arm_vblank_event(struct drm_crtc *crtc,
struct drm_pending_vblank_event *e);
+void drm_vblank_set_event(struct drm_pending_vblank_event *e,
+ u64 *seq,
+ ktime_t *now);
bool drm_handle_vblank(struct drm_device *dev, unsigned int pipe);
bool drm_crtc_handle_vblank(struct drm_crtc *crtc);
int drm_crtc_vblank_get(struct drm_crtc *crtc);