diff options
author | Alon Levy <alevy@redhat.com> | 2012-05-30 13:44:40 +0300 |
---|---|---|
committer | Alon Levy <alevy@redhat.com> | 2012-06-15 10:36:30 +0300 |
commit | 72a0def8114073c0051f3df880f731d3968cb344 (patch) | |
tree | 677990ef2c774e5ee8804b3377e590cae9d217dd /src | |
parent | 8df3eba368e80f60ce815300b85a567a9b02141c (diff) |
qxl_switch_mode: don't evacuate, just recreate primary surface
In summary, on vt enter we still:
reset
recreate memory slots
clear our mspace allocators
and then do what switch mode below says
On vt leave we still:
reset (this is redundant since the first VGA access will trigger a
reset on the device side)
On switch mode however we only:
destroy primary surface
create primary surface (different size)
Diffstat (limited to 'src')
-rw-r--r-- | src/qxl_driver.c | 33 |
1 files changed, 14 insertions, 19 deletions
diff --git a/src/qxl_driver.c b/src/qxl_driver.c index 0e34a86..54bbd4a 100644 --- a/src/qxl_driver.c +++ b/src/qxl_driver.c @@ -696,19 +696,14 @@ qxl_switch_mode(SWITCH_MODE_ARGS_DECL) int mode_index = (int)(unsigned long)mode->Private; struct QXLMode *m = qxl->modes + mode_index; ScreenPtr pScreen; - void *evacuated; - - evacuated = qxl_surface_cache_evacuate_all (qxl->surface_cache); if (qxl->primary) { qxl_surface_kill (qxl->primary); qxl_surface_cache_sanity_check (qxl->surface_cache); } - - qxl_reset_and_create_mem_slots (qxl); - - ErrorF ("done reset\n"); + + qxl_io_destroy_primary(qxl); qxl->primary = qxl_surface_cache_create_primary (qxl->surface_cache, m); qxl->current_mode = m; @@ -725,19 +720,7 @@ qxl_switch_mode(SWITCH_MODE_ARGS_DECL) set_surface (root, qxl->primary); } - - ErrorF ("primary is %p\n", qxl->primary); - if (qxl->mem) - { - qxl_mem_free_all (qxl->mem); - qxl_drop_image_cache (qxl); - } - - if (qxl->surf_mem) - qxl_mem_free_all (qxl->surf_mem); - qxl_surface_cache_replace_all (qxl->surface_cache, evacuated); - return TRUE; } @@ -1256,8 +1239,20 @@ qxl_enter_vt(VT_FUNC_ARGS_DECL) qxl_screen_t *qxl = pScrn->driverPrivate; qxl_save_state(pScrn); + + qxl_reset_and_create_mem_slots (qxl); + qxl_switch_mode(SWITCH_MODE_ARGS(pScrn, pScrn->currentMode)); + if (qxl->mem) + { + qxl_mem_free_all (qxl->mem); + qxl_drop_image_cache (qxl); + } + + if (qxl->surf_mem) + qxl_mem_free_all (qxl->surf_mem); + if (qxl->vt_surfaces) { qxl_surface_cache_replace_all (qxl->surface_cache, qxl->vt_surfaces); |