xf86-video-intel: src/sna/sna_io.c

Chris Wilson ickle at kemper.freedesktop.org
Thu Sep 13 09:18:45 PDT 2012


 src/sna/sna_io.c |   19 ++++++++++---------
 1 file changed, 10 insertions(+), 9 deletions(-)

New commits:
commit 8c7dd2219fa777bf6354c4e0ef38a2f09fe09675
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Sep 13 17:14:23 2012 +0100

    sna: Prefer to use indirect uploads for very small updates
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index fa87133..a466f55 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -537,6 +537,8 @@ static bool upload_inplace(struct kgem *kgem,
 			   const BoxRec *box,
 			   int n, int bpp)
 {
+	unsigned int bytes;
+
 	if (!kgem_bo_can_map(kgem, bo))
 		return false;
 
@@ -547,16 +549,15 @@ static bool upload_inplace(struct kgem *kgem,
 	 * able to almagamate a series of small writes into a single
 	 * operation.
 	 */
-	if (__kgem_bo_is_busy(kgem, bo)) {
-		unsigned int bytes = 0;
-		while (n--) {
-			bytes += (box->x2 - box->x1) * (box->y2 - box->y1);
-			box++;
-		}
-		return bytes * bpp >> 12 >= kgem->half_cpu_cache_pages;
+	bytes = 0;
+	while (n--) {
+		bytes += (box->x2 - box->x1) * (box->y2 - box->y1);
+		box++;
 	}
-
-	return true;
+	if (__kgem_bo_is_busy(kgem, bo))
+		return bytes * bpp >> 12 >= kgem->half_cpu_cache_pages;
+	else
+		return bytes * bpp >> 12;
 }
 
 bool sna_write_boxes(struct sna *sna, PixmapPtr dst,


More information about the xorg-commit mailing list