We were adding pad to size after creating the object, so we could
submit a CS bigger than the bo created for it.
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Signed-off-by: Dave Airlie <airlied@redhat.com>
uint32_t *ptr;
unsigned cnt = 0;
unsigned size = 0;
-
+ unsigned pad_words = 0;
if (preamble_cs)
size += preamble_cs->cdw;
++cnt;
}
+ while(!size || (size & 7)) {
+ size++;
+ pad_words++;
+ }
assert(cnt);
bo = ws->buffer_create(ws, 4 * size, 4096, RADEON_DOMAIN_GTT, RADEON_FLAG_CPU_ACCESS);
}
- while(!size || (size & 7)) {
+ for (unsigned j = 0; j < pad_words; ++j)
*ptr++ = pad_word;
- ++size;
- }
memset(&request, 0, sizeof(request));