Skip to contentSkip to conversation

Fix linear check in amdgpu_glamor_share_pixmap_backing

PATCH In review Michel Dänzer 3 participants 3 messages Jan 22, 2018 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix linear check in amdgpu_glamor_share_pixmap_backing

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

We were incorrectly interpreting the tiling information.

---
 configure.ac        |  2 +-
 src/amdgpu_glamor.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
configure.ac +1 -1
index 02e19aac5..ea41f41b3 100644
@@ -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
src/amdgpu_glamor.c +10 -1
index 4d9788787..82146a157 100644
@@ -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
Signature · 6 lines
2.15.1

_______________________________________________
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): 20180122173613.18988-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Acked-by
#2 lore raw
Quoted 6 lines · Michel Dänzer

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

We were incorrectly interpreting the tiling information.

Quoted 49 lines
---
 configure.ac        |  2 +-
 src/amdgpu_glamor.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
configure.ac +1 -1
index 02e19aac5..ea41f41b3 100644
@@ -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
src/amdgpu_glamor.c +10 -2
index 4d9788787..82146a157 100644
@@ -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

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

Reviewed-by
#3 lore raw
In reply to a message not in the archive

Marek

Quoted 55 lines · Michel Dänzer

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

We were incorrectly interpreting the tiling information.

---
 configure.ac        |  2 +-
 src/amdgpu_glamor.c | 11 ++++++++++-
 2 files changed, 11 insertions(+), 2 deletions(-)
configure.ac +1 -1
index 02e19aac5..ea41f41b3 100644
@@ -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
src/amdgpu_glamor.c +10 -2
index 4d9788787..82146a157 100644
@@ -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

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