summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-21 21:52:46 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-21 21:52:46 +0000
commit38ef572d68380db407039fe12d62426939030010 (patch)
tree1b60117725a0c555db07c3a37d215f3dd4ba2e31 /src
parentdee2db883954d9ce3560b81f84d5c805edfd3977 (diff)
sna: XY_SETUP_* expects the dst tiling to be set on gen4+
A few paths failed to set the tiling flag when setting up the BLT engine, leaving the engine in a potentially inconsistent state. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71260 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_accel.c32
-rw-r--r--src/sna/sna_blt.c16
2 files changed, 32 insertions, 16 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 75a6b27e..7238cbe6 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -11427,7 +11427,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -11446,7 +11446,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
0);
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_BLT | 3 << 20 | 6;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 6;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -11512,7 +11512,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -11531,7 +11531,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
0);
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_BLT | 3 << 20 | 6;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 6;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -11571,7 +11571,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -11590,7 +11590,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
0);
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_BLT | 3 << 20 | 6;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 6;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -11665,7 +11665,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -11684,7 +11684,7 @@ sna_poly_fill_rect_tiled_8x8_blt(DrawablePtr drawable,
0);
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_BLT | 3 << 20 | 6;
+ b[0] = XY_SETUP_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 6;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12173,7 +12173,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12189,7 +12189,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
b[9] = pat[1];
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 7;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 7;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12245,7 +12245,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12261,7 +12261,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
b[9] = pat[1];
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 7;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 7;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12295,7 +12295,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12311,7 +12311,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
b[9] = pat[1];
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 7;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 7;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12367,7 +12367,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
assert(sna->kgem.mode == KGEM_BLT);
b = sna->kgem.batch + sna->kgem.nbatch;
if (sna->kgem.gen >= 0100) {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 8;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 8;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -12383,7 +12383,7 @@ sna_poly_fill_rect_stippled_8x8_blt(DrawablePtr drawable,
b[9] = pat[1];
sna->kgem.nbatch += 10;
} else {
- b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | 7;
+ b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 3 << 20 | (br00 & BLT_DST_TILED) | 7;
b[1] = br13;
b[2] = 0;
b[3] = 0;
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c
index 17a785c2..8f7b8a3e 100644
--- a/src/sna/sna_blt.c
+++ b/src/sna/sna_blt.c
@@ -186,6 +186,8 @@ static bool sna_blt_fill_init(struct sna *sna,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 8;
if (bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (bo->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = blt->br13;
b[2] = 0;
b[3] = 0;
@@ -204,6 +206,8 @@ static bool sna_blt_fill_init(struct sna *sna,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 7;
if (bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (bo->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = blt->br13;
b[2] = 0;
b[3] = 0;
@@ -246,6 +250,8 @@ noinline static void sna_blt_fill_begin(struct sna *sna,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 8;
if (blt->bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (blt->bo[0]->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = blt->br13;
b[2] = 0;
b[3] = 0;
@@ -264,6 +270,8 @@ noinline static void sna_blt_fill_begin(struct sna *sna,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 7;
if (blt->bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (blt->bo[0]->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = blt->br13;
b[2] = 0;
b[3] = 0;
@@ -3081,6 +3089,8 @@ bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 8;
if (bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (bo->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -3099,6 +3109,8 @@ bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 7;
if (bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (bo->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -3163,6 +3175,8 @@ bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 8;
if (bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (bo->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = br13;
b[2] = 0;
b[3] = 0;
@@ -3181,6 +3195,8 @@ bool sna_blt_fill_boxes(struct sna *sna, uint8_t alu,
b[0] = XY_SETUP_MONO_PATTERN_SL_BLT | 7;
if (bpp == 32)
b[0] |= BLT_WRITE_ALPHA | BLT_WRITE_RGB;
+ if (bo->tiling)
+ b[0] |= BLT_DST_TILED;
b[1] = br13;
b[2] = 0;
b[3] = 0;