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

Chris Wilson ickle at kemper.freedesktop.org
Sun Jan 13 10:40:48 PST 2013


 src/sna/sna_accel.c |   15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 3cc04a8e24f02248b6382c9bc354ea15c42b17b6
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jan 13 17:34:03 2013 +0000

    sna: Initialize src_bo to detect allocation failure
    
    sna_accel.c: In function 'sna_put_image':
    sna_accel.c:3730:18: warning: 'src_bo' may be used uninitialized in this
    function [-Wmaybe-uninitialized]
    
    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 6f0c63e..8f12708 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -3710,7 +3710,7 @@ sna_put_zpixmap_blt(DrawablePtr drawable, GCPtr gc, RegionPtr region,
 	if (USE_USERPTR_UPLOADS &&
 	    sna->kgem.has_userptr &&
 	    box_inplace(pixmap, &region->extents)) {
-		struct kgem_bo *src_bo;
+		struct kgem_bo *src_bo = NULL;
 		bool ok = false;
 
 		DBG(("%s: upload through a temporary map\n",
commit 3f04b0b98d7f861ff58b82c99d33b7eacfcda5f7
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Sun Jan 13 17:31:15 2013 +0000

    sna: Check size against aperture before attempting to perform the GTT mapping
    
    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 1cdf4b3..6f0c63e 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1431,10 +1431,13 @@ static inline bool use_cpu_bo_for_upload(struct sna *sna,
 
 static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags)
 {
-	if ((flags & MOVE_INPLACE_HINT) == 0 || priv->gpu_bo == NULL)
+	if ((priv->create & KGEM_CAN_CREATE_GTT) == 0)
 		return false;
 
-	if (flags & MOVE_WRITE && kgem_bo_is_busy(priv->gpu_bo))
+	if ((flags & MOVE_INPLACE_HINT) == 0)
+		return false;
+
+	if (priv->gpu_damage && kgem_bo_is_busy(priv->gpu_bo))
 		return false;
 
 	return true;
@@ -1541,7 +1544,7 @@ skip_inplace_map:
 
 	if (operate_inplace(priv, flags) &&
 	    pixmap_inplace(sna, pixmap, priv) &&
-	    sna_pixmap_move_to_gpu(pixmap, flags | MOVE_INPLACE_HINT)) {
+	    sna_pixmap_move_to_gpu(pixmap, flags)) {
 		kgem_bo_submit(&sna->kgem, priv->gpu_bo);
 
 		DBG(("%s: try to operate inplace (GTT)\n", __FUNCTION__));
@@ -2029,8 +2032,8 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
 	}
 
 	if (operate_inplace(priv, flags) &&
-	    kgem_bo_can_map(&sna->kgem, priv->gpu_bo) &&
-	    region_inplace(sna, pixmap, region, priv, (flags & MOVE_READ) == 0)) {
+	    region_inplace(sna, pixmap, region, priv, (flags & MOVE_READ) == 0) &&
+	    sna_pixmap_move_to_gpu(pixmap, flags | MOVE_READ)) {
 		kgem_bo_submit(&sna->kgem, priv->gpu_bo);
 
 		DBG(("%s: try to operate inplace\n", __FUNCTION__));


More information about the xorg-commit mailing list