diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-18 13:39:33 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-09-18 13:38:47 +0100 |
commit | cd23ac69ffb670468b2993242ce0d596081bbca4 (patch) | |
tree | 5ef3ecf411d0b200abc7a86e4b0ca263c3f9998b /src | |
parent | 22c84d02ade83c39940d76fc616a9122e535606a (diff) |
sna/gen7: Add some ring switching sanity checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/gen7_render.c | 5 | ||||
-rw-r--r-- | src/sna/kgem.h | 1 | ||||
-rw-r--r-- | src/sna/sna_driver.c | 3 |
3 files changed, 7 insertions, 2 deletions
diff --git a/src/sna/gen7_render.c b/src/sna/gen7_render.c index 383caa45..51b002e0 100644 --- a/src/sna/gen7_render.c +++ b/src/sna/gen7_render.c @@ -1784,10 +1784,13 @@ gen7_get_batch(struct sna *sna) DBG(("%s: flushing batch: %d < %d+%d\n", __FUNCTION__, sna->kgem.surface - sna->kgem.nbatch, 150, 4*8)); - kgem_submit(&sna->kgem); + _kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_RENDER); } + assert(sna->kgem.mode == KGEM_RENDER); + assert(sna->kgem.ring == KGEM_RENDER); + if (sna->render_state.gen7.needs_invariant) gen7_emit_invariant(sna); } diff --git a/src/sna/kgem.h b/src/sna/kgem.h index 073635f9..832b3f06 100644 --- a/src/sna/kgem.h +++ b/src/sna/kgem.h @@ -344,6 +344,7 @@ static inline void kgem_set_mode(struct kgem *kgem, enum kgem_mode mode) static inline void _kgem_set_mode(struct kgem *kgem, enum kgem_mode mode) { assert(kgem->mode == KGEM_NONE); + assert(kgem->nbatch == 0); kgem->context_switch(kgem, mode); kgem->mode = mode; } diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index a29227be..aa4031cc 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -386,7 +386,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags) Gamma zeros = { 0.0, 0.0, 0.0 }; int fd; - DBG(("%s\n", __FUNCTION__)); + DBG(("%s flags=%x, numEntities=%d\n", + __FUNCTION__, flags, scrn->numEntities)); if (scrn->numEntities != 1) return FALSE; |