diff options
Diffstat (limited to 'src/sna/gen6_render.c')
-rw-r--r-- | src/sna/gen6_render.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/sna/gen6_render.c b/src/sna/gen6_render.c index ee1686fc..401041c2 100644 --- a/src/sna/gen6_render.c +++ b/src/sna/gen6_render.c @@ -3622,10 +3622,19 @@ gen6_render_context_switch(struct kgem *kgem, int new_mode) { if (kgem->nbatch) { - DBG(("%s: from %d to %d\n", __FUNCTION__, kgem->mode, new_mode)); + DBG(("%s: from %d to %d, submit batch\n", __FUNCTION__, kgem->mode, new_mode)); _kgem_submit(kgem); } + if (kgem->nexec) { + DBG(("%s: from %d to %d, reset incomplete batch\n", __FUNCTION__, kgem->mode, new_mode)); + kgem_reset(kgem); + } + + assert(kgem->nbatch == 0); + assert(kgem->nreloc == 0); + assert(kgem->nexec == 0); + kgem->ring = new_mode; } |