radv/winsys: move the initial BO domain to radeon_winsys_bo
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8763>
This commit is contained in:
parent
35f59e14f8
commit
f5a02d16a6
|
@ -165,6 +165,7 @@ struct radeon_winsys_bo {
|
||||||
uint64_t va;
|
uint64_t va;
|
||||||
bool is_local;
|
bool is_local;
|
||||||
bool vram_no_cpu_access;
|
bool vram_no_cpu_access;
|
||||||
|
enum radeon_bo_domain initial_domain;
|
||||||
};
|
};
|
||||||
struct radv_winsys_sem_counts {
|
struct radv_winsys_sem_counts {
|
||||||
uint32_t syncobj_count;
|
uint32_t syncobj_count;
|
||||||
|
|
|
@ -345,7 +345,7 @@ static void radv_amdgpu_winsys_bo_destroy(struct radeon_winsys_bo *_bo)
|
||||||
amdgpu_bo_free(bo->bo);
|
amdgpu_bo_free(bo->bo);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM) {
|
if (bo->base.initial_domain & RADEON_DOMAIN_VRAM) {
|
||||||
if (bo->base.vram_no_cpu_access) {
|
if (bo->base.vram_no_cpu_access) {
|
||||||
p_atomic_add(&ws->allocated_vram,
|
p_atomic_add(&ws->allocated_vram,
|
||||||
-align64(bo->size, ws->info.gart_page_size));
|
-align64(bo->size, ws->info.gart_page_size));
|
||||||
|
@ -355,7 +355,7 @@ static void radv_amdgpu_winsys_bo_destroy(struct radeon_winsys_bo *_bo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bo->initial_domain & RADEON_DOMAIN_GTT)
|
if (bo->base.initial_domain & RADEON_DOMAIN_GTT)
|
||||||
p_atomic_add(&ws->allocated_gtt,
|
p_atomic_add(&ws->allocated_gtt,
|
||||||
-align64(bo->size, ws->info.gart_page_size));
|
-align64(bo->size, ws->info.gart_page_size));
|
||||||
|
|
||||||
|
@ -495,7 +495,7 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
|
||||||
goto error_va_map;
|
goto error_va_map;
|
||||||
|
|
||||||
bo->bo = buf_handle;
|
bo->bo = buf_handle;
|
||||||
bo->initial_domain = initial_domain;
|
bo->base.initial_domain = initial_domain;
|
||||||
bo->is_shared = false;
|
bo->is_shared = false;
|
||||||
bo->priority = priority;
|
bo->priority = priority;
|
||||||
|
|
||||||
|
@ -624,7 +624,7 @@ radv_amdgpu_winsys_bo_from_ptr(struct radeon_winsys *_ws,
|
||||||
bo->ref_count = 1;
|
bo->ref_count = 1;
|
||||||
bo->ws = ws;
|
bo->ws = ws;
|
||||||
bo->bo = buf_handle;
|
bo->bo = buf_handle;
|
||||||
bo->initial_domain = RADEON_DOMAIN_GTT;
|
bo->base.initial_domain = RADEON_DOMAIN_GTT;
|
||||||
bo->priority = priority;
|
bo->priority = priority;
|
||||||
|
|
||||||
ASSERTED int r = amdgpu_bo_export(buf_handle, amdgpu_bo_handle_type_kms, &bo->bo_handle);
|
ASSERTED int r = amdgpu_bo_export(buf_handle, amdgpu_bo_handle_type_kms, &bo->bo_handle);
|
||||||
|
@ -698,7 +698,7 @@ radv_amdgpu_winsys_bo_from_fd(struct radeon_winsys *_ws,
|
||||||
bo->bo = result.buf_handle;
|
bo->bo = result.buf_handle;
|
||||||
bo->base.va = va;
|
bo->base.va = va;
|
||||||
bo->va_handle = va_handle;
|
bo->va_handle = va_handle;
|
||||||
bo->initial_domain = initial;
|
bo->base.initial_domain = initial;
|
||||||
bo->size = result.alloc_size;
|
bo->size = result.alloc_size;
|
||||||
bo->is_shared = true;
|
bo->is_shared = true;
|
||||||
bo->ws = ws;
|
bo->ws = ws;
|
||||||
|
@ -708,10 +708,10 @@ radv_amdgpu_winsys_bo_from_fd(struct radeon_winsys *_ws,
|
||||||
r = amdgpu_bo_export(result.buf_handle, amdgpu_bo_handle_type_kms, &bo->bo_handle);
|
r = amdgpu_bo_export(result.buf_handle, amdgpu_bo_handle_type_kms, &bo->bo_handle);
|
||||||
assert(!r);
|
assert(!r);
|
||||||
|
|
||||||
if (bo->initial_domain & RADEON_DOMAIN_VRAM)
|
if (bo->base.initial_domain & RADEON_DOMAIN_VRAM)
|
||||||
p_atomic_add(&ws->allocated_vram,
|
p_atomic_add(&ws->allocated_vram,
|
||||||
align64(bo->size, ws->info.gart_page_size));
|
align64(bo->size, ws->info.gart_page_size));
|
||||||
if (bo->initial_domain & RADEON_DOMAIN_GTT)
|
if (bo->base.initial_domain & RADEON_DOMAIN_GTT)
|
||||||
p_atomic_add(&ws->allocated_gtt,
|
p_atomic_add(&ws->allocated_gtt,
|
||||||
align64(bo->size, ws->info.gart_page_size));
|
align64(bo->size, ws->info.gart_page_size));
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,6 @@ struct radv_amdgpu_winsys_bo {
|
||||||
/* physical bo */
|
/* physical bo */
|
||||||
struct {
|
struct {
|
||||||
amdgpu_bo_handle bo;
|
amdgpu_bo_handle bo;
|
||||||
enum radeon_bo_domain initial_domain;
|
|
||||||
bool is_shared;
|
bool is_shared;
|
||||||
uint32_t bo_handle;
|
uint32_t bo_handle;
|
||||||
struct list_head global_list_item;
|
struct list_head global_list_item;
|
||||||
|
|
Loading…
Reference in New Issue