diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-11-09 11:34:16 +0100 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-11-09 14:04:11 +0100 |
commit | 70487eee975c63b5ed1492927bbc661425278276 (patch) | |
tree | 618f78c75d0da3408d3f53c84da31e34a49c7e41 | |
parent | e1810e0b09e07bdab05a57fdef74450a507e9dfa (diff) | |
download | xf86-video-vmware-70487eee975c63b5ed1492927bbc661425278276.tar.gz xf86-video-vmware-70487eee975c63b5ed1492927bbc661425278276.tar.bz2 xf86-video-vmware-70487eee975c63b5ed1492927bbc661425278276.zip |
vmwgfx: Make sure we don't render when VT switched
When compiz is enabled, we may try to DMA sw rendered contents of dri2
drawables to surfaces while VT switched. I'm not sure how this could be
happening, but queue the DMA until the next block handler.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Alan Hourihane <alanh@vmware.com>
-rw-r--r-- | vmwgfx/vmwgfx_driver.c | 1 | ||||
-rw-r--r-- | vmwgfx/vmwgfx_saa.c | 22 |
2 files changed, 16 insertions, 7 deletions
diff --git a/vmwgfx/vmwgfx_driver.c b/vmwgfx/vmwgfx_driver.c index 0504c2d..a3d7860 100644 --- a/vmwgfx/vmwgfx_driver.c +++ b/vmwgfx/vmwgfx_driver.c @@ -652,6 +652,7 @@ static void drv_block_handler(int i, pointer blockData, pointer pTimeout, pScreen->BlockHandler(i, blockData, pTimeout, pReadmask); vmwgfx_swap(ms, pScreen, BlockHandler); + vmwgfx_flush_dri2(pScreen); xorg_flush(pScreen); } diff --git a/vmwgfx/vmwgfx_saa.c b/vmwgfx/vmwgfx_saa.c index ad3adf8..d14c551 100644 --- a/vmwgfx/vmwgfx_saa.c +++ b/vmwgfx/vmwgfx_saa.c @@ -460,6 +460,10 @@ vmwgfx_flush_dri2(ScreenPtr pScreen) struct vmwgfx_saa *vsaa = to_vmwgfx_saa(saa_get_driver(pScreen)); struct _WsbmListHead *list, *next; + ScrnInfoPtr pScrn = xf86Screens[pScreen->myNum]; + + if (!pScrn->vtSema) + return; WSBMLISTFOREACHSAFE(list, next, &vsaa->sync_x_list) { struct vmwgfx_saa_pixmap *vpix = @@ -1179,21 +1183,25 @@ vmwgfx_operation_complete(struct saa_driver *driver, struct vmwgfx_saa *vsaa = to_vmwgfx_saa(driver); struct saa_pixmap *spix = saa_get_saa_pixmap(pixmap); struct vmwgfx_saa_pixmap *vpix = to_vmwgfx_saa_pixmap(spix); + ScrnInfoPtr pScrn = xf86Screens[vsaa->pScreen->myNum]; /* * Make dri2 drawables up to date, or add them to the flush list - * executed at glxWaitX(). + * executed at glxWaitX(). Currently glxWaitX() is broken, so + * we flush immediately, unless we're VT-switched away, in which + * case a flush would deadlock in the kernel. */ if (vpix->hw && vpix->hw_is_dri2_fronts) { - if (1) { - if (!vmwgfx_upload_to_hw(driver, pixmap, &spix->dirty_shadow)) - return; + if (1 && pScrn->vtSema && + vmwgfx_upload_to_hw(driver, pixmap, &spix->dirty_shadow)) { + REGION_EMPTY(vsaa->pScreen, &spix->dirty_shadow); - } else { - if (WSBMLISTEMPTY(&vpix->sync_x_head)) - WSBMLISTADDTAIL(&vpix->sync_x_head, &vsaa->sync_x_list); + return; } + + if (WSBMLISTEMPTY(&vpix->sync_x_head)) + WSBMLISTADDTAIL(&vpix->sync_x_head, &vsaa->sync_x_list); } } |