Skip to contentSkip to conversation

Also handle disabled CRTCs in drmmode_clear_pending_flip

PATCH In review Michel Dänzer 2 participants 2 messages Aug 26, 2016 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Also handle disabled CRTCs in drmmode_clear_pending_flip

From: Michel Dänzer <[email protected]>

If disabling a CRTC had to be deferred due to a pending flip in drmmode_crtc_dpms, there may no longer be any outputs associated with the CRTC when we get here. So we have to check for !crtc->enabled and call drmmode_crtc_dpms in that case as well.

Fixes 9090309e057d ("Wait for pending flips to complete before turning

off an output or CRTC")

---
 src/drmmode_display.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
src/drmmode_display.c +5 -3
index cb228da..e474046 100644
@@ -2181,8 +2181,9 @@ drmmode_clear_pending_flip(xf86CrtcPtr crtc)
 
 	drmmode_crtc->flip_pending = FALSE;
 
-	if (drmmode_crtc->pending_dpms_mode != DPMSModeOn &&
-	    drmmode_crtc->dpms_mode != drmmode_crtc->pending_dpms_mode) {
+	if (!crtc->enabled ||
+	    (drmmode_crtc->pending_dpms_mode != DPMSModeOn &&
+	     drmmode_crtc->dpms_mode != drmmode_crtc->pending_dpms_mode)) {
 		xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(crtc->scrn);
 		int o;
 
@@ -2193,8 +2194,9 @@ drmmode_clear_pending_flip(xf86CrtcPtr crtc)
 				continue;
 
 			drmmode_output_dpms(output, drmmode_crtc->pending_dpms_mode);
-			drmmode_crtc_dpms(crtc, drmmode_crtc->pending_dpms_mode);
 		}
+
+		drmmode_crtc_dpms(crtc, drmmode_crtc->pending_dpms_mode);
 	}
 }
 
Signature · 6 lines
2.9.3

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20160826030334.4907-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by Alex Deucher
#2 lore raw
Quoted 15 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Thursday, August 25, 2016 11:04 PM
To: [email protected]
Subject: [PATCH xf86-video-ati] Also handle disabled CRTCs in drmmode_clear_pending_flip

From: Michel Dänzer <[email protected]>

If disabling a CRTC had to be deferred due to a pending flip in drmmode_crtc_dpms, there may no longer be any outputs associated with the CRTC when we get here. So we have to check for !crtc->enabled and call drmmode_crtc_dpms in that case as well.

Quoted 4 lines
Fixes 9090309e057d ("Wait for pending flips to complete before turning

off an output or CRTC")

Quoted 37 lines
---
 src/drmmode_display.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
src/drmmode_display.c +3 -2
index cb228da..e474046 100644
@@ -2181,8 +2181,9 @@ drmmode_clear_pending_flip(xf86CrtcPtr crtc)
 
 	drmmode_crtc->flip_pending = FALSE;
 
-	if (drmmode_crtc->pending_dpms_mode != DPMSModeOn &&
-	    drmmode_crtc->dpms_mode != drmmode_crtc-
 >pending_dpms_mode) {
+	if (!crtc->enabled ||
+	    (drmmode_crtc->pending_dpms_mode != DPMSModeOn &&
+	     drmmode_crtc->dpms_mode != drmmode_crtc-
 >pending_dpms_mode)) {
 		xf86CrtcConfigPtr xf86_config =

XF86_CRTC_CONFIG_PTR(crtc->scrn);

src/drmmode_display.c +2 -1
 		int o;
@@ -2193,8 +2194,9 @@ drmmode_clear_pending_flip(xf86CrtcPtr crtc)
 				continue;
 
 			drmmode_output_dpms(output, drmmode_crtc-
 >pending_dpms_mode);
-			drmmode_crtc_dpms(crtc, drmmode_crtc-
 >pending_dpms_mode);
 		}
+
+		drmmode_crtc_dpms(crtc, drmmode_crtc-
 >pending_dpms_mode);

}
}

Quoted 7 lines

--
2.9.3

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx