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:
Dave Airlie 2017-11-06 04:06:35 +00:00
parent 25660499b6
commit 201b3b8d0d
4 changed files with 6 additions and 3 deletions

View File

@ -147,6 +147,7 @@ struct radeon_winsys_fence;
struct radeon_winsys_bo {
uint64_t va;
bool is_local;
};
struct radv_winsys_sem_counts {
uint32_t syncobj_count;
@ -284,6 +285,9 @@ static inline void radv_cs_add_buffer(struct radeon_winsys *ws,
struct radeon_winsys_bo *bo,
uint8_t priority)
{
if (bo->is_local)
return;
ws->cs_add_buffer(cs, bo, priority);
}

View File

@ -333,7 +333,7 @@ radv_amdgpu_winsys_bo_create(struct radeon_winsys *_ws,
if (!(flags & RADEON_FLAG_IMPLICIT_SYNC) && ws->info.drm_minor >= 22)
request.flags |= AMDGPU_GEM_CREATE_EXPLICIT_SYNC;
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;
}

View File

@ -45,7 +45,6 @@ struct radv_amdgpu_winsys_bo {
uint64_t size;
struct radv_amdgpu_winsys *ws;
bool is_virtual;
bool is_local;
int ref_count;
union {

View File

@ -473,7 +473,7 @@ static void radv_amdgpu_cs_add_buffer(struct radeon_winsys_cs *_cs,
return;
}
if (bo->is_local)
if (bo->base.is_local)
return;
radv_amdgpu_cs_add_buffer_internal(cs, bo->bo, priority);