Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Stéphane Marchesin and committed by
Dave Airlie
40377ef2 26507b06

+21
+21
drivers/gpu/drm/udl/udl_modeset.c
··· 363 363 kfree(crtc); 364 364 } 365 365 366 + static 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 + 366 386 static void udl_crtc_prepare(struct drm_crtc *crtc) 367 387 { 368 388 } ··· 404 384 static const struct drm_crtc_funcs udl_crtc_funcs = { 405 385 .set_config = drm_crtc_helper_set_config, 406 386 .destroy = udl_crtc_destroy, 387 + .page_flip = udl_crtc_page_flip, 407 388 }; 408 389 409 390 static int udl_crtc_init(struct drm_device *dev)