[PATCH xf86-video-ati 2/7] dri2: Flush in dri2_create_buffer2 after calling glamor_set_pixmap_bo

Michel Dänzer michel at daenzer.net
Mon Jan 28 17:34:15 UTC 2019


From: Michel Dänzer <michel.daenzer at amd.com>

To make sure the client can't use the shared pixmap storage for direct
rendering first, which could produce garbage.

Bugzilla: https://bugs.freedesktop.org/109235
(Ported from amdgpu commit ebd32b1c07208f8dbe853e089f5e4b7c6a7a658a)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon_dri2.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 922ed4fb6..b5d6835c9 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -252,6 +252,12 @@ radeon_dri2_create_buffer2(ScreenPtr pScreen,
     } else if (is_glamor_pixmap) {
 	pixmap = radeon_glamor_set_pixmap_bo(drawable, pixmap);
 	pixmap->refcnt++;
+
+	/* The copy operation from radeon_glamor_set_pixmap_bo needs to
+	 * be flushed to the kernel driver before the client starts
+	 * using the pixmap storage for direct rendering.
+	 */
+	radeon_cs_flush_indirect(pScrn);
     }
 
     if (!radeon_get_flink_name(pRADEONEnt, pixmap, &buffers->name))
-- 
2.20.1



More information about the amd-gfx mailing list