[Mesa-dev] [PATCHv2 1/9] dri: add putImageShm and getImageShm to swrastLoader
Boyan Ding
boyan.j.ding at gmail.com
Mon Jun 15 07:09:12 PDT 2015
On 06/15/2015 09:34 PM, Marc-André Lureau wrote:
> Add new APIa to put and get an image using shared memory. Instead of only
> passing the data pointer, 3 arguments are given: the shmid, the data
> offset and the shmaddr.
>
> Bump interface version.
> ---
> include/GL/internal/dri_interface.h | 18 +++++++++++++++++-
> 1 file changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
> index c827bb6..93f0d41 100644
> --- a/include/GL/internal/dri_interface.h
> +++ b/include/GL/internal/dri_interface.h
> @@ -502,7 +502,7 @@ struct __DRIdamageExtensionRec {
> * SWRast Loader extension.
> */
> #define __DRI_SWRAST_LOADER "DRI_SWRastLoader"
> -#define __DRI_SWRAST_LOADER_VERSION 2
> +#define __DRI_SWRAST_LOADER_VERSION 3
This breaks egl/x11 swrast because it sets the version of swrastLoader
in the following way(src/egl/drivers/dri2/platform_x11.c):
dri2_dpy->swrast_loader_extension.base.version =
__DRI_SWRAST_LOADER_VERSION;
As a quick fix, we can set the version here to 2 and eventually
implement the same thing as in glx. (If you don't want to touch the egl
code immediately)
Regards,
Boyan Ding
> struct __DRIswrastLoaderExtensionRec {
> __DRIextension base;
>
> @@ -535,6 +535,22 @@ struct __DRIswrastLoaderExtensionRec {
> void (*putImage2)(__DRIdrawable *drawable, int op,
> int x, int y, int width, int height, int stride,
> char *data, void *loaderPrivate);
> +
> + /**
> + * Put image to drawable
> + *
> + * \since 3
> + */
> + void (*putImageShm)(__DRIdrawable *drawable, int op,
> + int x, int y, int width, int height, int stride,
> + int shmid, char *shmaddr, unsigned offset,
> + void *loaderPrivate);
> + /**
> + * Get image from readable
> + */
> + void (*getImageShm)(__DRIdrawable *readable,
> + int x, int y, int width, int height,
> + int shmid, void *loaderPrivate);
> };
>
> /**
More information about the mesa-dev
mailing list