xf86-video-intel: 2 commits - src/sna/sna_accel.c

Chris Wilson ickle at kemper.freedesktop.org
Sun Jul 15 07:30:20 PDT 2012


 src/sna/sna_accel.c |   39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

New commits:
commit 6fa059330decd1437eef4928d732ec91fd4e17e7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jul 15 14:04:48 2012 +0100

    sna: Avoid creating a CPU bo for uploads if we already have a large GPU bo
    
    And vice-versa if already have a large CPU bo.
    
    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 bc73dee..1734a8f 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2990,6 +2990,19 @@ static bool upload_inplace(struct sna *sna,
 			   struct sna_pixmap *priv,
 			   RegionRec *region)
 {
+	if (priv->create & KGEM_CAN_CREATE_LARGE) {
+		if (priv->gpu_bo) {
+			DBG(("%s: yes, large buffer and already have GPU bo\n",
+			     __FUNCTION__));
+			return true;
+		}
+		if (priv->cpu_bo){
+			DBG(("%s: no, large buffer and already have CPU bo\n",
+			     __FUNCTION__));
+			return false;
+		}
+	}
+
 	if (!region_inplace(sna, pixmap, region, priv, true)) {
 		DBG(("%s? no, region not suitable\n", __FUNCTION__));
 		return false;
commit a253c95ec63b2b075e66ae7380fed6a73469eba5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jul 15 13:32:35 2012 +0100

    sna: Prefer uploads to be staged in snoopable bo
    
    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 92aca23..bc73dee 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2995,6 +2995,25 @@ static bool upload_inplace(struct sna *sna,
 		return false;
 	}
 
+	if (sna->kgem.has_llc) {
+		if (priv->cpu_bo) {
+			if (priv->cpu_damage &&
+			    kgem_bo_is_busy(priv->cpu_bo) &&
+			    !region_subsumes_damage(region, priv->cpu_damage)) {
+				DBG(("%s? yes, CPU bo is busy\n", __FUNCTION__));
+				return true;
+			}
+
+			DBG(("%s? no, have CPU bo\n", __FUNCTION__));
+			return false;
+		}
+
+		if (priv->create & KGEM_CAN_CREATE_CPU) {
+			DBG(("%s? no, can create CPU bo\n", __FUNCTION__));
+			return false;
+		}
+	}
+
 	if (priv->gpu_bo) {
 		assert(priv->gpu_bo->proxy == NULL);
 
@@ -3016,13 +3035,6 @@ static bool upload_inplace(struct sna *sna,
 
 	}
 
-	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;
 }


More information about the xorg-commit mailing list