[PATCH xf86-video-amdgpu] Allow changing DCC parameters between flips

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Marek Olšák <marek.olsak@xxxxxxx>

---
 src/amdgpu_present.c | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c
index ce88bd8f..f4fc6ebd 100644
--- a/src/amdgpu_present.c
+++ b/src/amdgpu_present.c
@@ -271,26 +271,34 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap,
 		return FALSE;
 
 	if (info->drmmode.dri2_flipping)
 		return FALSE;
 
 #if XORG_VERSION_CURRENT <= XORG_VERSION_NUMERIC(1, 20, 99, 1, 0)
 	if (pixmap->devKind != screen_pixmap->devKind)
 		return FALSE;
 #endif
 
+	uint64_t tiling_info1 = amdgpu_pixmap_get_tiling_info(pixmap);
+	uint64_t tiling_info2 = amdgpu_pixmap_get_tiling_info(screen_pixmap);
+
 	/* The kernel driver doesn't handle flipping between BOs with different
-	 * tiling parameters correctly yet
+	 * tiling parameters correctly yet except DCC.
 	 */
-	if (amdgpu_pixmap_get_tiling_info(pixmap) !=
-	    amdgpu_pixmap_get_tiling_info(screen_pixmap))
-		return FALSE;
+	if (info->family >= AMDGPU_FAMILY_AI) {
+		if (AMDGPU_TILING_GET(tiling_info1, SWIZZLE_MODE) !=
+		    AMDGPU_TILING_GET(tiling_info2, SWIZZLE_MODE))
+			return FALSE;
+	} else {
+		if (tiling_info1 != tiling_info2)
+			return FALSE;
+	}
 
 	for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) {
 		if (drmmode_crtc_can_flip(config->crtc[i]))
 			num_crtcs_on++;
 		else if (config->crtc[i] == crtc->devPrivate)
 			return FALSE;
 	}
 
 	if (num_crtcs_on == 0)
 		return FALSE;
-- 
2.17.1

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux