radv/winsys: Trivial style and readability fixups
authorEdward O'Callaghan <funfunctor@folklore1984.net>
Tue, 11 Oct 2016 09:04:47 +0000 (20:04 +1100)
committerDave Airlie <airlied@redhat.com>
Tue, 11 Oct 2016 22:24:50 +0000 (08:24 +1000)
Drop/add a few newlines where appropriate and drop a couple of
unnessary braces.

Signed-off-by: Edward O'Callaghan <funfunctor@folklore1984.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_cs.h
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_surface.c
src/amd/vulkan/winsys/amdgpu/radv_amdgpu_winsys.c

index dedc778f1cd4f77198d5a489309adb071a535d40..330b59b174a7aa7b1d6963ac5afa944a556d0c62 100644 (file)
@@ -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;
 }
 
index b4482fc012f7976634c43ab5ac5df8d726f46c2f..affee9528e856f7f905c5dfb68572c1920d28f21 100644 (file)
@@ -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;
index a3c24115a13ffd17fa4213dae1c297ee1f5a41bd..31927ecd91b4e685e3710ac4f3824b71c9233edb 100644 (file)
  */
 
 #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;
        }
 
index 94505367e23467fa25253b3dba8247c9c53d57dd..0ce44acd39d7ebf07c749a22f9f054fe3962fee9 100644 (file)
@@ -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;