From 500853086dd5fbfe6d2b3e30923fdc4d8c262cf0 Mon Sep 17 00:00:00 2001 From: Alex Goins Date: Thu, 16 Jun 2016 20:06:53 -0700 Subject: [PATCH] modesetting: Suspend and resume flipping with DPMS DPMS would prevent page flip / vblank events from being raised, freezing the screen until PRIME flipping was reinitialized. To handle DPMS cleanly, suspend PRIME page flipping when DPMS mode is not on, and resume it when DPMS mode is on. v1: Initial commit v2: Moved flipping_active check from previous commit to here v3: Unchanged v4: Unchanged v5: Move flipping_active check to sink support commit v6: Rebase onto ToT v7: Unchanged Reviewed-by: Dave Airlie Signed-off-by: Alex Goins --- .../drivers/modesetting/drmmode_display.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 2915b7801..fb9334834 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -1405,12 +1405,22 @@ drmmode_output_dpms(xf86OutputPtr output, int mode) drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id, drmmode_output->dpms_enum_id, mode); - if (mode == DPMSModeOn && crtc) { + if (crtc) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; - if (drmmode_crtc->need_modeset) - drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, - crtc->x, crtc->y); + + if (mode == DPMSModeOn) { + if (drmmode_crtc->need_modeset) + drmmode_set_mode_major(crtc, &crtc->mode, crtc->rotation, + crtc->x, crtc->y); + + if (drmmode_crtc->enable_flipping) + drmmode_InitSharedPixmapFlipping(crtc, drmmode_crtc->drmmode); + } else { + if (drmmode_crtc->enable_flipping) + drmmode_FiniSharedPixmapFlipping(crtc, drmmode_crtc->drmmode); + } } + return; }