freedreno: annotate the device/bo/pipe/ringbuffer funcs as const data
authorEmil Velikov <emil.l.velikov@gmail.com>
Sat, 15 Aug 2015 16:17:52 +0000 (17:17 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Fri, 4 Sep 2015 20:39:06 +0000 (21:39 +0100)
Cc: freedreno@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
freedreno/freedreno_priv.h
freedreno/freedreno_ringbuffer.h
freedreno/kgsl/kgsl_bo.c
freedreno/kgsl/kgsl_device.c
freedreno/kgsl/kgsl_pipe.c
freedreno/kgsl/kgsl_ringbuffer.c
freedreno/msm/msm_bo.c
freedreno/msm/msm_device.c
freedreno/msm/msm_pipe.c
freedreno/msm/msm_ringbuffer.c

index 1dddcc39e35f80124742de7145a73b41dec17878..4e442e420965fad651d183d73eb8222e3e74a39e 100644 (file)
@@ -83,7 +83,7 @@ struct fd_device {
         */
        void *handle_table, *name_table;
 
-       struct fd_device_funcs *funcs;
+       const struct fd_device_funcs *funcs;
 
        struct fd_bo_bucket cache_bucket[14 * 4];
        int num_buckets;
@@ -107,7 +107,7 @@ struct fd_pipe_funcs {
 struct fd_pipe {
        struct fd_device *dev;
        enum fd_pipe_id id;
-       struct fd_pipe_funcs *funcs;
+       const struct fd_pipe_funcs *funcs;
 };
 
 struct fd_ringmarker {
@@ -141,7 +141,7 @@ struct fd_bo {
        int fd;          /* dmabuf handle */
        void *map;
        atomic_t refcnt;
-       struct fd_bo_funcs *funcs;
+       const struct fd_bo_funcs *funcs;
 
        int bo_reuse;
        struct list_head list;   /* bucket-list entry */
index a5e1d032ecd14813c343ff7855b351edad05c8a0..578cdb243cf2858a7f00c145ac339b8fe38b37b2 100644 (file)
@@ -44,7 +44,7 @@ struct fd_ringbuffer {
        int size;
        uint32_t *cur, *end, *start, *last_start;
        struct fd_pipe *pipe;
-       struct fd_ringbuffer_funcs *funcs;
+       const struct fd_ringbuffer_funcs *funcs;
        uint32_t last_timestamp;
        struct fd_ringbuffer *parent;
 };
index 3407c769cf290941036433063575bce1a5db438c..b8ac10261ca5db3268e864733b0d98c32a3f104c 100644 (file)
@@ -123,7 +123,7 @@ static void kgsl_bo_destroy(struct fd_bo *bo)
 
 }
 
-static struct fd_bo_funcs funcs = {
+static const struct fd_bo_funcs funcs = {
                .offset = kgsl_bo_offset,
                .cpu_prep = kgsl_bo_cpu_prep,
                .cpu_fini = kgsl_bo_cpu_fini,
index 8352d605fcd139c2d2f1b4af672e64a5b24a9633..175e83781fe51525b014a9a201082ab7b8b299ce 100644 (file)
@@ -42,7 +42,7 @@ static void kgsl_device_destroy(struct fd_device *dev)
        free(kgsl_dev);
 }
 
-static struct fd_device_funcs funcs = {
+static const struct fd_device_funcs funcs = {
                .bo_new_handle = kgsl_bo_new_handle,
                .bo_from_handle = kgsl_bo_from_handle,
                .pipe_new = kgsl_pipe_new,
index e2fd65c01bf32e70a1f8f886fe3864787fd0b62f..58b3b4d50e5e0e9a6b79d37e8e6752c72d50fd1a 100644 (file)
@@ -108,7 +108,7 @@ static void kgsl_pipe_destroy(struct fd_pipe *pipe)
        free(kgsl_pipe);
 }
 
-static struct fd_pipe_funcs funcs = {
+static const struct fd_pipe_funcs funcs = {
                .ringbuffer_new = kgsl_ringbuffer_new,
                .get_param = kgsl_pipe_get_param,
                .wait = kgsl_pipe_wait,
index f0133078cb03e7bc76c7715042a8d7b853c81005..6f68f2f304b663aefe5fd5ef5d37d8cc4e303fff 100644 (file)
@@ -191,7 +191,7 @@ static void kgsl_ringbuffer_destroy(struct fd_ringbuffer *ring)
        free(kgsl_ring);
 }
 
-static struct fd_ringbuffer_funcs funcs = {
+static const struct fd_ringbuffer_funcs funcs = {
                .hostptr = kgsl_ringbuffer_hostptr,
                .flush = kgsl_ringbuffer_flush,
                .emit_reloc = kgsl_ringbuffer_emit_reloc,
index fd944131e0def9d31f72491048828a5c353bbc36..ee668aba9a4fbf4e015af53ecb0ba7c0d4e713d8 100644 (file)
@@ -96,7 +96,7 @@ static void msm_bo_destroy(struct fd_bo *bo)
 
 }
 
-static struct fd_bo_funcs funcs = {
+static const struct fd_bo_funcs funcs = {
                .offset = msm_bo_offset,
                .cpu_prep = msm_bo_cpu_prep,
                .cpu_fini = msm_bo_cpu_fini,
index 81077e1a50c9f1a215f0797ba3830a1eb425aa27..25c097c2522d98cb4ccfd9b9884194793aa58188 100644 (file)
@@ -42,7 +42,7 @@ static void msm_device_destroy(struct fd_device *dev)
        free(msm_dev);
 }
 
-static struct fd_device_funcs funcs = {
+static const struct fd_device_funcs funcs = {
                .bo_new_handle = msm_bo_new_handle,
                .bo_from_handle = msm_bo_from_handle,
                .pipe_new = msm_pipe_new,
index e1edffea6770ee667dd5533b7967c0c2409d7d7d..aa0866b4aac01e1fd313ed2d8a21b30bfeee81ad 100644 (file)
@@ -80,7 +80,7 @@ static void msm_pipe_destroy(struct fd_pipe *pipe)
        free(msm_pipe);
 }
 
-static struct fd_pipe_funcs funcs = {
+static const struct fd_pipe_funcs funcs = {
                .ringbuffer_new = msm_ringbuffer_new,
                .get_param = msm_pipe_get_param,
                .wait = msm_pipe_wait,
index 5ddea57404acd1c37d0dbf1a319975c6b2fb5940..ee6af0ba0c7236a69f783bf56369eeff6b5de56e 100644 (file)
@@ -356,7 +356,7 @@ static void msm_ringbuffer_destroy(struct fd_ringbuffer *ring)
        free(msm_ring);
 }
 
-static struct fd_ringbuffer_funcs funcs = {
+static const struct fd_ringbuffer_funcs funcs = {
                .hostptr = msm_ringbuffer_hostptr,
                .flush = msm_ringbuffer_flush,
                .reset = msm_ringbuffer_reset,