summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2015-04-28 17:14:11 +0900
committerMichel Dänzer <michel@daenzer.net>2015-04-28 17:14:11 +0900
commit1584dc545c78e0bce8d4b4b9f26b568e2c211453 (patch)
treeb8223c9d4bc11833b0d81a9cfc06e8e194ca98f0 /src
parent340baf3804b7d9de8082badfc715a9bee7856e8f (diff)
Skip disabled CRTCs in drmmode_set_desired_modes() even if set_hw == FALSE
Not skipping a disabled CRTC results in a crash. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90187 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-rw-r--r--src/drmmode_display.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 06d1ec06..c12bf513 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2145,10 +2145,13 @@ Bool drmmode_set_desired_modes(ScrnInfoPtr pScrn, drmmode_ptr drmmode,
int o;
/* Skip disabled CRTCs */
- if (set_hw && !crtc->enabled) {
- drmmode_do_crtc_dpms(crtc, DPMSModeOff);
- drmModeSetCrtc(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id,
- 0, 0, 0, NULL, 0, NULL);
+ if (!crtc->enabled) {
+ if (set_hw) {
+ drmmode_do_crtc_dpms(crtc, DPMSModeOff);
+ drmModeSetCrtc(drmmode->fd,
+ drmmode_crtc->mode_crtc->crtc_id,
+ 0, 0, 0, NULL, 0, NULL);
+ }
continue;
}