radv: move is_local up to the winsys level.
authorDave Airlie <airlied@redhat.com>
Mon, 6 Nov 2017 04:06:35 +0000 (04:06 +0000)
committerDave Airlie <airlied@redhat.com>
Mon, 6 Nov 2017 21:45:59 +0000 (21:45 +0000)
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>
src/amd/vulkan/radv_radeon_winsys.h
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_bo.h
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c

index bab19a6233dbe60b842ba03a8bcc379a61fe3fd4..66a2bcccb4df8e1329146031d4219ae99acaf37a 100644 (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);
 }
 
index dac549a20ad92d363623cde7f18ca49ff78d1571..9ec4b4fb5618d143004fc14704747077505e4eeb 100644 (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;
        }
 
index f9aac9451c0585741e0c4e4712413d2f70e613dd..f32e43083860f2e3baebe6a7d5169c5bc39bb17b 100644 (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 {
index 939c221e0c8c0b5c3587896c214f7607fa6a4810..c10bdd6c91e4ae3c260db602054eba5170bdf649 100644 (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);