aboutsummaryrefslogtreecommitdiffstats
path: root/include/drm/drm_crtc.h
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2009-11-17 12:43:55 -0500
committerDave Airlie <airlied@redhat.com>2009-11-17 19:05:47 -0500
commitd91d8a3f88059d93e34ac70d059153ec69a9ffc7 (patch)
tree13810c8dbc35522d930b5fc17db35570f3d1e821 /include/drm/drm_crtc.h
parentdad07ca71719598bc990dbdbeda763d15a10e98b (diff)
drm/kms: add page flipping ioctl
This adds a page flipping ioctl to the KMS API. The ioctl takes an fb ID and a ctrc ID and flips the crtc to the given fb at the next vblank. The ioctl returns immediately but the flip doesn't happen until after any rendering that's currently queued up against the new framebuffer is done. After submitting a page flip, any execbuffer involving the old front buffer will block until the flip is completed. Optionally, a vblank event can be generated when the swap eventually happens. Signed-off-by: Kristian Høgsberg <krh@bitplanet.net> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'include/drm/drm_crtc.h')
-rw-r--r--include/drm/drm_crtc.h16
1 files changed, 16 insertions, 0 deletions
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index b69347b8904f..4cc8a32dc4cf 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -290,6 +290,7 @@ struct drm_property {
290struct drm_crtc; 290struct drm_crtc;
291struct drm_connector; 291struct drm_connector;
292struct drm_encoder; 292struct drm_encoder;
293struct drm_pending_vblank_event;
293 294
294/** 295/**
295 * drm_crtc_funcs - control CRTCs for a given device 296 * drm_crtc_funcs - control CRTCs for a given device
@@ -333,6 +334,19 @@ struct drm_crtc_funcs {
333 void (*destroy)(struct drm_crtc *crtc); 334 void (*destroy)(struct drm_crtc *crtc);
334 335
335 int (*set_config)(struct drm_mode_set *set); 336 int (*set_config)(struct drm_mode_set *set);
337
338 /*
339 * Flip to the given framebuffer. This implements the page
340 * flip ioctl descibed in drm_mode.h, specifically, the
341 * implementation must return immediately and block all
342 * rendering to the current fb until the flip has completed.
343 * If userspace set the event flag in the ioctl, the event
344 * argument will point to an event to send back when the flip
345 * completes, otherwise it will be NULL.
346 */
347 int (*page_flip)(struct drm_crtc *crtc,
348 struct drm_framebuffer *fb,
349 struct drm_pending_vblank_event *event);
336}; 350};
337 351
338/** 352/**
@@ -756,6 +770,8 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev,
756extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, 770extern int drm_mode_gamma_set_ioctl(struct drm_device *dev,
757 void *data, struct drm_file *file_priv); 771 void *data, struct drm_file *file_priv);
758extern bool drm_detect_hdmi_monitor(struct edid *edid); 772extern bool drm_detect_hdmi_monitor(struct edid *edid);
773extern int drm_mode_page_flip_ioctl(struct drm_device *dev,
774 void *data, struct drm_file *file_priv);
759extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, 775extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev,
760 int hdisplay, int vdisplay, int vrefresh, 776 int hdisplay, int vdisplay, int vrefresh,
761 bool reduced, bool interlaced, bool margins); 777 bool reduced, bool interlaced, bool margins);