summaryrefslogtreecommitdiff
path: root/src/drmmode_display.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-05-01 18:54:16 +0900
committerMichel Dänzer <michel@daenzer.net>2015-07-08 17:26:29 +0900
commit802d33e474a82262d9cdf11b03568b0c4929cd0d (patch)
tree6569ee17840a6c16c37783c1f66615785415a4c6 /src/drmmode_display.c
parenta8ed62010d5012dfb27773595c446b217f3c00c5 (diff)
present: Fall back to modeset for unflip operation
It's not always possible to use the page flip ioctl for this, e.g. during DPMS off. We were previously just skipping the unflip in that case, which could result in hangs when setting DPMS off while a fullscreen Present app is running, e.g. at the GNOME3 lock screen. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/drmmode_display.c')
-rw-r--r--src/drmmode_display.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 84839091..ad2f48b6 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -769,6 +769,9 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
if (crtc->scrn->pScreen)
xf86CrtcSetScreenSubpixelOrder(crtc->scrn->pScreen);
+
+ drmmode_crtc->need_modeset = FALSE;
+
/* go through all the outputs and force DPMS them back on? */
for (i = 0; i < xf86_config->num_output; i++) {
xf86OutputPtr output = xf86_config->output[i];
@@ -1153,20 +1156,28 @@ static void
drmmode_output_dpms(xf86OutputPtr output, int mode)
{
drmmode_output_private_ptr drmmode_output = output->driver_private;
+ xf86CrtcPtr crtc = output->crtc;
drmModeConnectorPtr koutput = drmmode_output->mode_output;
drmmode_ptr drmmode = drmmode_output->drmmode;
if (!koutput)
return;
- if (mode != DPMSModeOn && output->crtc)
- drmmode_do_crtc_dpms(output->crtc, mode);
+ if (mode != DPMSModeOn && crtc)
+ drmmode_do_crtc_dpms(crtc, mode);
drmModeConnectorSetProperty(drmmode->fd, koutput->connector_id,
drmmode_output->dpms_enum_id, mode);
- if (mode == DPMSModeOn && output->crtc)
- drmmode_do_crtc_dpms(output->crtc, mode);
+ if (mode == DPMSModeOn && 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);
+ else
+ drmmode_do_crtc_dpms(crtc, mode);
+ }
}