i965: annotate struct intel_image_format as const
authorEmil Velikov <emil.velikov@collabora.com>
Mon, 31 Jul 2017 18:45:26 +0000 (19:45 +0100)
committerEmil Velikov <emil.l.velikov@gmail.com>
Wed, 2 Aug 2017 19:42:19 +0000 (20:42 +0100)
Already used as such througout the code.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/drivers/dri/i965/intel_image.h
src/mesa/drivers/dri/i965/intel_mipmap_tree.c
src/mesa/drivers/dri/i965/intel_screen.c

index cf0610540fc5566d84d80e08fc74e56512612656..5e83bbd0608d4b3561b280318e6ed5d0542bfd2e 100644 (file)
@@ -80,7 +80,7 @@ struct __DRIimageRec {
     */
    uint32_t strides[3];
    uint32_t offsets[3];
-   struct intel_image_format *planar_format;
+   const struct intel_image_format *planar_format;
 
    /* particular miptree level */
    GLuint width;
index daa49f99228c4858edcb2f33b657eda69762be27..858279fcba7399fbdf8cb0daa741b3eee218f13c 100644 (file)
@@ -859,7 +859,7 @@ static struct intel_mipmap_tree *
 miptree_create_for_planar_image(struct brw_context *brw,
                                 __DRIimage *image, GLenum target)
 {
-   struct intel_image_format *f = image->planar_format;
+   const struct intel_image_format *f = image->planar_format;
    struct intel_mipmap_tree *planar_mt = NULL;
 
    for (int i = 0; i < f->nplanes; i++) {
index ced80cb8790e5b98018bd161eeffbe090fdc61c3..e9974a35d9805eb1ce5fd0f1a69efe358a0e69a5 100644 (file)
@@ -187,7 +187,7 @@ static const struct __DRI2flushExtensionRec intelFlushExtension = {
     .flush_with_flags   = intel_dri2_flush_with_flags,
 };
 
-static struct intel_image_format intel_image_formats[] = {
+static const struct intel_image_format intel_image_formats[] = {
    { __DRI_IMAGE_FOURCC_ARGB8888, __DRI_IMAGE_COMPONENTS_RGBA, 1,
      { { 0, 0, 0, __DRI_IMAGE_FORMAT_ARGB8888, 4 } } },
 
@@ -346,10 +346,10 @@ intel_image_warn_if_unaligned(__DRIimage *image, const char *func)
    }
 }
 
-static struct intel_image_format *
+static const struct intel_image_format *
 intel_image_format_lookup(int fourcc)
 {
-   struct intel_image_format *f = NULL;
+   const struct intel_image_format *f = NULL;
 
    for (unsigned i = 0; i < ARRAY_SIZE(intel_image_formats); i++) {
       if (intel_image_formats[i].fourcc == fourcc) {
@@ -818,7 +818,7 @@ intel_create_image_from_names(__DRIscreen *dri_screen,
                               int *strides, int *offsets,
                               void *loaderPrivate)
 {
-    struct intel_image_format *f = NULL;
+    const struct intel_image_format *f = NULL;
     __DRIimage *image;
     int i, index;
 
@@ -855,7 +855,7 @@ intel_create_image_from_fds_common(__DRIscreen *dri_screen,
                                    void *loaderPrivate)
 {
    struct intel_screen *screen = dri_screen->driverPrivate;
-   struct intel_image_format *f;
+   const struct intel_image_format *f;
    __DRIimage *image;
    int i, index;
    bool ok;
@@ -992,7 +992,7 @@ intel_create_image_from_dma_bufs2(__DRIscreen *dri_screen,
                                   void *loaderPrivate)
 {
    __DRIimage *image;
-   struct intel_image_format *f = intel_image_format_lookup(fourcc);
+   const struct intel_image_format *f = intel_image_format_lookup(fourcc);
 
    if (!f) {
       *error = __DRI_IMAGE_ERROR_BAD_MATCH;
@@ -1075,7 +1075,7 @@ intel_query_dma_buf_modifiers(__DRIscreen *_screen, int fourcc, int max,
                               int *count)
 {
    struct intel_screen *screen = _screen->driverPrivate;
-   struct intel_image_format *f;
+   const struct intel_image_format *f;
    int num_mods = 0, i;
 
    f = intel_image_format_lookup(fourcc);
@@ -1117,7 +1117,7 @@ static __DRIimage *
 intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
 {
     int width, height, offset, stride, dri_format, index;
-    struct intel_image_format *f;
+    const struct intel_image_format *f;
     __DRIimage *image;
 
     if (parent == NULL || parent->planar_format == NULL)