diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2015-01-26 21:29:23 -0800 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2015-06-30 13:44:09 +1000 |
commit | 13c7d53df8dac45ea2a685826cd45a39bcb51657 (patch) | |
tree | e2e31eae2849f7c2bc36f2169dc802ba9b1f4203 /hw/xfree86/drivers/modesetting/drmmode_display.h | |
parent | 4342369e843ca2c6ca0a8c42475893cffb077a54 (diff) |
modesetting: Implement page flipping support for Present.for-keithp
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>
Diffstat (limited to 'hw/xfree86/drivers/modesetting/drmmode_display.h')
-rw-r--r-- | hw/xfree86/drivers/modesetting/drmmode_display.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h index 85a0ec435..fe363c577 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.h +++ b/hw/xfree86/drivers/modesetting/drmmode_display.h @@ -46,7 +46,6 @@ typedef struct { typedef struct { int fd; unsigned fb_id; - unsigned old_fb_id; drmModeFBPtr mode_fb; int cpp; ScrnInfoPtr scrn; @@ -63,6 +62,8 @@ typedef struct { Bool glamor; Bool shadow_enable; + /** Is Option "PageFlip" enabled? */ + Bool pageflip; void *shadow_fb; /** @@ -107,6 +108,8 @@ typedef struct { uint32_t msc_prev; uint64_t msc_high; /** @} */ + + Bool need_modeset; } drmmode_crtc_private_rec, *drmmode_crtc_private_ptr; typedef struct { @@ -141,6 +144,9 @@ extern DevPrivateKeyRec msPixmapPrivateKeyRec; #define msGetPixmapPriv(drmmode, p) ((msPixmapPrivPtr)dixGetPrivateAddr(&(p)->devPrivates, &(drmmode)->pixmapPrivateKeyRec)) +Bool drmmode_bo_for_pixmap(drmmode_ptr drmmode, drmmode_bo *bo, PixmapPtr pixmap); +int drmmode_bo_destroy(drmmode_ptr drmmode, drmmode_bo *bo); +uint32_t drmmode_bo_get_pitch(drmmode_bo *bo); uint32_t drmmode_bo_get_handle(drmmode_bo *bo); Bool drmmode_glamor_handle_new_screen_pixmap(drmmode_ptr drmmode); void *drmmode_map_slave_bo(drmmode_ptr drmmode, msPixmapPrivPtr ppriv); |