diff options
author | Dave Airlie <airlied@redhat.com> | 2010-08-25 08:56:37 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2010-08-25 10:41:35 +1000 |
commit | 9f13049ddf06f6f2138851a548cfb82f12a52f42 (patch) | |
tree | d0e34bc5035187da1618cd5e75ccea62c3d61df2 | |
parent | 5a7c9d94733a0db1d3565447acc9f0e751db5950 (diff) |
radeon: add correct flushing for direct rendered
this is a port of 69d65f9184006eac790efcff78a0e425160e95aa from the Intel
driver.
Submit batch buffers from flush callback chain
There are a few cases where the server will flush client output buffers
but our block handler only catches the most common (before going into select
If the server flushes client buffers before we submit our batch buffer,
the client may receive a damage event for rendering that hasn't happened yet
Instead, we can hook into the flush callback chain, which the server will
invoke just before flushing output. This lets us submit batch buffers
before sending out events, preserving ordering.
Fixes 28438: [bisected] incorrect character in gnome-terminal under compiz
https://bugs.freedesktop.org/show_bug.cgi?id=28438
Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | src/radeon_kms.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/radeon_kms.c b/src/radeon_kms.c index ba13071f..0d6055dd 100644 --- a/src/radeon_kms.c +++ b/src/radeon_kms.c @@ -191,8 +191,17 @@ static void RADEONBlockHandler_KMS(int i, pointer blockData, if (info->VideoTimerCallback) (*info->VideoTimerCallback)(pScrn, currentTime.milliseconds); +} + +static void +radeon_flush_callback(CallbackListPtr *list, + pointer user_data, pointer call_data) +{ + ScrnInfoPtr pScrn = user_data; - radeon_cs_flush_indirect(pScrn); + if (pScrn->vtSema) { + radeon_cs_flush_indirect(pScrn); + } } static Bool RADEONIsAccelWorking(ScrnInfoPtr pScrn) @@ -713,6 +722,8 @@ static Bool RADEONCloseScreen_KMS(int scrnIndex, ScreenPtr pScreen) if (info->cs) radeon_cs_flush_indirect(pScrn); + DeleteCallback(&FlushCallback, radeon_flush_callback, pScrn); + if (info->accel_state->exa) { exaDriverFini(pScreen); free(info->accel_state->exa); @@ -949,6 +960,10 @@ Bool RADEONScreenInit_KMS(int scrnIndex, ScreenPtr pScreen, pScreen->SaveScreen = RADEONSaveScreen_KMS; info->BlockHandler = pScreen->BlockHandler; pScreen->BlockHandler = RADEONBlockHandler_KMS; + + if (!AddCallback(&FlushCallback, radeon_flush_callback, pScrn)) + return FALSE; + info->CreateScreenResources = pScreen->CreateScreenResources; pScreen->CreateScreenResources = RADEONCreateScreenResources_KMS; |