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

Chris Wilson ickle at kemper.freedesktop.org
Wed Jun 19 08:02:27 PDT 2013


 src/sna/sna_accel.c   |   11 +++++++++++
 src/sna/sna_display.c |    1 +
 2 files changed, 12 insertions(+)

New commits:
commit cc08f6e0ef54744434fe0fd6d76348ee6099a62d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jun 19 15:50:01 2013 +0100

    sna: Apply scanout stride limits to tiling selection
    
    gen4 has a restricted DSPSTRIDE limit for tiled surfaces lower than the
    maximum supported size of the CRTC. So we need to double check
    whether tiling the scanout is supported before attempting to allocate a
    tiled scanout.
    
    Reported-by: Paul Donohue <freedesktop-bugs at PaulSD.com>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65099
    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 0f5c392..075a09a 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -576,7 +576,18 @@ pure static uint32_t sna_pixmap_choose_tiling(PixmapPtr pixmap,
 
 	/* Use tiling by default, but disable per user request */
 	if (pixmap->usage_hint == SNA_CREATE_FB) {
+		unsigned long tiled_limit;
+
 		tiling = -I915_TILING_X;
+
+		if ((sna->kgem.gen >> 3) > 4)
+			tiled_limit = 32 * 1024 * 8;
+		else if ((sna->kgem.gen >> 3) == 4)
+			tiled_limit = 16 * 1024 * 8;
+		else
+			tiled_limit = 8 * 1024 * 8;
+		if ((unsigned long)pixmap->drawable.width * pixmap->drawable.bitsPerPixel > tiled_limit)
+			tiling = I915_TILING_NONE;
 		bit = SNA_TILING_FB;
 	} else {
 		tiling = default_tiling(pixmap, tiling);
commit f95ed64a11339b801d655ee173f37e01727a4a87
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date:   Wed Jun 19 14:47:46 2013 +0100

    sna: Assert that the scanout fits within the allocated buffer
    
    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 bca3b57..f6c3d05 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -191,6 +191,7 @@ static unsigned get_fb(struct sna *sna, struct kgem_bo *bo,
 	assert(bo->refcnt);
 	assert(bo->proxy == NULL);
 	assert(!bo->snoop);
+	assert(height * bo->pitch <= kgem_bo_size(bo)); /* XXX crtc offset */
 	if (bo->delta) {
 		DBG(("%s: reusing fb=%d for handle=%d\n",
 		     __FUNCTION__, bo->delta, bo->handle));


More information about the xorg-commit mailing list