summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Martin <consume.noise@gmail.com>2015-10-29 14:58:09 +0100
committerAdam Jackson <ajax@redhat.com>2015-10-30 10:22:25 -0400
commit2674d424020bd71d4f99b8d8de8b0b21aa490d54 (patch)
tree269849b443798211a7c7070565e12b912ebf448e
parent250666586e2b6f3ed1371340452dc2be2d094d40 (diff)
modesetting: Handle failures in setting a CRTC to a DRM mode properly
This fixes a bug where running the card out of PPLL's when hotplugging another monitor would result in all of the displays going blank and failing to work properly until X was restarted or the user switched to another VT. [Michel Dänzer: Pass errno instead of -ret to strerror()] [Daniel Martin: Add \n to log message] Picked from xf86-video-ati 7186a87 Handle failures in setting a CRTC to a DRM mode properly Signed-off-by: Daniel Martin <consume.noise@gmail.com> Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 736bfc462..f86c1f8cc 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -421,12 +421,13 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
fb_id = drmmode_crtc->rotate_fb_id;
x = y = 0;
}
- ret = drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
- fb_id, x, y, output_ids, output_count, &kmode);
- if (ret)
+ if (drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
+ fb_id, x, y, output_ids, output_count, &kmode)) {
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
- "failed to set mode: %s", strerror(-ret));
- else
+ "failed to set mode: %s\n", strerror(errno));
+ ret = FALSE;
+ goto done;
+ } else
ret = TRUE;
if (crtc->scrn->pScreen)