Skip to contentSkip to conversation

Update for glamor in the 1.16 server.

PATCH In review Eric Anholt 2 participants 4 messages Apr 9, 2014 – Apr 10, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 Update for glamor in the 1.16 server.

We should link against the server's copy, insted of using the external library.

---
 configure.ac           |  6 ++++--
 src/uxa/intel_glamor.c | 14 +++++++++++++-
 2 files changed, 17 insertions(+), 3 deletions(-)
configure.ac +4 -2
index ce4822f..8bbb3b0 100644
@@ -322,8 +322,10 @@ if test "x$GLAMOR" != "xno"; then
 	if test "x$UXA" != "xyes"; then
 		AC_MSG_ERROR([Glamor acceleration requested but UXA is not enabled])
 	fi
-	PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.3.1])
-	PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	if ! pkg-config --exists "xorg-server >= 1.15.99.901"; then
+		PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.3.1])
+		PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	fi
 	AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
 fi
 
src/uxa/intel_glamor.c +13 -1
index 4d1c767..e0e5b2b 100644
@@ -204,11 +204,23 @@ intel_glamor_init(ScreenPtr screen)
 {
 	ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
 	intel_screen_private *intel = intel_get_screen_private(scrn);
+	Bool ret;
 
 	if ((intel->uxa_flags & UXA_GLAMOR_EGL_INITIALIZED) == 0)
 		goto fail;
 
-	if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN)) {
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,900,0)
+	/* Not doing DRI3 yet, since Present support hasn't landed. */
+	ret = glamor_init(screen,
+			  GLAMOR_INVERTED_Y_AXIS |
+			  GLAMOR_USE_EGL_SCREEN |
+			  GLAMOR_NO_DRI3);
+#else
+	ret = glamor_init(screen,
+			  GLAMOR_INVERTED_Y_AXIS |
+			  GLAMOR_USE_EGL_SCREEN);
+#endif
+	if (!ret) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Failed to initialize glamor.\n");
 		goto fail;
Signature · 1 line
1.9.1
#1 lore raw

PATCH 2/3 Use fbpict.h instead of defining its prototypes ourselves.

fbpict.h has been an installed header since 2008, shortly after uxa landed. This fixes compiler warnings when other headers happen to include fbpict.h.

---
 src/uxa/uxa-priv.h | 17 +----------------
 1 file changed, 1 insertion(+), 16 deletions(-)
src/uxa/uxa-priv.h +1 -16
index 3f639e7..5bf4814 100644
@@ -53,7 +53,7 @@
 #include "fb.h"
 #include "fboverlay.h"
 #ifdef RENDER
-//#include "fbpict.h"
+#include "fbpict.h"
 #include "glyphstr.h"
 #endif
 #include "damage.h"
@@ -300,21 +300,6 @@ extern const GCOps uxa_ops;
 
 #ifdef RENDER
 
-/* XXX these are in fbpict.h, which is not installed */
-void
-fbComposite(CARD8 op,
-	    PicturePtr pSrc,
-	    PicturePtr pMask,
-	    PicturePtr pDst,
-	    INT16 xSrc,
-	    INT16 ySrc,
-	    INT16 xMask,
-	    INT16 yMask, INT16 xDst, INT16 yDst, CARD16 width, CARD16 height);
-
-void
-fbAddTraps(PicturePtr pPicture,
-	   INT16 xOff, INT16 yOff, int ntrap, xTrap * traps);
-
 void
 uxa_check_composite(CARD8 op,
 		    PicturePtr pSrc,
Signature · 1 line
1.9.1
#2 lore raw

PATCH 3/3 uxa: Fix load_cursor_argb for the new Xorg ABI.

In reply to Eric Anholt

Returning an undefined value meant we might get sw cursors.

---
 src/uxa/intel_display.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
src/uxa/intel_display.c +16 -0
index 39d8507..23eb2c7 100644
@@ -606,6 +606,21 @@ intel_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
 	drmModeMoveCursor(mode->fd, crtc_id(intel_crtc), x, y);
 }
 
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,0)
+static Bool
+intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
+{
+	struct intel_crtc *intel_crtc = crtc->driver_private;
+	int ret;
+
+	ret = dri_bo_subdata(intel_crtc->cursor, 0, 64*64*4, image);
+	if (ret)
+		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+			   "failed to set cursor: %s\n", strerror(-ret));
+
+	return !ret;
+}
+#else
 static void
 intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 {
@@ -617,6 +632,7 @@ intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
 			   "failed to set cursor: %s\n", strerror(-ret));
 }
+#endif
 
 static void
 intel_crtc_hide_cursor(xf86CrtcPtr crtc)
Signature · 1 line
1.9.1
#3 lore raw
In reply to Eric Anholt
Quoted 2 lines · Eric Anholt

We should link against the server's copy, insted of using the external library.

Thank you, series pushed.
-Chris

Signature · 1 line
Chris Wilson, Intel Open Source Technology Centre