xf86-video-intel: 3 commits - configure.ac src/legacy/i810 src/sna/kgem.c src/sna/kgem.h src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Jul 12 04:01:15 PDT 2012


 configure.ac                  |   16 ++++------------
 src/legacy/i810/i810.h        |    4 ++--
 src/legacy/i810/i810_dga.c    |    6 +++---
 src/legacy/i810/i810_dri.c    |    2 +-
 src/legacy/i810/i810_driver.c |   14 +++++++-------
 src/sna/kgem.c                |   20 +++++---------------
 src/sna/kgem.h                |    2 +-
 src/sna/sna_accel.c           |   35 ++++++++++++++++++++++++++---------
 8 files changed, 49 insertions(+), 50 deletions(-)

New commits:
commit d25000e1f31e78aff2ab43adb12aec0aac36f56f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 11 22:37:25 2012 +0100

    i810: Tidy configure detection for XAA/DGA
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/configure.ac b/configure.ac
index dde23f1..323f283 100644
--- a/configure.ac
+++ b/configure.ac
@@ -161,43 +161,35 @@ fi
 
 PKG_CHECK_MODULES(XORG, [xorg-server >= $required_xorg_xserver_version xproto fontsproto pixman-1 >= $required_pixman_version $REQUIRED_MODULES])
 
-AC_MSG_CHECKING([whether to include XAA support])
 AC_ARG_ENABLE(xaa,
 	      AS_HELP_STRING([--enable-xaa],
 			     [Enable legacy X Acceleration Architecture (XAA) [default=auto]]),
 	      [XAA="$enableval"],
 	      [XAA=auto])
-AC_MSG_RESULT([$XAA])
-AM_CONDITIONAL(XAA, test "x$XAA" != xno)
 if test "x$XAA" != xno; then
         save_CFLAGS=$CFLAGS
         CFLAGS=$XSERVER_CFLAGS
 	AC_CHECK_HEADERS([xaa.h], XAA=yes, XAA=no)
         CFLAGS=$save_CFLAGS
 fi
-if test "x$XAA" = xyes; then
-	AC_DEFINE(USE_XAA, 1, [Enable XAA support])
-fi
+AC_MSG_CHECKING([whether to include XAA support])
 AM_CONDITIONAL(XAA, test "x$XAA" = xyes)
+AC_MSG_RESULT([$XAA])
 
-AC_MSG_CHECKING([whether to include DGA support])
 AC_ARG_ENABLE(dga,
 	      AS_HELP_STRING([--enable-dga],
 			     [Enable legacy Direct Graphics Access (DGA) [default=auto]]),
 	      [DGA="$enableval"],
 	      [DGA=auto])
-AC_MSG_RESULT([$DGA])
-AM_CONDITIONAL(DGA, test "x$DGA" != xno)
 if test "x$DGA" != xno; then
         save_CFLAGS=$CFLAGS
         CFLAGS=$XSERVER_CFLAGS
 	AC_CHECK_HEADERS([dgaproc.h], DGA=yes, DGA=no)
         CFLAGS=$save_CFLAGS
 fi
-if test "x$DGA" = xyes; then
-	AC_DEFINE(USE_DGA, 1, [Enable DGA support])
-fi
+AC_MSG_CHECKING([whether to include DGA support])
 AM_CONDITIONAL(DGA, test "x$DGA" = xyes)
+AC_MSG_RESULT([$DGA])
 
 AC_ARG_WITH(default-accel,
 	    AS_HELP_STRING([--with-default-accel],
diff --git a/src/legacy/i810/i810.h b/src/legacy/i810/i810.h
index 512d07e..a07fb69 100644
--- a/src/legacy/i810/i810.h
+++ b/src/legacy/i810/i810.h
@@ -42,7 +42,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "compiler.h"
 #include "xf86Pci.h"
 #include "i810_reg.h"
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
 #include "xaa.h"
 #endif
 #include "xf86Cursor.h"
@@ -204,7 +204,7 @@ typedef struct _I810Rec {
    I810RegRec SavedReg;
    I810RegRec ModeReg;
 
-#ifdef XAA
+#ifdef HAVE_XAA_H
    XAAInfoRecPtr AccelInfoRec;
 #endif
    xf86CursorInfoPtr CursorInfoRec;
diff --git a/src/legacy/i810/i810_dga.c b/src/legacy/i810/i810_dga.c
index e258360..81e1767 100644
--- a/src/legacy/i810/i810_dga.c
+++ b/src/legacy/i810/i810_dga.c
@@ -40,7 +40,7 @@ static Bool I810_SetMode(ScrnInfoPtr, DGAModePtr);
 static int I810_GetViewport(ScrnInfoPtr);
 static void I810_SetViewport(ScrnInfoPtr, int, int, int);
 
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
 static void I810_Sync(ScrnInfoPtr);
 static void I810_FillRect(ScrnInfoPtr, int, int, int, int, unsigned long);
 static void I810_BlitRect(ScrnInfoPtr, int, int, int, int, int, int);
@@ -58,7 +58,7 @@ DGAFunctionRec I810DGAFuncs = {
    I810_SetMode,
    I810_SetViewport,
    I810_GetViewport,
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
    I810_Sync,
    I810_FillRect,
    I810_BlitRect,
@@ -193,7 +193,7 @@ I810_SetViewport(ScrnInfoPtr pScrn, int x, int y, int flags)
    pI810->DGAViewportStatus = 0;
 }
 
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
 static void
 I810_FillRect(ScrnInfoPtr pScrn,
 	      int x, int y, int w, int h, unsigned long color)
diff --git a/src/legacy/i810/i810_dri.c b/src/legacy/i810/i810_dri.c
index 0f891bb..f2643f5 100644
--- a/src/legacy/i810/i810_dri.c
+++ b/src/legacy/i810/i810_dri.c
@@ -1011,7 +1011,7 @@ I810DRISwapContext(ScreenPtr pScreen, DRISyncType syncType,
 static void
 I810DRISetNeedSync(ScrnInfoPtr pScrn)
 {
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
    I810Ptr pI810 = I810PTR(pScrn);
    if (pI810->AccelInfoRec)
 	pI810->AccelInfoRec->NeedToSync = TRUE;
diff --git a/src/legacy/i810/i810_driver.c b/src/legacy/i810/i810_driver.c
index f4f7f3e..6fc17bd 100644
--- a/src/legacy/i810/i810_driver.c
+++ b/src/legacy/i810/i810_driver.c
@@ -1095,7 +1095,7 @@ DoRestore(ScrnInfoPtr scrn, vgaRegPtr vgaReg, I810RegPtr i810Reg,
    hwp->writeCrtc(hwp, IO_CTNL, temp);
 }
 
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
 static void
 I810SetRingRegs(ScrnInfoPtr scrn)
 {
@@ -1693,7 +1693,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL)
    }
 #endif
 
-#ifdef HAVE_DGA
+#ifdef HAVE_DGAPROC_H
    I810DGAInit(screen);
 #endif
 
@@ -1703,7 +1703,7 @@ I810ScreenInit(SCREEN_INIT_ARGS_DECL)
       return FALSE;
    }
 
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
    if (!xf86ReturnOptValBool(pI810->Options, OPTION_NOACCEL, FALSE)) {
       if (pI810->LpRing->mem.Size != 0) {
 	 I810SetRingRegs(scrn);
@@ -1943,7 +1943,7 @@ I810LeaveVT(VT_FUNC_ARGS_DECL)
    }
 #endif
 
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
    if (pI810->AccelInfoRec != NULL) {
       I810RefreshRing(scrn);
       I810Sync(scrn);
@@ -1968,12 +1968,12 @@ I810CloseScreen(CLOSE_SCREEN_ARGS_DECL)
    ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
    vgaHWPtr hwp = VGAHWPTR(scrn);
    I810Ptr pI810 = I810PTR(scrn);
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
    XAAInfoRecPtr infoPtr = pI810->AccelInfoRec;
 #endif
 
    if (scrn->vtSema == TRUE) {
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
       if (pI810->AccelInfoRec != NULL) {
 	 I810RefreshRing(scrn);
 	 I810Sync(scrn);
@@ -2004,7 +2004,7 @@ I810CloseScreen(CLOSE_SCREEN_ARGS_DECL)
       pI810->ScanlineColorExpandBuffers = NULL;
    }
 
-#ifdef HAVE_XAA
+#ifdef HAVE_XAA_H
    if (infoPtr) {
       if (infoPtr->ScanlineColorExpandBuffers)
 	 free(infoPtr->ScanlineColorExpandBuffers);
commit 44a1528c15eec9b3f93651e779013137864d4d2b
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 11 15:05:32 2012 +0100

    sna: Remove unused cached partials list
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 4fd4d1f..bea7aea 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -712,7 +712,6 @@ void kgem_init(struct kgem *kgem, int fd, struct pci_device *dev, int gen)
 
 	list_init(&kgem->batch_partials);
 	list_init(&kgem->active_partials);
-	list_init(&kgem->cached_partials);
 	list_init(&kgem->requests);
 	list_init(&kgem->flushing);
 	list_init(&kgem->sync_list);
@@ -1387,16 +1386,11 @@ static void kgem_partial_buffer_release(struct kgem *kgem,
 
 static bool kgem_retire__partials(struct kgem *kgem)
 {
-	struct list *list[] = {
-		&kgem->active_partials,
-		&kgem->cached_partials,
-		NULL
-	}, **head = list;
 	bool retired = false;
 
-	do while (!list_is_empty(*head)) {
+	while (!list_is_empty(&kgem->active_partials)) {
 		struct kgem_partial_bo *bo =
-			list_last_entry(*head,
+			list_last_entry(&kgem->active_partials,
 					struct kgem_partial_bo,
 					base.list);
 
@@ -1409,7 +1403,7 @@ static bool kgem_retire__partials(struct kgem *kgem)
 		kgem_partial_buffer_release(kgem, bo);
 		kgem_bo_unref(kgem, &bo->base);
 		retired = true;
-	} while (*++head);
+	}
 
 	return retired;
 }
@@ -1765,12 +1759,8 @@ static void kgem_finish_partials(struct kgem *kgem)
 decouple:
 		DBG(("%s: releasing handle=%d\n",
 		     __FUNCTION__, bo->base.handle));
-		if (!list_is_empty(&bo->base.vma)) {
-			list_move(&bo->base.list, &kgem->cached_partials);
-		} else {
-			list_del(&bo->base.list);
-			kgem_bo_unref(kgem, &bo->base);
-		}
+		list_del(&bo->base.list);
+		kgem_bo_unref(kgem, &bo->base);
 	}
 }
 
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 44d4327..273240f 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -125,7 +125,7 @@ struct kgem {
 	struct list large;
 	struct list active[NUM_CACHE_BUCKETS][3];
 	struct list inactive[NUM_CACHE_BUCKETS];
-	struct list batch_partials, active_partials, cached_partials;
+	struct list batch_partials, active_partials;
 	struct list requests;
 	struct list sync_list;
 	struct kgem_request *next_request;
commit 94d489ae43a2c4d4d9ddc9ce30ff1a9142b77d4a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jul 11 14:25:20 2012 +0100

    sna: Minor tweak to upload in place if the CPU bo is busy
    
    Since we have to pay the price of the stall anyway...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 0e9f47e..f4921b2 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1466,12 +1466,12 @@ static inline bool region_inplace(struct sna *sna,
 	     __FUNCTION__,
 	     region->extents.x2 - region->extents.x1,
 	     region->extents.y2 - region->extents.y1,
-	     ((region->extents.x2 - region->extents.x1) *
-	      (region->extents.y2 - region->extents.y1) *
+	     ((int)(region->extents.x2 - region->extents.x1) *
+	      (int)(region->extents.y2 - region->extents.y1) *
 	      pixmap->drawable.bitsPerPixel >> 12)
 	     >= sna->kgem.half_cpu_cache_pages));
-	return ((region->extents.x2 - region->extents.x1) *
-		(region->extents.y2 - region->extents.y1) *
+	return ((int)(region->extents.x2 - region->extents.x1) *
+		(int)(region->extents.y2 - region->extents.y1) *
 		pixmap->drawable.bitsPerPixel >> 12)
 		>= sna->kgem.half_cpu_cache_pages;
 }
@@ -2986,24 +2986,41 @@ static bool upload_inplace(struct sna *sna,
 			   struct sna_pixmap *priv,
 			   RegionRec *region)
 {
-	if (!region_inplace(sna, pixmap, region, priv, true))
+	if (!region_inplace(sna, pixmap, region, priv, true)) {
+		DBG(("%s? no, region not suitable\n", __FUNCTION__));
 		return false;
+	}
 
 	if (priv->gpu_bo) {
 		assert(priv->gpu_bo->proxy == NULL);
 
-		if (!kgem_bo_can_map(&sna->kgem, priv->gpu_bo))
+		if (!kgem_bo_can_map(&sna->kgem, priv->gpu_bo)) {
+			DBG(("%s? no, GPU bo not mappable\n", __FUNCTION__));
 			return false;
+		}
 
-		if (!kgem_bo_is_busy(priv->gpu_bo))
+		if (!kgem_bo_is_busy(priv->gpu_bo)) {
+			DBG(("%s? yes, GPU bo is idle\n", __FUNCTION__));
 			return true;
+		}
 
 		if (!priv->pinned &&
-		    region_subsumes_drawable(region, &pixmap->drawable))
+		    region_subsumes_drawable(region, &pixmap->drawable)) {
+			DBG(("%s? yes, will replace busy GPU\n", __FUNCTION__));
 			return true;
+		}
+
 	}
 
-	return priv->gpu_bo == NULL && priv->cpu_bo == NULL;
+	if (priv->cpu_bo) {
+		if (kgem_bo_is_busy(priv->cpu_bo)) {
+			DBG(("%s? yes, CPU bo is busy\n", __FUNCTION__));
+			return true;
+		}
+	}
+
+	DBG(("%s? no\n", __FUNCTION__));
+	return false;
 }
 
 static Bool


More information about the xorg-commit mailing list