diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-18 20:09:26 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-01-18 20:09:26 +0000 |
commit | 334f3f70a8b4372cb089773ecded8339d2c7d984 (patch) | |
tree | 38035967e363b3e26caf3428a97b8c280349bf78 | |
parent | 76203b70708b8750f52348ea8b9135191e650ff7 (diff) |
sna/gen3: Set the batch mode for emitting video state
The lack of kgem_set_mode() here is causing some recently added
assertions to fail.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen3_render.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index ffcfff69..a833526b 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -3591,29 +3591,12 @@ gen3_emit_video_state(struct sna *sna, static void gen3_video_get_batch(struct sna *sna) { - if (!kgem_check_batch(&sna->kgem, 120)) { - DBG(("%s: flushing batch: nbatch %d < %d\n", - __FUNCTION__, - batch_space(sna), 120)); - kgem_submit(&sna->kgem); - _kgem_set_mode(&sna->kgem, KGEM_RENDER); - } - - if (sna->kgem.nreloc + 4 > KGEM_RELOC_SIZE(&sna->kgem)) { - DBG(("%s: flushing batch: reloc %d >= %d\n", - __FUNCTION__, - sna->kgem.nreloc + 4, - (int)KGEM_RELOC_SIZE(&sna->kgem))); - kgem_submit(&sna->kgem); - _kgem_set_mode(&sna->kgem, KGEM_RENDER); - } + kgem_set_mode(&sna->kgem, KGEM_RENDER); - if (sna->kgem.nexec + 2 > KGEM_EXEC_SIZE(&sna->kgem)) { - DBG(("%s: flushing batch: exec %d >= %d\n", - __FUNCTION__, - sna->kgem.nexec + 2, - (int)KGEM_EXEC_SIZE(&sna->kgem))); - kgem_submit(&sna->kgem); + if (!kgem_check_batch(&sna->kgem, 120) || + !kgem_check_reloc(&sna->kgem, 4) || + !kgem_check_exec(&sna->kgem, 2)) { + _kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_RENDER); } |