From: Emil Velikov Date: Tue, 16 Aug 2016 16:23:23 +0000 (+0100) Subject: egl/android: don't populate dri2_dpy->dri2_loader_extension X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6a8fe32430077c44fda8a84c014a986e3fc77204;p=mesa.git egl/android: don't populate dri2_dpy->dri2_loader_extension The extension stored in struct dri2_egl_display isn't used, thus we can create a static const instance of the extension and point extensions[] to it. Signed-off-by: Emil Velikov --- diff --git a/src/egl/drivers/dri2/platform_android.c b/src/egl/drivers/dri2/platform_android.c index 9581c9617d6..4f09b26e130 100644 --- a/src/egl/drivers/dri2/platform_android.c +++ b/src/egl/drivers/dri2/platform_android.c @@ -883,6 +883,14 @@ static struct dri2_egl_display_vtbl droid_display_vtbl = { .get_dri_drawable = dri2_surface_get_dri_drawable, }; +static const __DRIdri2LoaderExtension droid_dri2_loader_extension = { + .base = { __DRI_DRI2_LOADER, 3 }, + + .getBuffers = NULL, + .flushFrontBuffer = droid_flush_front_buffer, + .getBuffersWithFormat = droid_get_buffers_with_format, +}; + static const __DRIimageLoaderExtension droid_image_loader_extension = { .base = { __DRI_IMAGE_LOADER, 1 }, @@ -928,13 +936,7 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy) /* render nodes cannot use Gem names, and thus do not support * the __DRI_DRI2_LOADER extension */ if (!dri2_dpy->is_render_node) { - dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER; - dri2_dpy->dri2_loader_extension.base.version = 3; - dri2_dpy->dri2_loader_extension.getBuffers = NULL; - dri2_dpy->dri2_loader_extension.flushFrontBuffer = droid_flush_front_buffer; - dri2_dpy->dri2_loader_extension.getBuffersWithFormat = - droid_get_buffers_with_format; - dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base; + dri2_dpy->extensions[0] = &droid_dri2_loader_extension.base; } else { dri2_dpy->extensions[0] = &droid_image_loader_extension.base; } diff --git a/src/egl/drivers/dri2/platform_surfaceless.c b/src/egl/drivers/dri2/platform_surfaceless.c index b4653cc807b..797c013133a 100644 --- a/src/egl/drivers/dri2/platform_surfaceless.c +++ b/src/egl/drivers/dri2/platform_surfaceless.c @@ -265,6 +265,14 @@ surfaceless_get_buffers_with_format(__DRIdrawable * driDrawable, return dri2_surf->buffers; } +static const __DRIdri2LoaderExtension droid_dri2_loader_extension = { + .base = { __DRI_DRI2_LOADER, 3 }, + + .getBuffers = NULL, + .flushFrontBuffer = droid_flush_front_buffer, + .getBuffersWithFormat = droid_get_buffers_with_format, +}; + static const __DRIimageLoaderExtension image_loader_extension = { .base = { __DRI_IMAGE_LOADER, 1 }, .getBuffers = surfaceless_image_get_buffers,