aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/udl
diff options
context:
space:
mode:
authorStéphane Marchesin <marcheu@chromium.org>2014-07-02 18:13:43 -0400
committerDave Airlie <airlied@redhat.com>2014-07-07 21:37:28 -0400
commit40377ef2d9a3ddc8ba4aee11393fb207e82111e1 (patch)
treea0d2cdd522839f8834618b8925b766bd8019a726 /drivers/gpu/drm/udl
parent26507b065b503ac1b5ba702161c2084190fc0c9f (diff)
drm/udl: Implement page_flip ioctl
This is a very crude page_flip implementation for UDL. There are ways to make it better (make it asynchronous, make it do actual vsynced flips...) but that's for another patch. [airlied: fixup primary change] Signed-off-by: Stéphane Marchesin <marcheu@chromium.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/udl')
-rw-r--r--drivers/gpu/drm/udl/udl_modeset.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/udl/udl_modeset.c b/drivers/gpu/drm/udl/udl_modeset.c
index cddc4fcf35cf..dc145d320b25 100644
--- a/drivers/gpu/drm/udl/udl_modeset.c
+++ b/drivers/gpu/drm/udl/udl_modeset.c
@@ -363,6 +363,26 @@ static void udl_crtc_destroy(struct drm_crtc *crtc)
363 kfree(crtc); 363 kfree(crtc);
364} 364}
365 365
366static int udl_crtc_page_flip(struct drm_crtc *crtc,
367 struct drm_framebuffer *fb,
368 struct drm_pending_vblank_event *event,
369 uint32_t page_flip_flags)
370{
371 struct udl_framebuffer *ufb = to_udl_fb(fb);
372 struct drm_device *dev = crtc->dev;
373 unsigned long flags;
374
375 udl_handle_damage(ufb, 0, 0, fb->width, fb->height);
376
377 spin_lock_irqsave(&dev->event_lock, flags);
378 if (event)
379 drm_send_vblank_event(dev, 0, event);
380 spin_unlock_irqrestore(&dev->event_lock, flags);
381 crtc->primary->fb = fb;
382
383 return 0;
384}
385
366static void udl_crtc_prepare(struct drm_crtc *crtc) 386static void udl_crtc_prepare(struct drm_crtc *crtc)
367{ 387{
368} 388}
@@ -384,6 +404,7 @@ static struct drm_crtc_helper_funcs udl_helper_funcs = {
384static const struct drm_crtc_funcs udl_crtc_funcs = { 404static const struct drm_crtc_funcs udl_crtc_funcs = {
385 .set_config = drm_crtc_helper_set_config, 405 .set_config = drm_crtc_helper_set_config,
386 .destroy = udl_crtc_destroy, 406 .destroy = udl_crtc_destroy,
407 .page_flip = udl_crtc_page_flip,
387}; 408};
388 409
389static int udl_crtc_init(struct drm_device *dev) 410static int udl_crtc_init(struct drm_device *dev)