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

Chris Wilson ickle at kemper.freedesktop.org
Thu Jun 23 16:39:04 PDT 2011


 src/sna/kgem.c        |    5 ++++-
 src/sna/sna_accel.c   |    2 +-
 src/sna/sna_display.c |   24 ++++++++++++++++++------
 src/sna/sna_io.c      |    3 ++-
 4 files changed, 25 insertions(+), 9 deletions(-)

New commits:
commit 58d7a89b93ba4022f45465e479d2799b8903137a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 24 00:35:30 2011 +0100

    sna: Don't render to invalid surfaces
    
    Fixes a regression from d0362a. In bypassing the is_wedged checked, we
    also ended up bypassing the checks that we could indeed render to the
    target bo. With the result that we were creating GPU buffers for SHM
    surfaces, something that requires Xserver fixes before we can actually
    enable...
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index df1546d..e5c4e7b 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1177,9 +1177,12 @@ static bool _kgem_can_create_2d(struct kgem *kgem,
 	if (bpp < 8)
 		return false;
 
-	if (kgem->wedged)
+	if (tiling >= 0 && kgem->wedged)
 		return false;
 
+	if (tiling < 0)
+		tiling = -tiling;
+
 	size = kgem_surface_size(kgem, width, height, bpp, tiling, &pitch);
 	if (size == 0 || size > kgem->aperture_low)
 		size = kgem_surface_size(kgem, width, height, bpp, I915_TILING_NONE, &pitch);
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 2b78e92..0155ede 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -684,7 +684,7 @@ sna_pixmap_force_to_gpu(PixmapPtr pixmap)
 
 	priv = sna_pixmap(pixmap);
 	if (priv == NULL) {
-		priv = _sna_pixmap_attach(pixmap);
+		priv = sna_pixmap_attach(pixmap);
 		if (priv == NULL)
 			return NULL;
 
diff --git a/src/sna/sna_io.c b/src/sna/sna_io.c
index 41f3671..61d1062 100644
--- a/src/sna/sna_io.c
+++ b/src/sna/sna_io.c
@@ -411,7 +411,8 @@ struct kgem_bo *sna_replace(struct sna *sna,
 	struct kgem *kgem = &sna->kgem;
 	void *dst;
 
-	DBG(("%s(%d, %d)\n", __FUNCTION__, width, height));
+	DBG(("%s(%dx%d, bpp=%d, tiling=%d)\n",
+	     __FUNCTION__, width, height, bpp, bo->tiling));
 
 	assert(bo->reusable);
 	if (kgem_bo_is_busy(kgem, bo)) {
commit 3c1d5bc35e02dfd8234c029dcab5661e1656ca8e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Fri Jun 24 00:34:11 2011 +0100

    sna: Clip the fbcon to the frontbuffer
    
    ...both to correct the placement of the fbcon into the smaller scanout and
    to ensure that we correctly clip the boxes to be copied.
    
    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 cb1beba..f92a1db 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -502,6 +502,8 @@ void sna_copy_fbcon(struct sna *sna)
 	struct kgem_bo *bo;
 	BoxRec box;
 	bool ok;
+	int sx, sy;
+	int dx, dy;
 	int i;
 
 	if (sna->kgem.wedged)
@@ -527,8 +529,8 @@ void sna_copy_fbcon(struct sna *sna)
 		goto cleanup_fbcon;
 
 	box.x1 = box.y1 = 0;
-	box.x2 = fbcon->width;
-	box.y2 = fbcon->height;
+	box.x2 = min(fbcon->width, sna->front->drawable.width);
+	box.y2 = min(fbcon->height, sna->front->drawable.height);
 
 	bo = sna_create_bo_for_fbcon(sna, fbcon);
 	if (bo == NULL)
@@ -537,11 +539,21 @@ void sna_copy_fbcon(struct sna *sna)
 	priv = sna_pixmap(sna->front);
 	assert(priv && priv->gpu_bo);
 
+	sx = dx = 0;
+	if (box.x2 < fbcon->width)
+		sx = (fbcon->width - box.x2) / 2.;
+	if (box.x2 < sna->front->drawable.width)
+		dx = (sna->front->drawable.width - box.x2) / 2.;
+
+	sy = dy = 0;
+	if (box.y2 < fbcon->height)
+		sy = (fbcon->height - box.y2) / 2.;
+	if (box.y2 < sna->front->drawable.height)
+		dy = (sna->front->drawable.height - box.y2) / 2.;
+
 	ok = sna->render.copy_boxes(sna, GXcopy,
-				    sna->front, bo, 0, 0,
-				    sna->front, priv->gpu_bo,
-				    (sna->front->drawable.width - fbcon->width)/2,
-				    (sna->front->drawable.height - fbcon->height)/2,
+				    sna->front, bo, sx, sy,
+				    sna->front, priv->gpu_bo, dx, dy,
 				    &box, 1);
 	sna_damage_add_box(&priv->gpu_damage, &box);
 


More information about the xorg-commit mailing list