summaryrefslogtreecommitdiff
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
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>
-rw-r--r--src/sna/kgem.c11
-rw-r--r--src/sna/sna_accel.c10
-rw-r--r--src/sna/sna_display.c2
-rw-r--r--src/sna/sna_dri.c4
4 files changed, 14 insertions, 13 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,
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 32a74eac..9d8bd4cd 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -1492,7 +1492,7 @@ sna_pixmap_create_mappable_gpu(PixmapPtr pixmap,
create = CREATE_GTT_MAP | CREATE_INACTIVE;
if (pixmap->usage_hint == SNA_CREATE_FB)
- create |= CREATE_EXACT | CREATE_SCANOUT;
+ create |= CREATE_SCANOUT;
priv->gpu_bo =
kgem_create_2d(&sna->kgem,
@@ -2899,7 +2899,7 @@ sna_pixmap_move_area_to_gpu(PixmapPtr pixmap, const BoxRec *box, unsigned int fl
create = CREATE_INACTIVE;
if (pixmap->usage_hint == SNA_CREATE_FB)
- create |= CREATE_EXACT | CREATE_SCANOUT;
+ create |= CREATE_SCANOUT;
tiling = (flags & MOVE_SOURCE_HINT) ? I915_TILING_Y : DEFAULT_TILING;
tiling = sna_pixmap_choose_tiling(pixmap, tiling);
@@ -3621,7 +3621,7 @@ sna_pixmap_move_to_gpu(PixmapPtr pixmap, unsigned flags)
if (flags & MOVE_INPLACE_HINT || (priv->cpu_damage && priv->cpu_bo == NULL))
create = CREATE_GTT_MAP | CREATE_INACTIVE;
if (pixmap->usage_hint == SNA_CREATE_FB)
- create |= CREATE_EXACT | CREATE_SCANOUT;
+ create |= CREATE_SCANOUT;
priv->gpu_bo =
kgem_create_2d(&sna->kgem,
@@ -3987,7 +3987,7 @@ create_upload_tiled_x(struct kgem *kgem,
assert(priv->gpu_bo == NULL);
assert(priv->gpu_damage == NULL);
- create = CREATE_CPU_MAP | CREATE_INACTIVE | CREATE_EXACT;
+ create = CREATE_CPU_MAP | CREATE_INACTIVE;
if (pixmap->usage_hint == SNA_CREATE_FB)
create |= CREATE_SCANOUT;
if (!kgem->has_llc)
@@ -3998,7 +3998,7 @@ create_upload_tiled_x(struct kgem *kgem,
pixmap->drawable.width,
pixmap->drawable.height,
pixmap->drawable.bitsPerPixel,
- I915_TILING_X, create);
+ -I915_TILING_X, create);
return priv->gpu_bo != NULL;
}
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 0b40fb2c..d22eeaaa 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1250,7 +1250,7 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
bo = kgem_create_2d(&sna->kgem,
crtc->mode.HDisplay, crtc->mode.VDisplay,
scrn->bitsPerPixel,
- tiling, CREATE_EXACT | CREATE_SCANOUT);
+ tiling, CREATE_SCANOUT);
if (bo == NULL)
return NULL;
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index ca5f0889..b65ebffe 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -243,7 +243,7 @@ sna_dri_create_buffer(DrawablePtr draw,
struct sna_dri_private *private;
PixmapPtr pixmap;
struct kgem_bo *bo;
- unsigned flags = CREATE_EXACT;
+ unsigned flags = 0;
uint32_t size;
int bpp;
@@ -1612,7 +1612,7 @@ sna_dri_flip_get_back(struct sna *sna, struct sna_dri_frame_event *info)
info->draw->height,
info->draw->bitsPerPixel,
get_private(info->front)->bo->tiling,
- CREATE_SCANOUT | CREATE_EXACT);
+ CREATE_SCANOUT);
if (bo == NULL)
return;