[Mesa-dev] [PATCH 2/4] gallium/vl: don't use the template keyword

Marek Olšák maraeo at gmail.com
Fri Sep 29 21:27:35 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

for C++ editors
---
 src/gallium/auxiliary/vl/vl_winsys_dri.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/gallium/auxiliary/vl/vl_winsys_dri.c b/src/gallium/auxiliary/vl/vl_winsys_dri.c
index b4fb47e..79ebf75 100644
--- a/src/gallium/auxiliary/vl/vl_winsys_dri.c
+++ b/src/gallium/auxiliary/vl/vl_winsys_dri.c
@@ -174,21 +174,21 @@ vl_dri2_set_drawable(struct vl_dri_screen *scrn, Drawable drawable)
    vl_compositor_reset_dirty_area(&scrn->dirty_areas[1]);
    scrn->drawable = drawable;
 }
 
 static struct pipe_resource *
 vl_dri2_screen_texture_from_drawable(struct vl_screen *vscreen, void *drawable)
 {
    struct vl_dri_screen *scrn = (struct vl_dri_screen *)vscreen;
 
    struct winsys_handle dri2_handle;
-   struct pipe_resource template, *tex;
+   struct pipe_resource templ, *tex;
 
    xcb_dri2_get_buffers_reply_t *reply;
    xcb_dri2_dri2_buffer_t *buffers, *back_left;
 
    unsigned i;
 
    assert(scrn);
 
    vl_dri2_set_drawable(scrn, (Drawable)drawable);
    reply = vl_dri2_get_flush_reply(scrn);
@@ -228,33 +228,33 @@ vl_dri2_screen_texture_from_drawable(struct vl_screen *vscreen, void *drawable)
    } else if (back_left->name != scrn->buffer_names[scrn->current_buffer]) {
       vl_compositor_reset_dirty_area(&scrn->dirty_areas[scrn->current_buffer]);
       scrn->buffer_names[scrn->current_buffer] = back_left->name;
    }
 
    memset(&dri2_handle, 0, sizeof(dri2_handle));
    dri2_handle.type = DRM_API_HANDLE_TYPE_SHARED;
    dri2_handle.handle = back_left->name;
    dri2_handle.stride = back_left->pitch;
 
-   memset(&template, 0, sizeof(template));
-   template.target = PIPE_TEXTURE_2D;
-   template.format = PIPE_FORMAT_B8G8R8X8_UNORM;
-   template.last_level = 0;
-   template.width0 = reply->width;
-   template.height0 = reply->height;
-   template.depth0 = 1;
-   template.array_size = 1;
-   template.usage = PIPE_USAGE_DEFAULT;
-   template.bind = PIPE_BIND_RENDER_TARGET;
-   template.flags = 0;
-
-   tex = scrn->base.pscreen->resource_from_handle(scrn->base.pscreen, &template,
+   memset(&templ, 0, sizeof(templ));
+   templ.target = PIPE_TEXTURE_2D;
+   templ.format = PIPE_FORMAT_B8G8R8X8_UNORM;
+   templ.last_level = 0;
+   templ.width0 = reply->width;
+   templ.height0 = reply->height;
+   templ.depth0 = 1;
+   templ.array_size = 1;
+   templ.usage = PIPE_USAGE_DEFAULT;
+   templ.bind = PIPE_BIND_RENDER_TARGET;
+   templ.flags = 0;
+
+   tex = scrn->base.pscreen->resource_from_handle(scrn->base.pscreen, &templ,
                                                   &dri2_handle,
                                                   PIPE_HANDLE_USAGE_READ_WRITE);
    free(reply);
 
    return tex;
 }
 
 static struct u_rect *
 vl_dri2_screen_get_dirty_area(struct vl_screen *vscreen)
 {
-- 
2.7.4



More information about the mesa-dev mailing list