mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-05 09:00:08 +01:00
winsys/amdgpu: use VRAM for command buffers if all VRAM is visible
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7951>
This commit is contained in:
parent
14f85e1874
commit
d60930c017
1 changed files with 15 additions and 6 deletions
|
|
@ -705,14 +705,23 @@ static bool amdgpu_ib_new_buffer(struct amdgpu_winsys *ws,
|
|||
buffer_size = MIN2(buffer_size, max_size);
|
||||
buffer_size = MAX2(buffer_size, min_size); /* min_size is more important */
|
||||
|
||||
enum radeon_bo_domain domain;
|
||||
unsigned flags = RADEON_FLAG_NO_INTERPROCESS_SHARING;
|
||||
|
||||
if (cs->ring_type == RING_GFX ||
|
||||
cs->ring_type == RING_COMPUTE ||
|
||||
cs->ring_type == RING_DMA) {
|
||||
domain = ws->info.all_vram_visible ? RADEON_DOMAIN_VRAM : RADEON_DOMAIN_GTT;
|
||||
flags |= RADEON_FLAG_32BIT | RADEON_FLAG_GTT_WC;
|
||||
} else {
|
||||
/* UVD/VCE */
|
||||
/* TODO: validate that UVD/VCE don't read from IBs and enable WC or even VRAM. */
|
||||
domain = RADEON_DOMAIN_GTT;
|
||||
}
|
||||
|
||||
pb = amdgpu_bo_create(ws, buffer_size,
|
||||
ws->info.gart_page_size,
|
||||
RADEON_DOMAIN_GTT,
|
||||
RADEON_FLAG_NO_INTERPROCESS_SHARING |
|
||||
(cs->ring_type == RING_GFX ||
|
||||
cs->ring_type == RING_COMPUTE ||
|
||||
cs->ring_type == RING_DMA ?
|
||||
RADEON_FLAG_32BIT | RADEON_FLAG_GTT_WC : 0));
|
||||
domain, flags);
|
||||
if (!pb)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue