[Mesa-dev] [PATCH 1/4] st/dri: move image extension into the common file

Emil Velikov emil.l.velikov at gmail.com
Wed Jun 28 15:05:27 UTC 2017


On 9 June 2017 at 01:26, gurchetansingh at chromium.org
<gurchetansingh at chromium.org> wrote:
> From: Gurchetan Singh <gurchetansingh at chromium.org>
>
> This image extension is is needed by the Android studio emulator
> when using the host's GLES implementation.
>
> This patch moves the extension code from dri2.c to dri_extensions.c.
> Since some functions in this extension are initialized at runtime by
> dri2.c, we need to expose them in dri_extensions.h.
> ---
>  src/gallium/state_trackers/dri/dri2.c           | 756 -----------------------
>  src/gallium/state_trackers/dri/dri_extensions.c | 770 +++++++++++++++++++++++-
>  src/gallium/state_trackers/dri/dri_extensions.h |  17 +
>  3 files changed, 784 insertions(+), 759 deletions(-)
>
> diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c

> +/* The extension is modified during runtime if DRI_PRIME is detected */
> +__DRIimageExtension dri2ImageExtension = {
> +    .base = { __DRI_IMAGE, 12 },
> +
> +    .createImageFromName          = dri2_create_image_from_name,
> +    .createImageFromRenderbuffer  = dri2_create_image_from_renderbuffer,
> +    .destroyImage                 = dri2_destroy_image,
> +    .createImage                  = dri2_create_image,
> +    .queryImage                   = dri2_query_image,
> +    .dupImage                     = dri2_dup_image,
> +    .validateUsage                = dri2_validate_usage,
> +    .createImageFromNames         = dri2_from_names,
> +    .fromPlanar                   = dri2_from_planar,
> +    .createImageFromTexture       = dri2_create_from_texture,
> +    .createImageFromFds           = NULL,
> +    .createImageFromDmaBufs       = NULL,
> +    .blitImage                    = dri2_blit_image,
> +    .getCapabilities              = dri2_get_capabilities,
> +    .mapImage                     = dri2_map_image,
> +    .unmapImage                   = dri2_unmap_image,
> +};
> +
>From the above only .createImageFromNames,
.createImageFromRenderbuffer and .destroyImage are needed for
EGL_KHR_gl_image.

Although a bit strange to keep separate, we don't want to bring
drm_driver.h, drm.h, xf86drm.h and alike when building drisw. I.e. I'd
move only those - be that to dri_extensions.c or other file.

-Emil


More information about the mesa-dev mailing list