modesetting: Implement page flipping support for Present.
Based on code by Keith Packard, Eric Anholt, and Jason Ekstrand. v2: - Fix double free and flip_count underrun (caught by Mario Kleiner). - Don't leak flip_vblank_event on the error_out path (Mario). - Use the updated ms_flush_drm_events API (Mario, Ken). v3: Hack around DPMS shenanigans. If all monitors are DPMS off, then there is no active framebuffer; attempting to pageflip will hit the error_undo paths, causing us to drmModeRmFB with no framebuffer, which confuses the kernel into doing full modesets and generally breaks things. To avoid this, make ms_present_check_flip check that some CRTCs are enabled and DPMS on. This is an ugly hack that would get better with atomic modesetting, or some core Present work. v4: - Don't do pageflipping if CRTCs are rotated (caught by Jason Ekstrand). - Make pageflipping optional (Option "PageFlip" in xorg.conf.d), but enabled by default. v5: Initialize num_crtcs_on to 0 (caught by Michel Dänzer). [airlied: took over] v6: merge async flip support from Mario Kleiner free sequence after failed vblank queue handle unflip while DPMS'ed off (Michel) move flip tracking into its own structure, and fix up reference counting issues, and add comments. Signed-off-by:Dave Airlie <airlied@redhat.com> Acked-by:
Eric Anholt <eric@anholt.net> Signed-off-by:
Kenneth Graunke <kenneth@whitecape.org>
Showing
- hw/xfree86/drivers/modesetting/driver.c 6 additions, 0 deletionshw/xfree86/drivers/modesetting/driver.c
- hw/xfree86/drivers/modesetting/driver.h 6 additions, 0 deletionshw/xfree86/drivers/modesetting/driver.h
- hw/xfree86/drivers/modesetting/drmmode_display.c 41 additions, 2 deletionshw/xfree86/drivers/modesetting/drmmode_display.c
- hw/xfree86/drivers/modesetting/drmmode_display.h 7 additions, 1 deletionhw/xfree86/drivers/modesetting/drmmode_display.h
- hw/xfree86/drivers/modesetting/present.c 425 additions, 4 deletionshw/xfree86/drivers/modesetting/present.c
Loading
Please register or sign in to comment