summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2009-07-03 15:03:03 +0200
committerJerome Glisse <jglisse@redhat.com>2009-07-03 15:03:03 +0200
commit72a29340ea3225550db6b009f4e50c77c7b1f394 (patch)
treecb1b4691724b82eeea3815a4d416bde4399b7ba5
parentaf90222c4570ca07c6983f60ebe46c35bc980495 (diff)
radeon: fix cs buffer realloc padding
We always realloc at least 0x1000 dwords (page on most system) when growing the cs buffer this is to avoid having to realloc at each cs_begin.
-rw-r--r--libdrm/radeon/radeon_cs_gem.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/libdrm/radeon/radeon_cs_gem.c b/libdrm/radeon/radeon_cs_gem.c
index edba5173..e06f2222 100644
--- a/libdrm/radeon/radeon_cs_gem.c
+++ b/libdrm/radeon/radeon_cs_gem.c
@@ -225,9 +225,8 @@ static int cs_gem_begin(struct radeon_cs *cs,
if (cs->cdw + ndw > cs->ndw) {
uint32_t tmp, *ptr;
- int num = (ndw > 0x3FF) ? ndw : 0x3FF;
- tmp = (cs->ndw + 1 + num) & (~num);
+ tmp = (cs->ndw + 1 + 0x3FF) & (~0x3FF);
ptr = (uint32_t*)realloc(cs->packets, 4 * tmp);
if (ptr == NULL) {
return -ENOMEM;