From 296b8990956fcbd7ce47902d7c108a5973db9397 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Sun, 7 Aug 2011 18:42:29 +0200 Subject: [PATCH] winsys/radeon: remove broken bo-is-busy-for-write guessing Reviewed-by: Alex Deucher --- src/gallium/winsys/radeon/drm/radeon_drm_bo.c | 19 ------------------- src/gallium/winsys/radeon/drm/radeon_drm_bo.h | 7 ------- src/gallium/winsys/radeon/drm/radeon_drm_cs.c | 5 ----- 3 files changed, 31 deletions(-) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c index 609a906..1c8a2b8 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.c @@ -99,8 +99,6 @@ static void radeon_bo_wait(struct pb_buffer *_buf) args.handle = bo->handle; while (drmCommandWriteRead(bo->rws->fd, DRM_RADEON_GEM_WAIT_IDLE, &args, sizeof(args)) == -EBUSY); - - bo->busy_for_write = FALSE; } static boolean radeon_bo_is_busy(struct pb_buffer *_buf) @@ -117,8 +115,6 @@ static boolean radeon_bo_is_busy(struct pb_buffer *_buf) busy = drmCommandWriteRead(bo->rws->fd, DRM_RADEON_GEM_BUSY, &args, sizeof(args)) != 0; - if (!busy) - bo->busy_for_write = FALSE; return busy; } @@ -196,21 +192,6 @@ static void *radeon_bo_map_internal(struct pb_buffer *_buf, /* XXX We could check whether the buffer is busy for write here. */ radeon_bo_wait((struct pb_buffer*)bo); } -#if 0 - /* XXX This per-winsys busy-for-write tracking sucks. - * What if some other process wrote something, e.g. using - * DRI2CopyRegion? We wouldn't get the busy_for_write flag - * set, skipping bo_wait. - * We need to move the is-busy-for-write query into the kernel. - */ - } else if (bo->busy_for_write) { - /* Update the busy_for_write field (done by radeon_bo_is_busy) - * and wait if needed. */ - if (radeon_bo_is_busy((struct pb_buffer*)bo)) { - radeon_bo_wait((struct pb_buffer*)bo); - } - } -#endif } else { /* Mapping for write. */ if (radeon_bo_is_referenced_by_cs(cs, bo)) { diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h index f4ea73a..047ea6b 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_bo.h +++ b/src/gallium/winsys/radeon/drm/radeon_drm_bo.h @@ -60,13 +60,6 @@ struct radeon_bo { * thread, is this bo referenced in? */ int num_active_ioctls; - /* Whether the buffer has been relocated for write and is busy since then. - * This field is updated in: - * - radeon_drm_cs_flush (to TRUE if it's relocated for write) - * - radeon_bo_is_busy (to FALSE if it's not busy) - * - radeon_bo_wait (to FALSE) */ - boolean busy_for_write; - boolean flinked; uint32_t flink; }; diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c index 1ec324e..c309354 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_cs.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_cs.c @@ -411,11 +411,6 @@ static void radeon_drm_cs_flush(struct radeon_winsys_cs *rcs, unsigned flags) for (i = 0; i < crelocs; i++) { /* Update the number of active asynchronous CS ioctls for the buffer. */ p_atomic_inc(&cs->csc->relocs_bo[i]->num_active_ioctls); - - /* Update whether the buffer is busy for write. */ - if (cs->csc->relocs[i].write_domain) { - cs->csc->relocs_bo[i]->busy_for_write = TRUE; - } } if (cs->ws->num_cpus > 1 && debug_get_option_thread() && -- 2.7.4