Commit d069ec5d authored by Stephen Chandler Paul's avatar Stephen Chandler Paul Committed by Michel Dänzer

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: default avatarStephen Chandler Paul <>
(ported from radeon commit 7186a8713ba004de4991f21c1a9fc4abc62aeff4)
Reviewed-by: default avatarAlex Deucher <>
parent c8bddcf6
......@@ -699,14 +699,15 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
ret =
drmmode_crtc->mode_crtc->crtc_id, fb_id, x,
y, output_ids, output_count, &kmode);
if (ret)
if (drmModeSetCrtc(pAMDGPUEnt->fd,
fb_id, x, y, output_ids,
output_count, &kmode) != 0) {
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
"failed to set mode: %s", strerror(-ret));
"failed to set mode: %s\n", strerror(errno));
ret = FALSE;
goto done;
} else
ret = TRUE;
if (crtc->scrn->pScreen)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment