From: Emil Velikov Date: Mon, 31 Jul 2017 18:45:26 +0000 (+0100) Subject: i965: annotate struct intel_image_format as const X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=69fa9e91cbd14259ebff605a3617cf3204298f0f;p=mesa.git i965: annotate struct intel_image_format as const Already used as such througout the code. Signed-off-by: Emil Velikov Reviewed-by: Matt Turner --- diff --git a/src/mesa/drivers/dri/i965/intel_image.h b/src/mesa/drivers/dri/i965/intel_image.h index cf0610540fc..5e83bbd0608 100644 --- a/src/mesa/drivers/dri/i965/intel_image.h +++ b/src/mesa/drivers/dri/i965/intel_image.h @@ -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; diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index daa49f99228..858279fcba7 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -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++) { diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c index ced80cb8790..e9974a35d98 100644 --- a/src/mesa/drivers/dri/i965/intel_screen.c +++ b/src/mesa/drivers/dri/i965/intel_screen.c @@ -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)