diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-27 23:30:06 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-10-27 23:56:34 +0100 |
commit | 48eff1676c4066c8b8e069fd579a1b6fc2329960 (patch) | |
tree | 6f0fcfafd515b04dc93ba30822d8279e86ac7139 | |
parent | f006fac72a733e047b9468704e9c9206f62f96f5 (diff) |
sna/gen2: Reset BLT registers across 2D/3D context switches
It appears the hardware trashes the BLT registers after a 3D context
switch, so we need to reload.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen2_render.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index aa315e68..9e851764 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -2546,10 +2546,22 @@ gen2_render_flush(struct sna *sna) gen2_vertex_flush(sna); } +static void +gen2_render_context_switch(struct kgem *kgem, + int new_mode) +{ + struct sna *sna = container_of(kgem, struct sna, kgem); + + /* Reload BLT registers following a lost context */ + sna->blt_state.fill_bo = 0; +} + Bool gen2_render_init(struct sna *sna) { struct sna_render *render = &sna->render; + sna->kgem.context_switch = gen2_render_context_switch; + /* Use the BLT (and overlay) for everything except when forced to * use the texture combiners. */ |