#3 Fix corruption with latest xserver
Closed 2 months ago by ofourdan. Opened 2 months ago by ofourdan.
rpms/ ofourdan/xorg-x11-drv-amdgpu f30  into  f30

@@ -0,0 +1,55 @@ 

+ From 4b17533fcb30842caf0035ba593b7d986520cc85 Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Michel=20D=C3=A4nzer?= <michel.daenzer@amd.com>

+ Date: Tue, 30 Apr 2019 17:50:15 +0200

+ Subject: [PATCH] dri3: Always flush glamor before sharing pixmap storage with

+  clients

+ 

+ Even if glamor_gbm_bo_from_pixmap / glamor_fd_from_pixmap themselves

+ don't trigger any drawing, there could already be unflushed drawing to

+ the pixmap whose storage we share with a client.

+ ---

+  src/amdgpu_dri3.c | 26 +++++---------------------

+  1 file changed, 5 insertions(+), 21 deletions(-)

+ 

+ diff --git a/src/amdgpu_dri3.c b/src/amdgpu_dri3.c

+ index 7f1745e..ed1e2f9 100644

+ --- a/src/amdgpu_dri3.c

+ +++ b/src/amdgpu_dri3.c

+ @@ -221,29 +221,13 @@ static int amdgpu_dri3_fd_from_pixmap(ScreenPtr screen,

+  	AMDGPUInfoPtr info = AMDGPUPTR(scrn);

+  

+  	if (info->use_glamor) {

+ -		Bool need_flush = TRUE;

+ -		int ret = -1;

+ -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,19,99,904,0)

+ -		struct gbm_bo *gbm_bo = glamor_gbm_bo_from_pixmap(screen, pixmap);

+ +		int ret = glamor_fd_from_pixmap(screen, pixmap, stride, size);

+  

+ -		if (gbm_bo) {

+ -			ret = gbm_bo_get_fd(gbm_bo);

+ -			gbm_bo_destroy(gbm_bo);

+ -

+ -			if (ret >= 0)

+ -				need_flush = FALSE;

+ -		}

+ -#endif

+ -

+ -		if (ret < 0)

+ -			ret = glamor_fd_from_pixmap(screen, pixmap, stride, size);

+ -

+ -		/* glamor might have needed to reallocate the pixmap storage and

+ -		 * copy the pixmap contents to the new storage. The copy

+ -		 * operation needs to be flushed to the kernel driver before the

+ -		 * client starts using the pixmap storage for direct rendering.

+ +		/* Any pending drawing operations need to be flushed to the

+ +		 * kernel driver before the client starts using the pixmap

+ +		 * storage for direct rendering.

+  		 */

+ -		if (ret >= 0 && need_flush)

+ +		if (ret >= 0)

+  			amdgpu_glamor_flush(scrn);

+  

+  		return ret;

+ -- 

+ 2.21.0

+ 

file modified
+7 -2

@@ -7,7 +7,7 @@ 

  

  Name:		xorg-x11-drv-amdgpu

  Version:	19.0.1

- Release:	1%{?dist}

+ Release:	2%{?dist}

  

  Summary:	AMD GPU video driver

  License:	MIT

@@ -15,6 +15,8 @@ 

  URL:		https://www.x.org/wiki

  Source:		https://www.x.org/archive/individual/driver/%{tarball}-%{version}.tar.bz2

  

+ Patch1:		0001-dri3-Always-flush-glamor-before-sharing-pixmap-stora.patch

+ 

  ExcludeArch:	s390 s390x

  

  BuildRequires: python2

@@ -36,7 +38,7 @@ 

  X.Org X11 AMDGPU driver

  

  %prep

- %autosetup -n %{tarball}-%{version}

+ %autosetup -S git -n %{tarball}-%{version}

  

  %build

  #autoreconf -fiv

@@ -55,6 +57,9 @@ 

  %{_mandir}/man4/amdgpu.4*

  

  %changelog

+ * Mon Jul  8 2019 Olivier Fourdan <ofourdan@redhat.com> - 19.0.1-2

+ - Fix corruption with latest xserver

+ 

  * Thu Apr 18 2019 Christopher Atherton <the8lack8ox@gmail.com> - 19.0.1-1

  - Update to 19.0.1