From 966c9907c040b4fe4b288b4a9d82598797aee743 Mon Sep 17 00:00:00 2001 From: Pauli Nieminen Date: Sat, 29 Aug 2009 12:08:57 +0300 Subject: libdrm_radeon: Optimize cs_gem_reloc to do less looping. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bo->referenced_in_cs is checked if bo is already in cs. Adding and removing reference in bo is done with atomic operations to allow parallel access to a bo from multiple contexts. cs->id generation code quarentees there is not duplicated ids which limits number of cs->ids to 32. If there is more cs objects rest will get id 0. V2: - Fix configure to check for atomics operations if libdrm_radeon is only selected. - Make atomic operations private to libdrm. This optimization decreases cs_write_reloc share of torcs profiling from 4.3% to 2.6%. Tested-by: Michel Dänzer Signed-off-by: Pauli Nieminen --- radeon/radeon_bo_gem.h | 1 + 1 file changed, 1 insertion(+) (limited to 'radeon/radeon_bo_gem.h') diff --git a/radeon/radeon_bo_gem.h b/radeon/radeon_bo_gem.h index c56c58e9..0af8610b 100644 --- a/radeon/radeon_bo_gem.h +++ b/radeon/radeon_bo_gem.h @@ -38,6 +38,7 @@ struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd); void radeon_bo_manager_gem_dtor(struct radeon_bo_manager *bom); uint32_t radeon_gem_name_bo(struct radeon_bo *bo); +void *radeon_gem_get_reloc_in_cs(struct radeon_bo *bo); int radeon_gem_set_domain(struct radeon_bo *bo, uint32_t read_domains, uint32_t write_domain); int radeon_gem_get_kernel_name(struct radeon_bo *bo, uint32_t *name); #endif -- cgit v1.2.3