diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-19 15:50:01 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-06-19 16:00:26 +0100 |
commit | cc08f6e0ef54744434fe0fd6d76348ee6099a62d (patch) | |
tree | 40a072d517340bfe4ffa1a5c8c7ff95626755378 | |
parent | f95ed64a11339b801d655ee173f37e01727a4a87 (diff) |
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@PaulSD.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65099
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_accel.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index 0f5c392e..075a09a2 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); |