[Mesa-dev] [PATCH 1/3] dri_interface: drop loaderPrivate from loader::getCapability()
Marek Olšák
maraeo at gmail.com
Mon Jul 31 14:46:07 UTC 2017
The idea is to allow the loader to access its own structures. It's sort of
like "this" in C++.
Marek
On Mon, Jul 31, 2017 at 3:19 PM, Emil Velikov <emil.l.velikov at gmail.com>
wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> Unused and I cannot see any case where we'll need it
>
> Fixes: 1bf703e4ea5 ("dri_interface,egl,gallium: only expose RGBA visuals
> on Android")
> Cc: Marek Olšák <maraeo at gmail.com>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Mostly an RFC, since I don't feel too strongly about it.
>
> Marek, can you elaborate about the potential usecase?
> ---
> include/GL/internal/dri_interface.h | 4 ++--
> src/egl/drivers/dri2/platform_android.c | 3 +--
> src/gallium/state_trackers/dri/dri_screen.c | 4 ++--
> 3 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/include/GL/internal/dri_interface.h
> b/include/GL/internal/dri_interface.h
> index c314a43faad..268bb443f9b 100644
> --- a/include/GL/internal/dri_interface.h
> +++ b/include/GL/internal/dri_interface.h
> @@ -1032,7 +1032,7 @@ struct __DRIdri2LoaderExtensionRec {
> *
> * \since 4
> */
> - unsigned (*getCapability)(void *loaderPrivate, enum dri_loader_cap
> cap);
> + unsigned (*getCapability)(enum dri_loader_cap cap);
> };
>
> /**
> @@ -1770,7 +1770,7 @@ struct __DRIimageLoaderExtensionRec {
> *
> * \since 2
> */
> - unsigned (*getCapability)(void *loaderPrivate, enum dri_loader_cap
> cap);
> + unsigned (*getCapability)(enum dri_loader_cap cap);
> };
>
> /**
> diff --git a/src/egl/drivers/dri2/platform_android.c
> b/src/egl/drivers/dri2/platform_android.c
> index bae42412b57..189c3c726c7 100644
> --- a/src/egl/drivers/dri2/platform_android.c
> +++ b/src/egl/drivers/dri2/platform_android.c
> @@ -1014,9 +1014,8 @@ droid_get_buffers_with_format(__DRIdrawable *
> driDrawable,
> }
>
> static unsigned
> -droid_get_capability(void *loaderPrivate, enum dri_loader_cap cap)
> +droid_get_capability(enum dri_loader_cap cap)
> {
> - /* Note: loaderPrivate is _EGLDisplay* */
> switch (cap) {
> case DRI_LOADER_CAP_RGBA_ORDERING:
> return 1;
> diff --git a/src/gallium/state_trackers/dri/dri_screen.c
> b/src/gallium/state_trackers/dri/dri_screen.c
> index 890a8bff4c6..0442a2b6667 100644
> --- a/src/gallium/state_trackers/dri/dri_screen.c
> +++ b/src/gallium/state_trackers/dri/dri_screen.c
> @@ -131,10 +131,10 @@ dri_loader_get_cap(struct dri_screen *screen, enum
> dri_loader_cap cap)
> const __DRIimageLoaderExtension *image_loader =
> screen->sPriv->image.loader;
>
> if (dri2_loader && dri2_loader->base.version >= 4)
> - return dri2_loader->getCapability(screen->sPriv->loaderPrivate,
> cap);
> + return dri2_loader->getCapability(cap);
>
> if (image_loader && image_loader->base.version >= 2)
> - return image_loader->getCapability(screen->sPriv->loaderPrivate,
> cap);
> + return image_loader->getCapability(cap);
>
> return 0;
> }
> --
> 2.13.3
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170731/f8302aa4/attachment-0001.html>
More information about the mesa-dev
mailing list