From a2b32e72fdaff3007a79b84929997d8176c2d512 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 1 Mar 2019 17:42:08 +0100 Subject: [PATCH] present: Don't check tiling parameters with DC & DRM minor version >= 31 Current DC handles any changes of tiling parameters for flips. v2: * Just check all tiling bits if DRM minor < 31 or DC is disabled. Reviewed-by: Nicholas Kazlauskas --- src/amdgpu_present.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/amdgpu_present.c b/src/amdgpu_present.c index ce88bd8..fdedd32 100644 --- a/src/amdgpu_present.c +++ b/src/amdgpu_present.c @@ -278,12 +278,18 @@ amdgpu_present_check_flip(RRCrtcPtr crtc, WindowPtr window, PixmapPtr pixmap, return FALSE; #endif - /* The kernel driver doesn't handle flipping between BOs with different - * tiling parameters correctly yet + /* Only DC supports advanced color management features, so we can use + * drmmode_cm_enabled as a proxy for "Is DC enabled?" */ - if (amdgpu_pixmap_get_tiling_info(pixmap) != - amdgpu_pixmap_get_tiling_info(screen_pixmap)) - return FALSE; + if (info->dri2.pKernelDRMVersion->version_minor < 31 || + !drmmode_cm_enabled(&info->drmmode)) { + /* The kernel driver doesn't handle flipping between BOs with + * different tiling parameters correctly + */ + if (amdgpu_pixmap_get_tiling_info(pixmap) != + amdgpu_pixmap_get_tiling_info(screen_pixmap)) + return FALSE; + } for (i = 0, num_crtcs_on = 0; i < config->num_crtc; i++) { if (drmmode_crtc_can_flip(config->crtc[i]))