[PATCH xf86-video-amdgpu 2/3] glamor: Add amdgpu_glamor_finish to wait for glamor rendering to finish
Michel Dänzer
michel at daenzer.net
Thu Aug 6 20:44:49 PDT 2015
From: Michel Dänzer <michel.daenzer at amd.com>
This is a bit sneaky, because it calls glFinish directly from the driver,
but it seems to work fine.
Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
configure.ac | 2 ++
src/amdgpu_glamor.c | 12 ++++++++++++
src/amdgpu_glamor.h | 1 +
3 files changed, 15 insertions(+)
diff --git a/configure.ac b/configure.ac
index 85892fa..e350ef6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,8 @@ if test "x$GLAMOR" != "xno"; then
#include "glamor.h"])
fi
+ PKG_CHECK_MODULES(LIBGL, [gl])
+
if test "x$GLAMOR_XSERVER" != xyes; then
PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
diff --git a/src/amdgpu_glamor.c b/src/amdgpu_glamor.c
index f74aa28..8f0dc79 100644
--- a/src/amdgpu_glamor.c
+++ b/src/amdgpu_glamor.c
@@ -36,6 +36,8 @@
#include <gbm.h>
+#include <GL/gl.h>
+
#if HAS_DEVPRIVATEKEYREC
DevPrivateKeyRec amdgpu_pixmap_index;
#else
@@ -371,6 +373,16 @@ void amdgpu_glamor_flush(ScrnInfoPtr pScrn)
}
}
+void amdgpu_glamor_finish(ScrnInfoPtr pScrn)
+{
+ AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
+
+ if (info->use_glamor) {
+ amdgpu_glamor_flush(pScrn);
+ glFinish();
+ }
+}
+
XF86VideoAdaptorPtr amdgpu_glamor_xv_init(ScreenPtr pScreen, int num_adapt)
{
return glamor_xv_init(pScreen, num_adapt);
diff --git a/src/amdgpu_glamor.h b/src/amdgpu_glamor.h
index a781695..de63005 100644
--- a/src/amdgpu_glamor.h
+++ b/src/amdgpu_glamor.h
@@ -65,6 +65,7 @@ Bool amdgpu_glamor_create_screen_resources(ScreenPtr screen);
void amdgpu_glamor_free_screen(int scrnIndex, int flags);
void amdgpu_glamor_flush(ScrnInfoPtr pScrn);
+void amdgpu_glamor_finish(ScrnInfoPtr pScrn);
Bool
amdgpu_glamor_create_textured_pixmap(PixmapPtr pixmap, struct amdgpu_pixmap *priv);
--
2.5.0
More information about the xorg-driver-ati
mailing list