From 9270e4c2ce9542de7199dafac243ad6d0bb53c82 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 12 Feb 2014 16:44:50 +0000 Subject: [PATCH 2/2] sna/gen5: Try not to mark the destination as dirty too often Similar to the tricks performed by the later generation, if the destination does not change, presume that the render cache will not need flushing. References: https://bugs.freedesktop.org/show_bug.cgi?id=74882 Signed-off-by: Chris Wilson --- src/sna/gen5_render.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index d5856ea..5203ba1 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -1104,6 +1104,8 @@ static void gen5_bind_surfaces(struct sna *sna, offset = sna->render_state.gen5.surface_table; } + if (sna->kgem.batch[sna->render_state.gen5.surface_table] == binding_table[0]) + dirty = 0; gen5_emit_state(sna, op, offset | dirty); } @@ -1337,6 +1339,8 @@ static void gen5_video_bind_surfaces(struct sna *sna, src_surf_format); } + if (sna->kgem.batch[sna->render_state.gen5.surface_table] == binding_table[0]) + dirty = 0; gen5_emit_state(sna, op, offset | dirty); } @@ -2281,6 +2285,8 @@ gen5_copy_bind_surfaces(struct sna *sna, offset = sna->render_state.gen5.surface_table; } + if (sna->kgem.batch[sna->render_state.gen5.surface_table] == binding_table[0]) + dirty = 0; gen5_emit_state(sna, op, offset | dirty); } @@ -2632,6 +2638,8 @@ gen5_fill_bind_surfaces(struct sna *sna, offset = sna->render_state.gen5.surface_table; } + if (sna->kgem.batch[sna->render_state.gen5.surface_table] == binding_table[0]) + dirty = 0; gen5_emit_state(sna, op, offset | dirty); } -- 1.7.9.5