Skip to contentSkip to conversation

glamor: Use glamor_finish when available

PATCH In review Michel Dänzer 2 participants 2 messages Mar 8, 2017 – Mar 9, 2017 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 glamor: Use glamor_finish when available

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

---
 configure.ac        | 9 +++++++--
 src/amdgpu_glamor.c | 7 +++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
configure.ac +7 -2
index 00249a599..591c2b9f6 100644
@@ -138,9 +138,14 @@ if test "x$GLAMOR" != "xno"; then
 					 [Have glamor_egl_destroy_textured_pixmap API])], [],
 			      [#include "xorg-server.h"
 			       #include "glamor.h"])
-	fi
 
-	PKG_CHECK_MODULES(LIBGL, [gl])
+		AC_CHECK_DECL(glamor_finish,
+			      [AC_DEFINE(HAVE_GLAMOR_FINISH, 1,
+					 [Have glamor_finish API])],
+					 [PKG_CHECK_MODULES(LIBGL, [gl])],
+			      [#include "xorg-server.h"
+			       #include "glamor.h"])
+	fi
 
 	if test "x$GLAMOR_XSERVER" != xyes; then
 		PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
src/amdgpu_glamor.c +7 -0
index d29b096f4..1c5dfc2d1 100644
@@ -36,7 +36,9 @@
 
 #include <gbm.h>
 
+#ifndef HAVE_GLAMOR_FINISH
 #include <GL/gl.h>
+#endif
 
 DevPrivateKeyRec amdgpu_pixmap_index;
 
@@ -470,8 +472,13 @@ void amdgpu_glamor_finish(ScrnInfoPtr pScrn)
 	AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
 
 	if (info->use_glamor) {
+#if HAVE_GLAMOR_FINISH
+		glamor_finish(pScrn->pScreen);
+		info->gpu_flushed++;
+#else
 		amdgpu_glamor_flush(pScrn);
 		glFinish();
+#endif
 	}
 }
 
Signature · 6 lines
2.11.0

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

Reviewed-by
#2 lore raw
Quoted 3 lines · Michel Dänzer

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

Quoted 57 lines
---
 configure.ac        | 9 +++++++--
 src/amdgpu_glamor.c | 7 +++++++
 2 files changed, 14 insertions(+), 2 deletions(-)
configure.ac +7 -2
index 00249a599..591c2b9f6 100644
@@ -138,9 +138,14 @@ if test "x$GLAMOR" != "xno"; then
                                         [Have glamor_egl_destroy_textured_pixmap API])], [],
                              [#include "xorg-server.h"
                               #include "glamor.h"])
-       fi
 
-       PKG_CHECK_MODULES(LIBGL, [gl])
+               AC_CHECK_DECL(glamor_finish,
+                             [AC_DEFINE(HAVE_GLAMOR_FINISH, 1,
+                                        [Have glamor_finish API])],
+                                        [PKG_CHECK_MODULES(LIBGL, [gl])],
+                             [#include "xorg-server.h"
+                              #include "glamor.h"])
+       fi
 
        if test "x$GLAMOR_XSERVER" != xyes; then
                PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
src/amdgpu_glamor.c +7 -1
index d29b096f4..1c5dfc2d1 100644
@@ -36,7 +36,9 @@
 
 #include <gbm.h>
 
+#ifndef HAVE_GLAMOR_FINISH
 #include <GL/gl.h>
+#endif
 
 DevPrivateKeyRec amdgpu_pixmap_index;
 
@@ -470,8 +472,13 @@ void amdgpu_glamor_finish(ScrnInfoPtr pScrn)
        AMDGPUInfoPtr info = AMDGPUPTR(pScrn);
 
        if (info->use_glamor) {
+#if HAVE_GLAMOR_FINISH
+               glamor_finish(pScrn->pScreen);
+               info->gpu_flushed++;
+#else
                amdgpu_glamor_flush(pScrn);
                glFinish();
+#endif
        }
 }
 
--

2.11.0

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