diff options
author | Edward O'Callaghan <[email protected]> | 2016-10-11 20:04:47 +1100 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-10-12 08:24:50 +1000 |
commit | 4a0db58f144d5476bf3fe277848d946d224779c7 (patch) | |
tree | b26a8a3d11fc70e51a277187235de4fc25fa2852 /src/amd | |
parent | b425b57d1e215810ac1ddabba62e89c8bd39a453 (diff) |
radv/winsys: Trivial style and readability fixups
Drop/add a few newlines where appropriate and drop a couple of
unnessary braces.
Signed-off-by: Edward O'Callaghan <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd')
-rw-r--r-- | src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c | 16 | ||||
-rw-r--r-- | src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.h | 2 | ||||
-rw-r--r-- | src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c | 8 | ||||
-rw-r--r-- | src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c | 3 |
4 files changed, 17 insertions, 12 deletions
diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c index dedc778f1cd..330b59b174a 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c @@ -84,6 +84,7 @@ static bool radv_amdgpu_fence_wait(struct radeon_winsys *_ws, unsigned flags = absolute ? AMDGPU_QUERY_FENCE_TIMEOUT_IS_ABSOLUTE : 0; int r; uint32_t expired = 0; + /* Now use the libdrm query. */ r = amdgpu_cs_query_fence_status(fence, timeout, @@ -95,16 +96,16 @@ static bool radv_amdgpu_fence_wait(struct radeon_winsys *_ws, return false; } - if (expired) { + if (expired) return true; - } - return false; + return false; } static void radv_amdgpu_cs_destroy(struct radeon_winsys_cs *rcs) { struct radv_amdgpu_cs *cs = radv_amdgpu_cs(rcs); + if (cs->ib_buffer) cs->ws->base.buffer_destroy(cs->ib_buffer); else @@ -112,6 +113,7 @@ static void radv_amdgpu_cs_destroy(struct radeon_winsys_cs *rcs) for (unsigned i = 0; i < cs->num_old_ib_buffers; ++i) cs->ws->base.buffer_destroy(cs->old_ib_buffers[i]); + free(cs->old_ib_buffers); free(cs->handles); free(cs->priorities); @@ -121,9 +123,9 @@ static void radv_amdgpu_cs_destroy(struct radeon_winsys_cs *rcs) static boolean radv_amdgpu_init_cs(struct radv_amdgpu_cs *cs, enum ring_type ring_type) { - for (int i = 0; i < ARRAY_SIZE(cs->buffer_hash_table); ++i) { + for (int i = 0; i < ARRAY_SIZE(cs->buffer_hash_table); ++i) cs->buffer_hash_table[i] = -1; - } + return true; } @@ -297,7 +299,7 @@ static int radv_amdgpu_cs_find_buffer(struct radv_amdgpu_cs *cs, if (index == -1) return -1; - if(cs->handles[index] == bo) + if (cs->handles[index] == bo) return index; for (unsigned i = 0; i < cs->num_buffers; ++i) { @@ -306,6 +308,7 @@ static int radv_amdgpu_cs_find_buffer(struct radv_amdgpu_cs *cs, return i; } } + return -1; } @@ -455,6 +458,7 @@ static int radv_amdgpu_create_bo_list(struct radv_amdgpu_winsys *ws, free(handles); free(priorities); } + return r; } diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.h b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.h index b4482fc012f..affee9528e8 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.h +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.h @@ -36,8 +36,8 @@ #include <amdgpu.h> #include "radv_radeon_winsys.h" - #include "radv_amdgpu_winsys.h" + struct radv_amdgpu_ctx { struct radv_amdgpu_winsys *ws; amdgpu_context_handle ctx; diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c index a3c24115a13..31927ecd91b 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c @@ -27,12 +27,14 @@ */ #include <errno.h> + #include "radv_private.h" #include "addrlib/addrinterface.h" #include "util/bitset.h" #include "radv_amdgpu_winsys.h" #include "radv_amdgpu_surface.h" #include "sid.h" + #ifndef NO_ENTRIES #define NO_ENTRIES 32 #endif @@ -194,9 +196,8 @@ static int radv_compute_level(ADDR_HANDLE addrlib, ret = AddrComputeSurfaceInfo(addrlib, AddrSurfInfoIn, AddrSurfInfoOut); - if (ret != ADDR_OK) { + if (ret != ADDR_OK) return ret; - } surf_level = is_stencil ? &surf->stencil_level[level] : &surf->level[level]; surf_level->offset = align64(surf->bo_size, AddrSurfInfoOut->baseAlign); @@ -340,8 +341,7 @@ static int radv_amdgpu_winsys_surface_init(struct radeon_winsys *_ws, default: assert(0); } - } - else { + } else { AddrDccIn.bpp = AddrSurfInfoIn.bpp = surf->bpe * 8; } diff --git a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c index 94505367e23..0ce44acd39d 100644 --- a/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c +++ b/src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c @@ -37,6 +37,7 @@ #include "radv_amdgpu_cs.h" #include "radv_amdgpu_bo.h" #include "radv_amdgpu_surface.h" + #define CIK_TILE_MODE_COLOR_2D 14 #define CIK__GB_TILE_MODE__PIPE_CONFIG(x) (((x) >> 6) & 0x1f) @@ -338,7 +339,6 @@ radv_amdgpu_winsys_create(int fd) if (!ws) return NULL; - ws->dev = dev; ws->info.drm_major = drm_major; ws->info.drm_minor = drm_minor; @@ -353,6 +353,7 @@ radv_amdgpu_winsys_create(int fd) radv_amdgpu_bo_init_functions(ws); radv_amdgpu_cs_init_functions(ws); radv_amdgpu_surface_init_functions(ws); + return &ws->base; fail: return NULL; |