Skip to contentSkip to conversation

Also call drmmode_clear_pending_flip from radeon_scanout_flip_abort

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

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 Also call drmmode_clear_pending_flip from radeon_scanout_flip_abort

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

Not doing so could break DPMS with TearFree.

Reported-and-Tested-by furkan on IRC
Fixes 9090309e057d ("Wait for pending flips to complete before turning

off an output or CRTC")

---
 src/drmmode_display.c | 2 +-
 src/drmmode_display.h | 1 +
 src/radeon_kms.c      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
src/drmmode_display.c +1 -1
index 14d86c7..96a3c3b 100644
@@ -2174,7 +2174,7 @@ static const xf86CrtcConfigFuncsRec drmmode_xf86crtc_config_funcs = {
 	drmmode_xf86crtc_resize
 };
 
-static void
+void
 drmmode_clear_pending_flip(xf86CrtcPtr crtc)
 {
 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
src/drmmode_display.h +1 -0
index 24e3efb..53c7926 100644
@@ -154,6 +154,7 @@ extern int drmmode_get_crtc_id(xf86CrtcPtr crtc);
 extern int drmmode_get_height_align(ScrnInfoPtr scrn, uint32_t tiling);
 extern int drmmode_get_pitch_align(ScrnInfoPtr scrn, int bpe, uint32_t tiling);
 extern int drmmode_get_base_align(ScrnInfoPtr scrn, int bpe, uint32_t tiling);
+extern void drmmode_clear_pending_flip(xf86CrtcPtr crtc);
 
 Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,
 			uint32_t new_front_handle, uint64_t id, void *data,
src/radeon_kms.c +1 -1
index e353d66..c10fb42 100644
@@ -786,7 +786,7 @@ radeon_scanout_flip_abort(xf86CrtcPtr crtc, void *event_data)
     drmmode_crtc_private_ptr drmmode_crtc = event_data;
 
     drmmode_crtc->scanout_update_pending = FALSE;
-    drmmode_crtc->flip_pending = FALSE;
+    drmmode_clear_pending_flip(crtc);
 }
 
 static void
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): 20160825095813.18762-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

#2 lore raw

PATCH 2/2 Don't override crtc parameter value in drmmode_flip_handler/abort

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

When overriding the crtc parameter value of the last pending CRTC, drmmode_clear_pending_flip would work on the wrong CRTC, and the last pending CRTC's flip_pending flag might never get cleared. This would prevent that CRTC from properly turning off and back on again.

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

off an output or CRTC")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97392

---
 src/drmmode_display.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
src/drmmode_display.c +10 -7
index 96a3c3b..5db968c 100644
@@ -2204,9 +2204,9 @@ drmmode_flip_abort(xf86CrtcPtr crtc, void *event_data)
 	drmmode_flipdata_ptr flipdata = event_data;
 
 	if (--flipdata->flip_count == 0) {
-		if (flipdata->fe_crtc)
-			crtc = flipdata->fe_crtc;
-		flipdata->abort(crtc, flipdata->event_data);
+		if (!flipdata->fe_crtc)
+			flipdata->fe_crtc = crtc;
+		flipdata->abort(flipdata->fe_crtc, flipdata->event_data);
 		free(flipdata);
 	}
 
@@ -2227,11 +2227,14 @@ drmmode_flip_handler(xf86CrtcPtr crtc, uint32_t frame, uint64_t usec, void *even
 	}
 
 	if (--flipdata->flip_count == 0) {
-		/* Deliver cached msc, ust from reference crtc to flip event handler */
+		/* Deliver msc, ust from reference/current crtc to flip event
+		 * handler
+		 */
 		if (flipdata->fe_crtc)
-			crtc = flipdata->fe_crtc;
-		flipdata->handler(crtc, flipdata->fe_frame, flipdata->fe_usec,
-				  flipdata->event_data);
+			flipdata->handler(flipdata->fe_crtc, flipdata->fe_frame,
+					  flipdata->fe_usec, flipdata->event_data);
+		else
+			flipdata->handler(crtc, frame, usec, flipdata->event_data);
 
 		/* Release framebuffer */
 		drmModeRmFB(info->drmmode.fd, flipdata->old_fb_id);
Signature · 6 lines
2.9.3

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Reviewed-by Alex Deucher
#3 lore raw
In reply to a message not in the archive
Quoted 10 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Thursday, August 25, 2016 5:58 AM
To: [email protected]
Subject: [PATCH xf86-video-ati 1/2] Also call drmmode_clear_pending_flip from radeon_scanout_flip_abort

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

Quoted 7 lines

Not doing so could break DPMS with TearFree.

Reported-and-Tested-by furkan on IRC
Fixes 9090309e057d ("Wait for pending flips to complete before turning

off an output or CRTC")

For the series:

Quoted 51 lines
---
 src/drmmode_display.c | 2 +-
 src/drmmode_display.h | 1 +
 src/radeon_kms.c      | 2 +-
 3 files changed, 3 insertions(+), 2 deletions(-)
src/drmmode_display.c +1 -1
index 14d86c7..96a3c3b 100644
@@ -2174,7 +2174,7 @@ static const xf86CrtcConfigFuncsRec
 drmmode_xf86crtc_config_funcs = {
 	drmmode_xf86crtc_resize
 };
 
-static void
+void
 drmmode_clear_pending_flip(xf86CrtcPtr crtc)
 {
src/drmmode_display.c +0 -0
 	drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
src/drmmode_display.h +1 -0
index 24e3efb..53c7926 100644
@@ -154,6 +154,7 @@ extern int drmmode_get_crtc_id(xf86CrtcPtr crtc);
 extern int drmmode_get_height_align(ScrnInfoPtr scrn, uint32_t tiling);
 extern int drmmode_get_pitch_align(ScrnInfoPtr scrn, int bpe, uint32_t
 tiling);
 extern int drmmode_get_base_align(ScrnInfoPtr scrn, int bpe, uint32_t
 tiling);
+extern void drmmode_clear_pending_flip(xf86CrtcPtr crtc);
 

Bool radeon_do_pageflip(ScrnInfoPtr scrn, ClientPtr client,

src/drmmode_display.h +0 -0
 			uint32_t new_front_handle, uint64_t id, void *data,
src/radeon_kms.c +1 -1
index e353d66..c10fb42 100644
@@ -786,7 +786,7 @@ radeon_scanout_flip_abort(xf86CrtcPtr crtc, void
 *event_data)
     drmmode_crtc_private_ptr drmmode_crtc = event_data;
 
     drmmode_crtc->scanout_update_pending = FALSE;
-    drmmode_crtc->flip_pending = FALSE;
+    drmmode_clear_pending_flip(crtc);
 }
 

static void
--
2.9.3

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