From: Michel Dänzer <michel.daenzer@xxxxxxx> We were incorrectly interpreting the tiling information. Reported-by: Marek Olšák <marek.olsak at amd.com> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com> --- configure.ac | 2 +- src/amdgpu_glamor.c | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index 02e19aac5..ea41f41b3 100644 --- a/configure.ac +++ b/configure.ac @@ -71,7 +71,7 @@ XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto) # Checks for libraries. PKG_CHECK_MODULES(LIBDRM, [libdrm >= 2.4.78]) -PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu >= 2.4.72]) +PKG_CHECK_MODULES(LIBDRM_AMDGPU, [libdrm_amdgpu >= 2.4.76]) PKG_CHECK_MODULES(GBM, [gbm]) # Obtain compiler/linker options for the driver dependencies diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c index 4d9788787..82146a157 100644 --- a/src/amdgpu_glamor.c +++ b/src/amdgpu_glamor.c @@ -323,13 +323,22 @@ amdgpu_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave, void **handle_p) { ScreenPtr screen = pixmap->drawable.pScreen; + AMDGPUInfoPtr info = AMDGPUPTR(xf86ScreenToScrn(screen)); uint64_t tiling_info; CARD16 stride; CARD32 size; + Bool is_linear; int fd; tiling_info = amdgpu_pixmap_get_tiling_info(pixmap); - if (AMDGPU_TILING_GET(tiling_info, ARRAY_MODE) != 0) { + + if (info->family >= AMDGPU_FAMILY_AI) { + is_linear = AMDGPU_TILING_GET(tiling_info, SWIZZLE_MODE) == 0; + } else { + is_linear = AMDGPU_TILING_GET(tiling_info, ARRAY_MODE) == 1; + } + + if (!is_linear) { PixmapPtr linear; /* We don't want to re-allocate the screen pixmap as -- 2.15.1