From 37ba075b34130c41bb7a2261bd666af5b29ffaf3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michel=20D=C3=A4nzer?= Date: Fri, 15 Jun 2018 18:23:53 +0200 Subject: Refactor radeon_finish helper Reviewed-by: Alex Deucher --- src/radeon_glamor_wrappers.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src/radeon_glamor_wrappers.c') diff --git a/src/radeon_glamor_wrappers.c b/src/radeon_glamor_wrappers.c index d7374252..94700a7b 100644 --- a/src/radeon_glamor_wrappers.c +++ b/src/radeon_glamor_wrappers.c @@ -58,13 +58,13 @@ radeon_glamor_prepare_access_cpu(ScrnInfoPtr scrn, RADEONInfoPtr info, struct radeon_bo *bo = priv->bo; int ret; - /* When falling back to swrast, flush all pending operations */ - if (need_sync) { - glamor_block_handler(scrn->pScreen); - info->gpu_flushed++; - } - if (!pixmap->devPrivate.ptr) { + /* When falling back to swrast, flush all pending operations */ + if (need_sync) { + glamor_block_handler(scrn->pScreen); + info->gpu_flushed++; + } + ret = radeon_bo_map(bo, 1); if (ret) { xf86DrvMsg(scrn->scrnIndex, X_WARNING, @@ -76,11 +76,10 @@ radeon_glamor_prepare_access_cpu(ScrnInfoPtr scrn, RADEONInfoPtr info, } pixmap->devPrivate.ptr = bo->ptr; - info->gpu_synced = info->gpu_flushed; - } else if (need_sync) { - radeon_bo_wait(bo); - info->gpu_synced = info->gpu_flushed; - } + } else if (need_sync) + radeon_finish(scrn, bo); + + info->gpu_synced = info->gpu_flushed; return TRUE; } -- cgit v1.2.3