Skip to content
  • Kenneth Graunke's avatar
    modesetting: Implement page flipping support for Present. · 13c7d53d
    Kenneth Graunke authored
    
    
    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: default avatarDave Airlie <airlied@redhat.com>
    Acked-by: default avatarEric Anholt <eric@anholt.net>
    Signed-off-by: Kenneth Graunke's avatarKenneth Graunke <kenneth@whitecape.org>
    13c7d53d