radv: move is_local up to the winsys level.
We can avoid adding the buffer in the non-local case, this will avoid all the overhead of the indirect call. Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
parent
25660499b6
commit
201b3b8d0d
|
@ -147,6 +147,7 @@ struct radeon_winsys_fence;
|
||||||
|
|
||||||
struct radeon_winsys_bo {
|
struct radeon_winsys_bo {
|
||||||
uint64_t va;
|
uint64_t va;
|
||||||
|
bool is_local;
|
||||||
};
|
};
|
||||||
struct radv_winsys_sem_counts {
|
struct radv_winsys_sem_counts {
|
||||||
uint32_t syncobj_count;
|
uint32_t syncobj_count;
|
||||||
|
@ -284,6 +285,9 @@ static inline void radv_cs_add_buffer(struct radeon_winsys *ws,
|
||||||
struct radeon_winsys_bo *bo,
|
struct radeon_winsys_bo *bo,
|
||||||
uint8_t priority)
|
uint8_t priority)
|
||||||
{
|
{
|
||||||
|
if (bo->is_local)
|
||||||
|
return;
|
||||||
|
|
||||||
ws->cs_add_buffer(cs, bo, priority);
|
ws->cs_add_buffer(cs, bo, priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -333,7 +333,7 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
|
||||||
if (!(flags & RADEON_FLAG_IMPLICIT_SYNC) && ws->info.drm_minor >= 22)
|
if (!(flags & RADEON_FLAG_IMPLICIT_SYNC) && ws->info.drm_minor >= 22)
|
||||||
request.flags |= AMDGPU_GEM_CREATE_EXPLICIT_SYNC;
|
request.flags |= AMDGPU_GEM_CREATE_EXPLICIT_SYNC;
|
||||||
if (flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && ws->info.drm_minor >= 20) {
|
if (flags & RADEON_FLAG_NO_INTERPROCESS_SHARING && ws->info.drm_minor >= 20) {
|
||||||
bo->is_local = true;
|
bo->base.is_local = true;
|
||||||
request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID;
|
request.flags |= AMDGPU_GEM_CREATE_VM_ALWAYS_VALID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ struct radv_amdgpu_winsys_bo {
|
||||||
uint64_t size;
|
uint64_t size;
|
||||||
struct radv_amdgpu_winsys *ws;
|
struct radv_amdgpu_winsys *ws;
|
||||||
bool is_virtual;
|
bool is_virtual;
|
||||||
bool is_local;
|
|
||||||
int ref_count;
|
int ref_count;
|
||||||
|
|
||||||
union {
|
union {
|
||||||
|
|
|
@ -473,7 +473,7 @@ static void radv_amdgpu_cs_add_buffer(struct radeon_winsys_cs *_cs,
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (bo->is_local)
|
if (bo->base.is_local)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
radv_amdgpu_cs_add_buffer_internal(cs, bo->bo, priority);
|
radv_amdgpu_cs_add_buffer_internal(cs, bo->bo, priority);
|
||||||
|
|
Loading…
Reference in New Issue