xf86-video-intel: 3 commits - src/sna/gen2_render.c src/sna/gen3_render.c src/sna/kgem.c src/sna/kgem.h
Chris Wilson
ickle at kemper.freedesktop.org
Tue Jul 5 13:56:49 PDT 2011
src/sna/gen2_render.c | 4 ++--
src/sna/gen3_render.c | 14 +++-----------
src/sna/kgem.c | 44 +++++++++++++++++++++++++-------------------
src/sna/kgem.h | 1 -
4 files changed, 30 insertions(+), 33 deletions(-)
New commits:
commit 5fa3e73f2c03bcadb87c1760f76f853c22fdba18
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Jul 5 21:38:08 2011 +0100
sna/gen[23]: Do as the comments suggest and prefer the BLT
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c
index 97ae7c2..ccee626 100644
--- a/src/sna/gen2_render.c
+++ b/src/sna/gen2_render.c
@@ -1922,7 +1922,7 @@ gen2_render_fill(struct sna *sna, uint8_t alu,
#endif
/* Prefer to use the BLT if already engaged */
- if (!PREFER_FILL && sna->kgem.mode == KGEM_BLT &&
+ if (!PREFER_FILL && sna->kgem.mode != KGEM_RENDER &&
sna_blt_fill(sna, alu,
dst_bo, dst->drawable.bitsPerPixel,
color,
@@ -2186,7 +2186,7 @@ gen2_render_copy(struct sna *sna, uint8_t alu,
#endif
/* Prefer to use the BLT */
- if (!PREFER_COPY && sna->kgem.mode == KGEM_BLT &&
+ if (!PREFER_COPY && sna->kgem.mode != KGEM_RENDER &&
sna_blt_compare_depth(&src->drawable, &dst->drawable) &&
sna_blt_copy(sna, alu,
src_bo, dst_bo,
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c
index ee8de2d..4b59f40 100644
--- a/src/sna/gen3_render.c
+++ b/src/sna/gen3_render.c
@@ -1082,17 +1082,12 @@ static void gen3_emit_invariant(struct sna *sna)
CSB_TCB(6, 6) |
CSB_TCB(7, 7));
- OUT_BATCH(_3DSTATE_MODES_4_CMD |
- ENABLE_LOGIC_OP_FUNC |
- LOGIC_OP_FUNC(LOGICOP_COPY));
-
- OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | I1_LOAD_S(5) | 2);
+ OUT_BATCH(_3DSTATE_LOAD_STATE_IMMEDIATE_1 | I1_LOAD_S(3) | I1_LOAD_S(4) | 1);
OUT_BATCH(0x00000000); /* Disable texture coordinate wrap-shortest */
OUT_BATCH((1 << S4_POINT_WIDTH_SHIFT) |
S4_LINE_WIDTH_ONE |
S4_CULLMODE_NONE |
S4_VFMT_XY);
- OUT_BATCH(0x00000000); /* Stencil. */
OUT_BATCH(_3DSTATE_SCISSOR_ENABLE_CMD | DISABLE_SCISSOR_RECT);
OUT_BATCH(_3DSTATE_DEPTH_SUBRECT_DISABLE);
@@ -1100,9 +1095,6 @@ static void gen3_emit_invariant(struct sna *sna)
OUT_BATCH(_3DSTATE_LOAD_INDIRECT);
OUT_BATCH(0x00000000);
- OUT_BATCH(_3DSTATE_STIPPLE);
- OUT_BATCH(0x00000000);
-
sna->render_state.gen3.need_invariant = FALSE;
}
@@ -3409,7 +3401,7 @@ gen3_render_copy(struct sna *sna, uint8_t alu,
#endif
/* Prefer to use the BLT */
- if (sna->kgem.mode == KGEM_BLT &&
+ if (sna->kgem.mode != KGEM_RENDER &&
sna_blt_compare_depth(&src->drawable, &dst->drawable) &&
sna_blt_copy(sna, alu,
src_bo, dst_bo,
@@ -3633,7 +3625,7 @@ gen3_render_fill(struct sna *sna, uint8_t alu,
#endif
/* Prefer to use the BLT if already engaged */
- if (sna->kgem.mode == KGEM_BLT &&
+ if (sna->kgem.mode != KGEM_RENDER &&
sna_blt_fill(sna, alu,
dst_bo, dst->drawable.bitsPerPixel,
color,
commit f749ed618e21b56a36a2feb9b4333ec797ec2ae5
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Jul 5 21:37:02 2011 +0100
sna: Reduce tiling if pitch is less than a tile_width/height only on pre-G33
(Note this only applies to 2D pixmaps.)
The rationale, borne out by experimentation with cairo-perf-trace, is
that on the pre-G33 devices we always need a fence region region
for tiled surfaces, i.e. at least .5/1MiB in size, and that combined
with the smaller GTT on those devices, we loose the benefit of tiling to
the excessive GTT thrashing.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 9509dbe..87acb49 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -1172,26 +1172,32 @@ int kgem_choose_tiling(struct kgem *kgem, int tiling, int width, int height, int
return -tiling;
}
- if (tiling == I915_TILING_Y && height < 16) {
- DBG(("%s: too short [%d] for TILING_Y\n",
- __FUNCTION__,height));
- tiling = I915_TILING_X;
- }
- if (tiling == I915_TILING_X && height < 4) {
- DBG(("%s: too short [%d] for TILING_X\n",
- __FUNCTION__, height));
- tiling = I915_TILING_NONE;
- }
+ /* Before the G33, we only have a small GTT to play with and tiled
+ * surfaces always require full fence regions and so cause excessive
+ * aperture thrashing.
+ */
+ if (kgem->gen < 33) {
+ if (tiling == I915_TILING_Y && height < 16) {
+ DBG(("%s: too short [%d] for TILING_Y\n",
+ __FUNCTION__,height));
+ tiling = I915_TILING_X;
+ }
+ if (tiling == I915_TILING_X && height < 4) {
+ DBG(("%s: too short [%d] for TILING_X\n",
+ __FUNCTION__, height));
+ tiling = I915_TILING_NONE;
+ }
- if (tiling == I915_TILING_X && width * bpp < 512/2) {
- DBG(("%s: too thin [%d] for TILING_X\n",
- __FUNCTION__, width));
- tiling = I915_TILING_NONE;
- }
- if (tiling == I915_TILING_Y && width * bpp < 32/2) {
- DBG(("%s: too thin [%d] for TILING_Y\n",
- __FUNCTION__, width));
- tiling = I915_TILING_NONE;
+ if (tiling == I915_TILING_X && width * bpp < 8*512/2) {
+ DBG(("%s: too thin [%d] for TILING_X\n",
+ __FUNCTION__, width));
+ tiling = I915_TILING_NONE;
+ }
+ if (tiling == I915_TILING_Y && width * bpp < 8*32/2) {
+ DBG(("%s: too thin [%d] for TILING_Y\n",
+ __FUNCTION__, width));
+ tiling = I915_TILING_NONE;
+ }
}
DBG(("%s: %dx%d -> %d\n", __FUNCTION__, width, height, tiling));
commit b9de6a98d33db660ffad3f186c2b0ab2aea71ac0
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Jul 5 17:48:11 2011 +0100
sna: Remove unused aperture_size member
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 0ee63bd..6c1f656 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -49,7 +49,6 @@ struct kgem_bo {
uint32_t handle;
uint32_t presumed_offset;
uint32_t size;
- uint32_t aperture_size;
uint32_t delta;
uint32_t pitch : 16;
More information about the xorg-commit
mailing list