summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2019-01-09 18:57:08 +0100
committerMichel Dänzer <michel@daenzer.net>2019-01-16 18:38:40 +0100
commitebd32b1c07208f8dbe853e089f5e4b7c6a7a658a (patch)
tree3f5d7bd49bcafdec0ba0e6a730c1d372f2245d44
parentd168532ee739f7e33a2798051e64ba445dd3859f (diff)
dri2: Flush in dri2_create_buffer2 after calling glamor_set_pixmap_bo
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 Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/amdgpu_dri2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/amdgpu_dri2.c b/src/amdgpu_dri2.c
index ff1b94a..a6b76a1 100644
--- a/src/amdgpu_dri2.c
+++ b/src/amdgpu_dri2.c
@@ -171,6 +171,12 @@ amdgpu_dri2_create_buffer2(ScreenPtr pScreen,
if (is_glamor_pixmap) {
pixmap = amdgpu_glamor_set_pixmap_bo(drawable, pixmap);
pixmap->refcnt++;
+
+ /* The copy operation from amdgpu_glamor_set_pixmap_bo needs to
+ * be flushed to the kernel driver before the client starts
+ * using the pixmap storage for direct rendering.
+ */
+ amdgpu_glamor_flush(pScrn);
}
if (!amdgpu_get_flink_name(pAMDGPUEnt, pixmap, &buffers->name))