aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauli Nieminen2009-08-18 10:51:38 -0500
committerAlex Deucher2009-08-18 13:54:25 -0500
commit8c43b79b21929e9e54e13e892f7787e222e73f39 (patch)
treed719785fe33f96ccffeae4fd8c0da8ab78b6553a /libdrm/radeon/radeon_cs.h
parenta474fd978c0dedbed21b5dff24126acb1c7effef (diff)
downloadexternal-libgbm-8c43b79b21929e9e54e13e892f7787e222e73f39.tar.gz
external-libgbm-8c43b79b21929e9e54e13e892f7787e222e73f39.tar.xz
external-libgbm-8c43b79b21929e9e54e13e892f7787e222e73f39.zip
libdrm_radeon: Optimize copy of table to cs buffer with specialized call.
Using this call in OUT_BATCH_TABLE reduces radeonEmitState cpu usage from 9% to 5% and emit_vpu goes from 7% to 1.5%. I did use calgrind to profile gears for cpu hotspots with r500 card. Signed-off-by: Pauli Nieminen <suokkos@gmail.com>
Diffstat (limited to 'libdrm/radeon/radeon_cs.h')
-rw-r--r--libdrm/radeon/radeon_cs.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/libdrm/radeon/radeon_cs.h b/libdrm/radeon/radeon_cs.h
index 7efec7e8..1117a850 100644
--- a/libdrm/radeon/radeon_cs.h
+++ b/libdrm/radeon/radeon_cs.h
@@ -201,6 +201,15 @@ static inline void radeon_cs_write_qword(struct radeon_cs *cs, uint64_t qword)
201 } 201 }
202} 202}
203 203
204static inline void radeon_cs_write_table(struct radeon_cs *cs, void *data, uint32_t size)
205{
206 memcpy(cs->packets + cs->cdw, data, size * 4);
207 cs->cdw += size;
208 if (cs->section) {
209 cs->section_cdw += size;
210 }
211}
212
204static inline void radeon_cs_space_set_flush(struct radeon_cs *cs, void (*fn)(void *), void *data) 213static inline void radeon_cs_space_set_flush(struct radeon_cs *cs, void (*fn)(void *), void *data)
205{ 214{
206 cs->space_flush_fn = fn; 215 cs->space_flush_fn = fn;