xf86-video-intel: 2 commits - src/sna/gen4_render.c src/sna/sna_display.c
Chris Wilson
ickle at kemper.freedesktop.org
Tue Jan 21 13:41:48 PST 2014
src/sna/gen4_render.c | 12 +++++++-----
src/sna/sna_display.c | 14 ++++++++++++++
2 files changed, 21 insertions(+), 5 deletions(-)
New commits:
commit 2c441079cbd52902d356b652659e2be84726940e
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Tue Jan 21 10:17:03 2014 +0000
sna: Initialise the TearFree shadow output from the current front buffer
Otherwise we may end up in a sitation where we show stale contents for a
(sometimes signification) fraction of a second before it is refreshed
with the correct contents.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73842
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index f274869..9e811ca 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1423,6 +1423,8 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
DBG(("%s: attaching to single shadow pixmap\n", __FUNCTION__));
if (sna->mode.shadow == NULL) {
+ BoxRec box;
+
bo = kgem_create_2d(&sna->kgem,
sna->scrn->virtualX,
sna->scrn->virtualY,
@@ -1432,6 +1434,18 @@ static struct kgem_bo *sna_crtc_attach(xf86CrtcPtr crtc)
if (bo == NULL)
return NULL;
+ box.x1 = box.y1 = 0;
+ box.x2 = sna->scrn->virtualX;
+ box.y2 = sna->scrn->virtualY;
+
+ if (!sna->render.copy_boxes(sna, GXcopy,
+ sna->front, sna_pixmap(sna->front)->gpu_bo, 0, 0,
+ sna->front, bo, 0, 0,
+ &box, 1, COPY_LAST)) {
+ kgem_bo_destroy(&sna->kgem, bo);
+ return NULL;
+ }
+
if (!get_fb(sna, bo,
sna->scrn->virtualX,
sna->scrn->virtualY)) {
commit ac22dd4292841e27bb6147cf1aa7867f36bb2118
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Jan 17 14:33:26 2014 +0000
sna/gen4: Add an ALWAYS_FLUSH debugging option
Still gen4 is cursed. This should restore the plateau we reached with
2.99.907 by forcing a full GPU flush between every operation.
References: https://bugs.freedesktop.org/show_bug.cgi?id=55500
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c
index e239c21..720d5c3 100644
--- a/src/sna/gen4_render.c
+++ b/src/sna/gen4_render.c
@@ -54,6 +54,8 @@
#define FORCE_NONRECTILINEAR_SPANS -1
#define FORCE_FLUSH 1 /* https://bugs.freedesktop.org/show_bug.cgi?id=55500 */
+#define ALWAYS_FLUSH 1
+
#define NO_COMPOSITE 0
#define NO_COMPOSITE_SPANS 0
#define NO_COPY 0
@@ -584,7 +586,7 @@ gen4_emit_pipe_flush(struct sna *sna)
inline static void
gen4_emit_pipe_break(struct sna *sna)
{
-#if 1
+#if !ALWAYS_FLUSH
OUT_BATCH(GEN4_PIPE_CONTROL | (4 - 2));
OUT_BATCH(0);
OUT_BATCH(0);
@@ -1078,7 +1080,7 @@ gen4_emit_state(struct sna *sna,
flush = wm_binding_table & 1;
wm_binding_table &= ~1;
- if (kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) {
+ if (ALWAYS_FLUSH || kgem_bo_is_dirty(op->src.bo) || kgem_bo_is_dirty(op->mask.bo)) {
DBG(("%s: flushing dirty (%d, %d), forced? %d\n", __FUNCTION__,
kgem_bo_is_dirty(op->src.bo),
kgem_bo_is_dirty(op->mask.bo),
@@ -1138,7 +1140,7 @@ gen4_bind_surfaces(struct sna *sna,
offset = sna->render_state.gen4.surface_table;
}
- if (sna->kgem.batch[sna->render_state.gen4.surface_table] == binding_table[0])
+ if (!ALWAYS_FLUSH && sna->kgem.batch[sna->render_state.gen4.surface_table] == binding_table[0])
dirty = 0;
gen4_emit_state(sna, op, offset | dirty);
@@ -1376,7 +1378,7 @@ static void gen4_video_bind_surfaces(struct sna *sna,
src_surf_format);
}
- if (sna->kgem.batch[sna->render_state.gen4.surface_table] == binding_table[0])
+ if (!ALWAYS_FLUSH && sna->kgem.batch[sna->render_state.gen4.surface_table] == binding_table[0])
dirty = 0;
gen4_emit_state(sna, op, offset | dirty);
@@ -2322,7 +2324,7 @@ gen4_copy_bind_surfaces(struct sna *sna, const struct sna_composite_op *op)
offset = sna->render_state.gen4.surface_table;
}
- if (sna->kgem.batch[sna->render_state.gen4.surface_table] == binding_table[0])
+ if (!ALWAYS_FLUSH && sna->kgem.batch[sna->render_state.gen4.surface_table] == binding_table[0])
dirty = 0;
gen4_emit_state(sna, op, offset | dirty);
More information about the xorg-commit
mailing list