mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 13:58:04 +02:00
gallium/radeon: consolidate PIPE_BIND_SHARED/SCANOUT handling
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
3ab0cff32c
commit
f70f6baaa3
2 changed files with 4 additions and 13 deletions
|
|
@ -167,12 +167,10 @@ void si_init_resource_fields(struct r600_common_screen *rscreen,
|
||||||
RADEON_FLAG_GTT_WC;
|
RADEON_FLAG_GTT_WC;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Only displayable single-sample textures can be shared between
|
/* Displayable and shareable surfaces are not suballocated. */
|
||||||
* processes. */
|
if (res->b.b.bind & (PIPE_BIND_SHARED | PIPE_BIND_SCANOUT))
|
||||||
if (!(res->b.b.bind & (PIPE_BIND_SHARED | PIPE_BIND_SCANOUT)) &&
|
res->flags |= RADEON_FLAG_NO_SUBALLOC; /* shareable */
|
||||||
(res->b.b.target == PIPE_BUFFER ||
|
else
|
||||||
res->b.b.nr_samples >= 2 ||
|
|
||||||
rtex->surface.micro_tile_mode != RADEON_MICRO_MODE_DISPLAY))
|
|
||||||
res->flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
|
res->flags |= RADEON_FLAG_NO_INTERPROCESS_SHARING;
|
||||||
|
|
||||||
/* If VRAM is just stolen system memory, allow both VRAM and
|
/* If VRAM is just stolen system memory, allow both VRAM and
|
||||||
|
|
@ -192,9 +190,6 @@ void si_init_resource_fields(struct r600_common_screen *rscreen,
|
||||||
if (rscreen->debug_flags & DBG_NO_WC)
|
if (rscreen->debug_flags & DBG_NO_WC)
|
||||||
res->flags &= ~RADEON_FLAG_GTT_WC;
|
res->flags &= ~RADEON_FLAG_GTT_WC;
|
||||||
|
|
||||||
if (res->b.b.bind & PIPE_BIND_SHARED)
|
|
||||||
res->flags |= RADEON_FLAG_NO_SUBALLOC;
|
|
||||||
|
|
||||||
/* Set expected VRAM and GART usage for the buffer. */
|
/* Set expected VRAM and GART usage for the buffer. */
|
||||||
res->vram_usage = 0;
|
res->vram_usage = 0;
|
||||||
res->gart_usage = 0;
|
res->gart_usage = 0;
|
||||||
|
|
|
||||||
|
|
@ -1219,10 +1219,6 @@ r600_texture_create_object(struct pipe_screen *screen,
|
||||||
si_init_resource_fields(rscreen, resource, rtex->size,
|
si_init_resource_fields(rscreen, resource, rtex->size,
|
||||||
rtex->surface.surf_alignment);
|
rtex->surface.surf_alignment);
|
||||||
|
|
||||||
/* Displayable surfaces are not suballocated. */
|
|
||||||
if (resource->b.b.bind & PIPE_BIND_SCANOUT)
|
|
||||||
resource->flags |= RADEON_FLAG_NO_SUBALLOC;
|
|
||||||
|
|
||||||
if (!si_alloc_resource(rscreen, resource)) {
|
if (!si_alloc_resource(rscreen, resource)) {
|
||||||
FREE(rtex);
|
FREE(rtex);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue