Skip to contentSkip to conversation

Set drmmode_crtc->scanout_id = 0 when TearFree is disabled

PATCH In review Michel Dänzer 2 participants 2 messages Apr 24, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Set drmmode_crtc->scanout_id = 0 when TearFree is disabled

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

When disabling TearFree, drmmode_crtc->scanout_id could remain as 1, but drmmode_set_mode_major would destroy drmmode_crtc->scanout[1], so scanout_do_update() would keep bailing, and the scanout buffer would stop being updated.

Fixes freeze after disabling TearFree on a CRTC with active RandR rotation or other transform.

---
 src/drmmode_display.c | 2 ++
 1 file changed, 2 insertions(+)
src/drmmode_display.c +2 -0
index 536890d18..793027d50 100644
@@ -846,6 +846,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 		drmmode_crtc_update_tear_free(crtc);
 		if (drmmode_crtc->tear_free)
 			scanout_id = drmmode_crtc->scanout_id;
+		else
+			drmmode_crtc->scanout_id = 0;
 
 		/* gamma is disabled in kernel driver for deep color */
 		if (pScrn->depth != 30)
Signature · 6 lines
2.17.0

_______________________________________________
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): 20180424165852.10288-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by
#2 lore raw
Quoted 11 lines · Michel Dänzer

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

When disabling TearFree, drmmode_crtc->scanout_id could remain as 1, but drmmode_set_mode_major would destroy drmmode_crtc->scanout[1], so scanout_do_update() would keep bailing, and the scanout buffer would stop being updated.

Fixes freeze after disabling TearFree on a CRTC with active RandR rotation or other transform.

Quoted 20 lines
---
 src/drmmode_display.c | 2 ++
 1 file changed, 2 insertions(+)
src/drmmode_display.c +2 -1
index 536890d18..793027d50 100644
@@ -846,6 +846,8 @@ drmmode_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
                drmmode_crtc_update_tear_free(crtc);
                if (drmmode_crtc->tear_free)
                        scanout_id = drmmode_crtc->scanout_id;
+               else
+                       drmmode_crtc->scanout_id = 0;
 
                /* gamma is disabled in kernel driver for deep color */
                if (pScrn->depth != 30)
--

2.17.0

Quoted 4 lines

_______________________________________________
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