Move batch and 965 render state setup/teardown to screen init/close.

Whether we're VT switched or not shouldn't impact rendering.
This commit is contained in:
Eric Anholt 2010-03-04 09:31:15 -08:00
parent 74e2b69a31
commit faecd155c4
1 changed files with 12 additions and 12 deletions

View File

@ -1182,6 +1182,11 @@ I830ScreenInit(int scrnIndex, ScreenPtr screen, int argc, char **argv)
i830_fixup_mtrrs(scrn);
intel_batch_init(scrn);
if (IS_I965G(intel))
gen4_render_state_init(scrn);
miClearVisualTypes();
if (!miSetVisualTypes(scrn->depth,
miGetDefaultVisualMask(scrn->depth),
@ -1366,13 +1371,6 @@ static void I830LeaveVT(int scrnIndex, int flags)
xf86_hide_cursors(scrn);
intel_sync(scrn);
intel_batch_teardown(scrn);
if (IS_I965G(intel))
gen4_render_state_cleanup(scrn);
ret = drmDropMaster(intel->drmSubFD);
if (ret)
xf86DrvMsg(scrn->scrnIndex, X_WARNING,
@ -1406,11 +1404,6 @@ static Bool I830EnterVT(int scrnIndex, int flags)
if (!i830_reinit_memory(scrn))
return FALSE;
intel_batch_init(scrn);
if (IS_I965G(intel))
gen4_render_state_init(scrn);
if (!xf86SetDesiredModes(scrn))
return FALSE;
@ -1448,6 +1441,13 @@ static Bool I830CloseScreen(int scrnIndex, ScreenPtr screen)
intel->front_buffer = NULL;
}
intel_sync(scrn);
intel_batch_teardown(scrn);
if (IS_I965G(intel))
gen4_render_state_cleanup(scrn);
xf86_cursors_fini(screen);
/* Free most of the allocations */