xf86-video-intel: 4 commits - src/sna/kgem.c src/sna/sna_accel.c src/sna/sna_display.c src/sna/sna.h

Chris Wilson ickle at kemper.freedesktop.org
Thu Jun 28 04:49:40 PDT 2012


 src/sna/kgem.c        |    2 ++
 src/sna/sna.h         |    1 +
 src/sna/sna_accel.c   |    2 +-
 src/sna/sna_display.c |   26 +++++++++++++++++---------
 4 files changed, 21 insertions(+), 10 deletions(-)

New commits:
commit c3e2c1332d8d5a3944df99cc11aa66c586add3e8
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 28 12:34:36 2012 +0100

    sna: Fix the application of the crtc offset for posting damage
    
    The damage boxes are in framebuffer (source) space, so we need to apply
    the offset for the boxes in crtc (destination) space.
    
    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 648d5c5..565e98c 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2700,8 +2700,8 @@ sna_crtc_redisplay(xf86CrtcPtr crtc, RegionPtr region)
 		 */
 
 		if (sna->render.copy_boxes(sna, GXcopy,
-					   sna->front, sna_pixmap_get_bo(sna->front), tx, ty,
-					   &tmp, sna_crtc->bo, 0, 0,
+					   sna->front, sna_pixmap_get_bo(sna->front), 0, 0,
+					   &tmp, sna_crtc->bo, -tx, -ty,
 					   REGION_RECTS(region), REGION_NUM_RECTS(region)))
 			return;
 	}
commit 47e6bfa4f40cf7efcfe7eee24d2512d737fd7e89
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 28 12:24:27 2012 +0100

    sna: Force use of per-crtc scanout if the offset is too large
    
    On gen4+, the scanout offset into a tiled surface is specified through
    the DSPTILEOFF register and limited to 12bits of precision. So if we
    have a CRTC positioned in that nether-region, we need to allocate a
    separate per-crtc pixmap for it and perform shadowing.
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/sna.h b/src/sna/sna.h
index 2e8925b..d4cb42f 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -234,6 +234,7 @@ struct sna {
 
 	struct sna_mode {
 		drmModeResPtr kmode;
+		int max_tile_offset;
 
 		int shadow_active;
 		DamagePtr shadow_damage;
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index fed7411..648d5c5 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -790,6 +790,14 @@ static bool use_shadow(struct sna *sna, xf86CrtcPtr crtc)
 		return true;
 	}
 
+	if (crtc->x >= sna->mode.max_tile_offset ||
+	    crtc->y >= sna->mode.max_tile_offset) {
+		DBG(("%s: offset too large (%d, %d) >= %d\n",
+		    __FUNCTION__,
+		    crtc->x, crtc->y, sna->mode.max_tile_offset));
+		return true;
+	}
+
 	transform = NULL;
 	if (crtc->transformPresent)
 		transform = &crtc->transform;
@@ -2201,6 +2209,7 @@ Bool sna_mode_pre_init(ScrnInfoPtr scrn, struct sna *sna)
 			   "failed to get resources: %s\n", strerror(errno));
 		return FALSE;
 	}
+	mode->max_tile_offset = 4096;
 
 	set_size_range(sna);
 
commit 93e77ee019248fe77483e83f2210d584bb5d1be2
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 28 12:02:32 2012 +0100

    sna: Quieten kernel debug complaints when disabling crtc
    
    Even if we are obviously turning the crtc off, it still complains if the
    number of connectors is non-zero. So make it so.
    
    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 b7c5a40..fed7411 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -488,11 +488,12 @@ sna_crtc_apply(xf86CrtcPtr crtc)
 		   sna_crtc->kmode.vdisplay,
 		   sna_crtc->id, sna_crtc->pipe);
 
-	DBG(("%s: applying crtc [%d] mode=%dx%d@%d, fb=%d%s update to %d outputs\n",
+	DBG(("%s: applying crtc [%d] mode=%dx%d+%d+%d@%d, fb=%d%s update to %d outputs\n",
 	     __FUNCTION__, sna_crtc->id,
-	     sna_crtc->kmode.hdisplay,
-	     sna_crtc->kmode.vdisplay,
-	     sna_crtc->kmode.clock,
+	     arg.mode.hdisplay,
+	     arg.mode.vdisplay,
+	     arg.x, arg.y,
+	     arg.mode.clock,
 	     arg.fb_id,
 	     sna_crtc->shadow ? " [shadow]" : "",
 	     output_count));
@@ -593,10 +594,8 @@ sna_crtc_disable(xf86CrtcPtr crtc)
 
 	DBG(("%s: disabling crtc [%d]\n", __FUNCTION__, sna_crtc->id));
 
-	VG_CLEAR(arg);
+	memset(&arg, 0, sizeof(arg));
 	arg.crtc_id = sna_crtc->id;
-	arg.fb_id = 0;
-	arg.mode_valid = 0;
 	(void)drmIoctl(sna->kgem.fd, DRM_IOCTL_MODE_SETCRTC, &arg);
 
 	sna_crtc_disable_shadow(sna, sna_crtc);
commit 85e4f48a87ddbc227af8f4af5ea46ae17902b111
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Thu Jun 28 11:44:45 2012 +0100

    sna: Add a DBG to the periodic flush mechanism
    
    Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>

diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 925e355..76f6cae 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3029,6 +3029,8 @@ bool __kgem_flush(struct kgem *kgem, struct kgem_bo *bo)
 		return false;
 
 	bo->needs_flush = kgem_busy(kgem, bo->handle);
+	DBG(("%s: handle=%d, busy?=%d\n",
+	     __FUNCTION__, bo->handle, bo->needs_flush));
 	return bo->needs_flush;
 }
 
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index a83e5cb..b5e7e92 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -12333,7 +12333,7 @@ static bool has_shadow(struct sna *sna)
 
 static bool need_flush(struct sna *sna, struct sna_pixmap *scanout)
 {
-	DBG(("%s: scanout=%d shadow?=%d || (cpu?=%d || gpu?=%d) && !busy=%d)\n",
+	DBG(("%s: scanout=%d shadow?=%d, (cpu?=%d || gpu?=%d), busy=%d)\n",
 	     __FUNCTION__,
 	     scanout && scanout->gpu_bo ? scanout->gpu_bo->handle : 0,
 	     has_shadow(sna),


More information about the xorg-commit mailing list