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

Emil Velikov emil.l.velikov at gmail.com
Tue Feb 18 17:20:09 PST 2014


Note: the __DRIimageExtension should not be made const
as it's modified at runtime.

v2: s/DRM_PRIME/DRI_PRIME/

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 45b52c7..b75a45e 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 DRI_PRIME is detected */
+static __DRIimageExtension dri2ImageExtension = {
     .base = { __DRI_IMAGE, 6 },
 
     .createImageFromName          = dri2_create_image_from_name,
-- 
1.9.0



More information about the mesa-dev mailing list