v1: Fix skipped slab allocators and the buffer cache.
v2: Use only 1 domain for texture allocation
v3: Added flag for the create_fence call too
Based on Marek v1 and v2 proposed fixes.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=
1107812.patch
Cc: 19.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
q->buf = r300->rws->buffer_create(r300->rws,
r300screen->info.gart_page_size,
r300screen->info.gart_page_size,
- RADEON_DOMAIN_GTT, 0);
+ RADEON_DOMAIN_GTT,
+ RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (!q->buf) {
FREE(q);
return NULL;
r300->vbo = rws->buffer_create(rws,
MAX2(R300_MAX_DRAW_VBO_SIZE, size),
R300_BUFFER_ALIGNMENT,
- RADEON_DOMAIN_GTT, 0);
+ RADEON_DOMAIN_GTT,
+ RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (!r300->vbo) {
return FALSE;
}
/* Create a new one in the same pipe_resource. */
new_buf = r300->rws->buffer_create(r300->rws, rbuf->b.b.width0,
R300_BUFFER_ALIGNMENT,
- rbuf->domain, 0);
+ rbuf->domain,
+ RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (new_buf) {
/* Discard the old buffer. */
pb_reference(&rbuf->buf, NULL);
rbuf->buf =
r300screen->rws->buffer_create(r300screen->rws, rbuf->b.b.width0,
R300_BUFFER_ALIGNMENT,
- rbuf->domain, 0);
+ rbuf->domain,
+ RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (!rbuf->buf) {
FREE(rbuf);
return NULL;
/* Create the backing buffer if needed. */
if (!tex->buf) {
+ /* Only use the first domain for allocation. Multiple domains are not allowed. */
+ unsigned alloc_domain =
+ tex->domain & RADEON_DOMAIN_VRAM ? RADEON_DOMAIN_VRAM :
+ RADEON_DOMAIN_GTT;
+
tex->buf = rws->buffer_create(rws, tex->tex.size_in_bytes, 2048,
- tex->domain, RADEON_FLAG_NO_SUBALLOC);
+ alloc_domain,
+ RADEON_FLAG_NO_SUBALLOC |
+ /* Use the reusable pool: */
+ RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (!tex->buf) {
goto fail;
/* Create a fence, which is a dummy BO. */
fence = cs->ws->base.buffer_create(&cs->ws->base, 1, 1,
- RADEON_DOMAIN_GTT, RADEON_FLAG_NO_SUBALLOC);
+ RADEON_DOMAIN_GTT,
+ RADEON_FLAG_NO_SUBALLOC
+ | RADEON_FLAG_NO_INTERPROCESS_SHARING);
if (!fence)
return NULL;