radeon: cleanup bo/cs func tables
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 15 Aug 2015 16:12:13 +0000 (17:12 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 4 Sep 2015 20:39:06 +0000 (21:39 +0100)
Annotate the data as static const and use C99 designated initializers.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
radeon/radeon_bo_gem.c
radeon/radeon_bo_int.h
radeon/radeon_cs_gem.c
radeon/radeon_cs_int.h

index 7fdd437a12ae7f2b8bd9680708b4fb20b8ea5c1a..c9fe19ff40c2072f9293479a98809286f1d71344 100644 (file)
@@ -270,17 +270,18 @@ static int bo_get_tiling(struct radeon_bo_int *boi, uint32_t *tiling_flags,
     return r;
 }
 
-static struct radeon_bo_funcs bo_gem_funcs = {
-    bo_open,
-    bo_ref,
-    bo_unref,
-    bo_map,
-    bo_unmap,
-    bo_wait,
-    NULL,
-    bo_set_tiling,
-    bo_get_tiling,
-    bo_is_busy,
+static const struct radeon_bo_funcs bo_gem_funcs = {
+    .bo_open = bo_open,
+    .bo_ref = bo_ref,
+    .bo_unref = bo_unref,
+    .bo_map = bo_map,
+    .bo_unmap = bo_unmap,
+    .bo_wait = bo_wait,
+    .bo_is_static = NULL,
+    .bo_set_tiling = bo_set_tiling,
+    .bo_get_tiling = bo_get_tiling,
+    .bo_is_busy = bo_is_busy,
+    .bo_is_referenced_by_cs = NULL,
 };
 
 struct radeon_bo_manager *radeon_bo_manager_gem_ctor(int fd)
index 9589ead100e517ea44c62d484e9359b0f69e4b0c..de981b0af16ad72eeb35d4e753ad04647465dcbb 100644 (file)
@@ -2,7 +2,7 @@
 #define RADEON_BO_INT
 
 struct radeon_bo_manager {
-    struct radeon_bo_funcs  *funcs;
+    const struct radeon_bo_funcs *funcs;
     int                     fd;
 };
 
index 1962e915b4fcc139b0582d4dfb69d34754b3ded3..cdec64e0bf1a3c0f6417a03c2411b161190c17d1 100644 (file)
@@ -514,16 +514,16 @@ static void cs_gem_print(struct radeon_cs_int *cs, FILE *file)
     }
 }
 
-static struct radeon_cs_funcs radeon_cs_gem_funcs = {
-    cs_gem_create,
-    cs_gem_write_reloc,
-    cs_gem_begin,
-    cs_gem_end,
-    cs_gem_emit,
-    cs_gem_destroy,
-    cs_gem_erase,
-    cs_gem_need_flush,
-    cs_gem_print,
+static const struct radeon_cs_funcs radeon_cs_gem_funcs = {
+    .cs_create = cs_gem_create,
+    .cs_write_reloc = cs_gem_write_reloc,
+    .cs_begin = cs_gem_begin,
+    .cs_end = cs_gem_end,
+    .cs_emit = cs_gem_emit,
+    .cs_destroy = cs_gem_destroy,
+    .cs_erase = cs_gem_erase,
+    .cs_need_flush = cs_gem_need_flush,
+    .cs_print = cs_gem_print,
 };
 
 static int radeon_get_device_id(int fd, uint32_t *device_id)
index 6cee574272f87071368a8fe197f09e696adc718b..d906ad438ea041c7a366c158d808b519b82f33fd 100644 (file)
@@ -58,7 +58,7 @@ struct radeon_cs_funcs {
 };
 
 struct radeon_cs_manager {
-    struct radeon_cs_funcs  *funcs;
+    const struct radeon_cs_funcs  *funcs;
     int                     fd;
     int32_t vram_limit, gart_limit;
     int32_t vram_write_used, gart_write_used;