xf86-video-intel: 7 commits - configure.ac src/sna/sna_display.c src/sna/sna_display_fake.c src/uxa/intel_display.c src/uxa/intel_glamor.c src/uxa/uxa-priv.h

Chris Wilson ickle at kemper.freedesktop.org
Thu Apr 10 08:20:55 PDT 2014


 configure.ac               |    9 +++++++--
 src/sna/sna_display.c      |   45 +++++++++++++++++++++++++++++----------------
 src/sna/sna_display_fake.c |   30 ------------------------------
 src/uxa/intel_display.c    |   20 ++++++++++++++++++--
 src/uxa/intel_glamor.c     |    8 +++++++-
 src/uxa/uxa-priv.h         |   17 +----------------
 6 files changed, 62 insertions(+), 67 deletions(-)

New commits:
commit f94684db1a694820ff508d8aec77bf19cea86fbd
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 10 16:08:48 2014 +0100

    sna: Validate the cursor everytime for hw support
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 528f21e..0b03cfa 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3533,22 +3533,21 @@ sna_use_hw_cursor(ScreenPtr screen, CursorPtr cursor)
 	struct sna *sna = to_sna_from_screen(screen);
 
 	/* cursors are invariant */
-	if (cursor == sna->cursor.ref)
-		return TRUE;
-
-	cursor->refcnt++;
-	if (sna->cursor.ref)
-		FreeCursor(sna->cursor.ref, None);
-	sna->cursor.ref = cursor;
-	sna->cursor.size = __cursor_size(cursor);
-	sna->cursor.serial++;
-
-	__DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__,
-	       cursor->bits->width,
-	       cursor->bits->height,
-	       cursor->bits->argb!=NULL,
-	       sna->cursor.serial,
-	       sna->cursor.size));
+	if (cursor != sna->cursor.ref) {
+		cursor->refcnt++;
+		if (sna->cursor.ref)
+			FreeCursor(sna->cursor.ref, None);
+		sna->cursor.ref = cursor;
+		sna->cursor.size = __cursor_size(cursor);
+		sna->cursor.serial++;
+
+		__DBG(("%s(%dx%d): ARGB?=%d, serial->%d, size->%d\n", __FUNCTION__,
+		       cursor->bits->width,
+		       cursor->bits->height,
+		       cursor->bits->argb!=NULL,
+		       sna->cursor.serial,
+		       sna->cursor.size));
+	}
 
 	return sna->cursor.size <= sna->cursor.max_size;
 }
commit d364a881effb2fd87f11648b10d126eb18fcb6be
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 10 09:12:02 2014 +0100

    configure: Report which version (lib or module) of glamor is used
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index 0fdbc3c..fa6439e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -344,9 +344,12 @@ if test "x$GLAMOR" != "xno"; then
 	if test "x$UXA" != "xyes"; then
 		AC_MSG_ERROR([Glamor acceleration requested but UXA is not enabled])
 	fi
-	if ! pkg-config --exists "xorg-server >= 1.15.99.901"; then
+	if pkg-config --exists "xorg-server >= 1.15.99.901"; then
+		GLAMOR="yes (using Xorg glamor module)"
+	else
 		PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
 		PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+		GLAMOR="yes (using libglamor)"
 	fi
 	AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
 fi
commit b771b41f0a945fc580d532524cc744b01dd36d5f
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 9 15:24:23 2014 -0700

    uxa: Fix load_cursor_argb for the new Xorg ABI.
    
    Returning an undefined value meant we might get sw cursors.

diff --git a/src/uxa/intel_display.c b/src/uxa/intel_display.c
index 0f06793..857aa24 100644
--- a/src/uxa/intel_display.c
+++ b/src/uxa/intel_display.c
@@ -432,8 +432,8 @@ intel_crtc_set_cursor_position (xf86CrtcPtr crtc, int x, int y)
 	drmModeMoveCursor(mode->fd, crtc_id(intel_crtc), x, y);
 }
 
-static void
-intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
+static int
+__intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 {
 	struct intel_crtc *intel_crtc = crtc->driver_private;
 	int ret;
@@ -442,7 +442,23 @@ intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 	if (ret)
 		xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
 			   "failed to set cursor: %s\n", strerror(-ret));
+
+	return ret;
+}
+
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,0)
+static Bool
+intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
+{
+	return __intel_crtc_load_cursor_argb(crtc, image) == 0;
+}
+#else
+static void
+intel_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
+{
+	__intel_crtc_load_cursor_argb(crtc, image);
 }
+#endif
 
 static void
 intel_crtc_hide_cursor(xf86CrtcPtr crtc)
commit d812afc1d4476ba987883fad2ef8b7c002638077
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 9 15:24:22 2014 -0700

    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.

diff --git a/src/uxa/uxa-priv.h b/src/uxa/uxa-priv.h
index 3f639e7..5bf4814 100644
--- a/src/uxa/uxa-priv.h
+++ b/src/uxa/uxa-priv.h
@@ -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,
commit a6919aa980883cf2828dc0cf813f315e3035d0cf
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Apr 9 15:24:21 2014 -0700

    Update for glamor in the 1.16 server.
    
    We should link against the server's copy, insted of using the external
    library.

diff --git a/configure.ac b/configure.ac
index 7542898..0fdbc3c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -344,8 +344,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.6.0])
-	PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	if ! pkg-config --exists "xorg-server >= 1.15.99.901"; then
+		PKG_CHECK_MODULES(LIBGLAMOR, [glamor >= 0.6.0])
+		PKG_CHECK_MODULES(LIBGLAMOR_EGL, [glamor-egl])
+	fi
 	AC_DEFINE(USE_GLAMOR, 1, [Enable glamor acceleration])
 fi
 
diff --git a/src/uxa/intel_glamor.c b/src/uxa/intel_glamor.c
index e1e2a74..d38d381 100644
--- a/src/uxa/intel_glamor.c
+++ b/src/uxa/intel_glamor.c
@@ -219,7 +219,13 @@ intel_glamor_init(ScreenPtr screen)
 	if ((intel->uxa_flags & UXA_GLAMOR_EGL_INITIALIZED) == 0)
 		goto fail;
 
-	if (!glamor_init(screen, GLAMOR_INVERTED_Y_AXIS | GLAMOR_USE_EGL_SCREEN)) {
+	if (!glamor_init(screen,
+#if defined(GLAMOR_NO_DRI3)
+			 /* Not doing DRI3 yet, since Present support hasn't landed. */
+			 GLAMOR_NO_DRI3 |
+#endif
+			 GLAMOR_INVERTED_Y_AXIS |
+			 GLAMOR_USE_EGL_SCREEN)) {
 		xf86DrvMsg(scrn->scrnIndex, X_ERROR,
 			   "Failed to initialize glamor.\n");
 		goto fail;
commit be7c166a017cee3ef8a1b7b290b7fb14b4009314
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 10 08:22:02 2014 +0100

    sna: Remove defunct Cursor interface on fake CRTC
    
    As we no longer user the xf86Cursor helper, we can forgo filling in stub
    routines for the fake CRTC.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c
index c709d99..4728b86 100644
--- a/src/sna/sna_display_fake.c
+++ b/src/sna/sna_display_fake.c
@@ -96,31 +96,6 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
 }
 
 static void
-sna_crtc_set_cursor_colors(xf86CrtcPtr crtc, int bg, int fg)
-{
-}
-
-static void
-sna_crtc_set_cursor_position(xf86CrtcPtr crtc, int x, int y)
-{
-}
-
-static void
-sna_crtc_hide_cursor(xf86CrtcPtr crtc)
-{
-}
-
-static void
-sna_crtc_show_cursor(xf86CrtcPtr crtc)
-{
-}
-
-static void
-sna_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
-{
-}
-
-static void
 sna_crtc_gamma_set(xf86CrtcPtr crtc,
 		       CARD16 *red, CARD16 *green, CARD16 *blue, int size)
 {
@@ -142,11 +117,6 @@ sna_crtc_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr pixmap)
 static const xf86CrtcFuncsRec sna_crtc_funcs = {
 	.dpms = sna_crtc_dpms,
 	.set_mode_major = sna_crtc_set_mode_major,
-	.set_cursor_colors = sna_crtc_set_cursor_colors,
-	.set_cursor_position = sna_crtc_set_cursor_position,
-	.show_cursor = sna_crtc_show_cursor,
-	.hide_cursor = sna_crtc_hide_cursor,
-	.load_cursor_argb = sna_crtc_load_cursor_argb,
 	.gamma_set = sna_crtc_gamma_set,
 	.destroy = sna_crtc_destroy,
 #if HAS_PIXMAP_SHARING
commit 1d2872dd0830c8858621402328aa1a9322b66ea8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Apr 10 07:35:50 2014 +0100

    sna: Prepare for an upcoming Cursor API change
    
    1.16 now expects load-cursor-argb to return a boolean reporting
    success/failure.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index a9558d2..528f21e 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -3492,6 +3492,19 @@ disable:
 	sigio_unblock(sigio);
 }
 
+#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,15,99,902,0)
+static Bool
+sna_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor)
+{
+	return TRUE;
+}
+
+static Bool
+sna_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src)
+{
+	return TRUE;
+}
+#else
 static void
 sna_load_cursor_argb(ScrnInfoPtr scrn, CursorPtr cursor)
 {
@@ -3501,6 +3514,7 @@ static void
 sna_load_cursor_image(ScrnInfoPtr scrn, unsigned char *src)
 {
 }
+#endif
 
 static int __cursor_size(CursorPtr cursor)
 {


More information about the xorg-commit mailing list