summaryrefslogtreecommitdiff
path: root/src/radeon_glamor_wrappers.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2018-06-15 18:23:53 +0200
committerMichel Dänzer <michel@daenzer.net>2018-07-09 18:27:45 +0200
commit37ba075b34130c41bb7a2261bd666af5b29ffaf3 (patch)
treee1b372c9191f9924befe7f527309c095c1805157 /src/radeon_glamor_wrappers.c
parent6c986e997159ad0086f940294b244fc4c30b61fc (diff)
Refactor radeon_finish helper
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_glamor_wrappers.c')
-rw-r--r--src/radeon_glamor_wrappers.c21
1 files changed, 10 insertions, 11 deletions
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;
}