diff options
author | Stephen Chandler Paul <cpaul@redhat.com> | 2015-10-23 09:59:36 -0400 |
---|---|---|
committer | Michel Dänzer <michel.daenzer@amd.com> | 2015-10-26 18:35:27 +0900 |
commit | 7186a8713ba004de4991f21c1a9fc4abc62aeff4 (patch) | |
tree | 70cf30a43fc63f138bc0b12059e11aa1ab044f81 | |
parent | 548e97b3b7d1e94075a54ca2bb4eb683025098a7 (diff) |
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()]
Signed-off-by: Stephen Chandler Paul <cpaul@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
-rw-r--r-- | src/drmmode_display.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 64e79d45..3a3f407e 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -760,12 +760,15 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, radeon_bo_wait(drmmode_crtc->scanout[0].bo); } } - 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) != 0) { xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR, - "failed to set mode: %s", strerror(-ret)); - else + "failed to set mode: %s", strerror(errno)); + ret = FALSE; + goto done; + } else ret = TRUE; if (crtc->scrn->pScreen) |