Allow changing DCC parameters between flips

Submitted by Marek Olšák on Feb. 28, 2019, 10:40 p.m.

Details

Message ID 20190228224026.13609-1-maraeo@gmail.com
State New
Headers show
Series "Allow changing DCC parameters between flips" ( rev: 1 ) in AMD X.Org drivers

Not browsing as part of any series.

Commit Message

Marek Olšák Feb. 28, 2019, 10:40 p.m.
From: Marek Olšák <marek.olsak@amd.com>

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

Patch hide | download patch | download mbox

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;

Comments

Thanks Marek for the patch, but xf86-video-amdgpu patches are being
reviewed as GitLab merge requests since the last release[0].

I'll create a merge request with this patch and some follow-up changes.


[0] Isn't README.md clear enough on this?

On 2019-04-02 8:13 p.m., Marek Olšák wrote:
> As you probably noticed, I don't use gitlab for my own patches yet.

It's not optional for xf86-video-amdgpu.


Per
https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/merge_requests/30#note_125584
, I ended up not using this patch, instead only allowing the DCC
parameters to change with DRM minor version >= 31 as well. Thanks for
this patch anyway!