winsys/amdgpu: remove now-redundant amdgpu_bo_slab_entry::real
The pb_slab pointer can be used to get the BO pointer because pb_slab is inside the BO structure now. Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26643>
This commit is contained in:
@@ -359,7 +359,7 @@ void *amdgpu_bo_map(struct radeon_winsys *rws,
|
||||
if (is_real_bo(bo)) {
|
||||
real = get_real_bo(bo);
|
||||
} else {
|
||||
real = get_slab_entry_bo(bo)->real;
|
||||
real = get_slab_entry_real_bo(bo);
|
||||
offset = bo->va - real->b.va;
|
||||
}
|
||||
|
||||
@@ -399,7 +399,7 @@ void amdgpu_bo_unmap(struct radeon_winsys *rws, struct pb_buffer *buf)
|
||||
|
||||
assert(bo->type != AMDGPU_BO_SPARSE);
|
||||
|
||||
real = is_real_bo(bo) ? get_real_bo(bo) : get_slab_entry_bo(bo)->real;
|
||||
real = is_real_bo(bo) ? get_real_bo(bo) : get_slab_entry_real_bo(bo);
|
||||
|
||||
if (real->is_user_ptr)
|
||||
return;
|
||||
@@ -737,8 +737,6 @@ struct pb_slab *amdgpu_bo_slab_alloc(void *priv, unsigned heap, unsigned entry_s
|
||||
bo->b.va = slab_bo->b.b.b.va + i * entry_size;
|
||||
bo->b.unique_id = base_id + i;
|
||||
|
||||
bo->real = &slab_bo->b.b;
|
||||
|
||||
bo->entry.slab = &slab_bo->slab;
|
||||
list_addtail(&bo->entry.head, &slab_bo->slab.free);
|
||||
}
|
||||
|
||||
@@ -121,7 +121,6 @@ struct amdgpu_bo_sparse {
|
||||
*/
|
||||
struct amdgpu_bo_slab_entry {
|
||||
struct amdgpu_winsys_bo b;
|
||||
struct amdgpu_bo_real *real;
|
||||
struct pb_slab_entry entry;
|
||||
};
|
||||
|
||||
@@ -168,6 +167,12 @@ static inline struct amdgpu_bo_real_reusable_slab *get_bo_from_slab(struct pb_sl
|
||||
return container_of(slab, struct amdgpu_bo_real_reusable_slab, slab);
|
||||
}
|
||||
|
||||
static struct amdgpu_bo_real *get_slab_entry_real_bo(struct amdgpu_winsys_bo *bo)
|
||||
{
|
||||
assert(bo->type == AMDGPU_BO_SLAB_ENTRY);
|
||||
return &get_bo_from_slab(((struct amdgpu_bo_slab_entry*)bo)->entry.slab)->b.b;
|
||||
}
|
||||
|
||||
bool amdgpu_bo_can_reclaim(struct amdgpu_winsys *ws, struct pb_buffer *_buf);
|
||||
struct pb_buffer *amdgpu_bo_create(struct amdgpu_winsys *ws,
|
||||
uint64_t size,
|
||||
|
||||
@@ -641,7 +641,7 @@ amdgpu_lookup_or_add_slab_buffer(struct amdgpu_cs_context *cs, struct amdgpu_win
|
||||
return buffer;
|
||||
|
||||
struct amdgpu_cs_buffer *real_buffer =
|
||||
amdgpu_lookup_or_add_buffer(cs, &get_slab_entry_bo(bo)->real->b, AMDGPU_BO_REAL);
|
||||
amdgpu_lookup_or_add_buffer(cs, &get_slab_entry_real_bo(bo)->b, AMDGPU_BO_REAL);
|
||||
if (!real_buffer)
|
||||
return NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user