[Mesa-dev] [PATCH 28/38] st/dri/drm: constify __DRI*Extension pointers

Ilia Mirkin imirkin at alum.mit.edu
Wed Feb 12 18:57:11 PST 2014


On Wed, Feb 12, 2014 at 8:17 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> Note: the __DRIimageExtension should not be made const
> as it's modified at runtime.
>
> Signed-off-by: Emil Velikov <emil.l.velikov at gmail.com>
> ---
>  src/gallium/state_trackers/dri/drm/dri2.c | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c
> index fc1f66f..76743be 100644
> --- a/src/gallium/state_trackers/dri/drm/dri2.c
> +++ b/src/gallium/state_trackers/dri/drm/dri2.c
> @@ -80,7 +80,7 @@ dri2_drawable_get_buffers(struct dri_drawable *drawable,
>                            unsigned *count)
>  {
>     __DRIdrawable *dri_drawable = drawable->dPriv;
> -   struct __DRIdri2LoaderExtensionRec *loader = drawable->sPriv->dri2.loader;
> +   const __DRIdri2LoaderExtension *loader = drawable->sPriv->dri2.loader;
>     boolean with_format;
>     __DRIbuffer *buffers;
>     int num_buffers;
> @@ -484,7 +484,7 @@ dri2_flush_frontbuffer(struct dri_context *ctx,
>                         enum st_attachment_type statt)
>  {
>     __DRIdrawable *dri_drawable = drawable->dPriv;
> -   struct __DRIdri2LoaderExtensionRec *loader = drawable->sPriv->dri2.loader;
> +   const __DRIdri2LoaderExtension *loader = drawable->sPriv->dri2.loader;
>     struct pipe_context *pipe = ctx->st->pipe;
>
>     if (statt != ST_ATTACHMENT_FRONT_LEFT)
> @@ -519,7 +519,7 @@ dri2_update_tex_buffer(struct dri_drawable *drawable,
>  static __DRIimage *
>  dri2_lookup_egl_image(struct dri_screen *screen, void *handle)
>  {
> -   __DRIimageLookupExtension *loader = screen->sPriv->dri2.image;
> +   const __DRIimageLookupExtension *loader = screen->sPriv->dri2.image;
>     __DRIimage *img;
>
>     if (!loader->lookupEGLImage)
> @@ -993,7 +993,8 @@ dri2_destroy_image(__DRIimage *img)
>     FREE(img);
>  }
>
> -static const __DRIimageExtension dri2ImageExtension = {
> +/* The extension is modified during runtime if DRM_PRIME is detected */

DRI_PRIME, no?

> +static __DRIimageExtension dri2ImageExtension = {
>      .base = { __DRI_IMAGE, 6 },
>
>      .createImageFromName          = dri2_create_image_from_name,
> --
> 1.8.5.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list