summaryrefslogtreecommitdiff
path: root/src/sna/kgem.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-07-01 17:41:41 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2013-07-01 18:11:03 +0100
commit1c8a33a72e29261d6bf5a6c160765cbafa4d0b88 (patch)
tree5604f38f1225bce4b2dc5a4347d322963061f815 /src/sna/kgem.c
parent9cb6756ce16491e42c6e21bc74a5f7de5432510f (diff)
sna: Allow scanouts to be untiled if need be
Fixes regression from commit 77fa8ab08b441934218ddb8f690be1a919f0ec64 [2.21.11] Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Tue Jun 25 22:25:25 2013 +0100 sna: Free just-allocated bo if we fail to set-tiling on CREATE_EXACT Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/kgem.c')
-rw-r--r--src/sna/kgem.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index e0925b2f..ac6e7397 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -3693,13 +3693,14 @@ struct kgem_bo *kgem_create_2d(struct kgem *kgem,
uint32_t pitch, tiled_height, size;
uint32_t handle;
int i, bucket, retry;
+ bool exact = flags & (CREATE_EXACT | CREATE_SCANOUT);
if (tiling < 0)
- tiling = -tiling, flags |= CREATE_EXACT;
+ exact = true, tiling = -tiling;
+
DBG(("%s(%dx%d, bpp=%d, tiling=%d, exact=%d, inactive=%d, cpu-mapping=%d, gtt-mapping=%d, scanout?=%d, prime?=%d, temp?=%d)\n", __FUNCTION__,
- width, height, bpp, tiling,
- !!(flags & CREATE_EXACT),
+ width, height, bpp, tiling, exact,
!!(flags & CREATE_INACTIVE),
!!(flags & CREATE_CPU_MAP),
!!(flags & CREATE_GTT_MAP),
@@ -3998,7 +3999,7 @@ search_again:
}
}
- if (--retry && flags & CREATE_EXACT) {
+ if (--retry && exact) {
if (kgem->gen >= 040) {
for (i = I915_TILING_NONE; i <= I915_TILING_Y; i++) {
if (i == tiling)
@@ -4041,7 +4042,7 @@ search_again:
goto search_again;
}
- if ((flags & CREATE_EXACT) == 0) { /* allow an active near-miss? */
+ if (!exact) { /* allow an active near-miss? */
i = tiling;
while (--i >= 0) {
tiled_height = kgem_surface_size(kgem, kgem->has_relaxed_fencing, flags,