mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
winsys/amdgpu: don't assume GTT if the VRAM flag isn't set
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
This commit is contained in:
parent
6df872df59
commit
35d284d08e
1 changed files with 3 additions and 3 deletions
|
|
@ -145,7 +145,7 @@ void amdgpu_bo_destroy(struct pb_buffer *_buf)
|
||||||
if (bo->map_count >= 1) {
|
if (bo->map_count >= 1) {
|
||||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||||
bo->ws->mapped_vram -= bo->base.size;
|
bo->ws->mapped_vram -= bo->base.size;
|
||||||
else
|
else if (bo->initial_domain & RADEON_DOMAIN_GTT)
|
||||||
bo->ws->mapped_gtt -= bo->base.size;
|
bo->ws->mapped_gtt -= bo->base.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -261,7 +261,7 @@ static void *amdgpu_bo_map(struct pb_buffer *buf,
|
||||||
if (p_atomic_inc_return(&bo->map_count) == 1) {
|
if (p_atomic_inc_return(&bo->map_count) == 1) {
|
||||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||||
bo->ws->mapped_vram += bo->base.size;
|
bo->ws->mapped_vram += bo->base.size;
|
||||||
else
|
else if (bo->initial_domain & RADEON_DOMAIN_GTT)
|
||||||
bo->ws->mapped_gtt += bo->base.size;
|
bo->ws->mapped_gtt += bo->base.size;
|
||||||
}
|
}
|
||||||
return cpu;
|
return cpu;
|
||||||
|
|
@ -277,7 +277,7 @@ static void amdgpu_bo_unmap(struct pb_buffer *buf)
|
||||||
if (p_atomic_dec_zero(&bo->map_count)) {
|
if (p_atomic_dec_zero(&bo->map_count)) {
|
||||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
||||||
bo->ws->mapped_vram -= bo->base.size;
|
bo->ws->mapped_vram -= bo->base.size;
|
||||||
else
|
else if (bo->initial_domain & RADEON_DOMAIN_GTT)
|
||||||
bo->ws->mapped_gtt -= bo->base.size;
|
bo->ws->mapped_gtt -= bo->base.size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue