[Mesa-dev] [PATCH mesa 1/6] egl_dri2: move glFlush out of struct dri2_egl_driver

Emil Velikov emil.l.velikov at gmail.com
Wed Sep 27 14:19:03 UTC 2017


On 26 September 2017 at 23:47, Eric Engestrom <eric at engestrom.ch> wrote:
> There's no reason to store this there, it doesn't depend on the driver.
>
> Signed-off-by: Eric Engestrom <eric at engestrom.ch>
> ---
>  src/egl/drivers/dri2/egl_dri2.c | 44 ++++++++++++++++++-----------------------
>  src/egl/drivers/dri2/egl_dri2.h |  2 --
>  2 files changed, 19 insertions(+), 27 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index f27e72505b..1f68bcdcbb 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -101,6 +101,23 @@ dri_set_background_context(void *loaderPrivate)
>     _eglBindContextToThread(ctx, t);
>  }
>
> +static void
> +dri2_gl_flush()
> +{
> +   static void (*glFlush)(void);
> +
> +   if (!glFlush)
> +      glFlush = _glapi_get_proc_address("glFlush");
> +
> +   /* if glFlush is not available things are horribly broken */
> +   if (!glFlush) {
> +      _eglLog(_EGL_WARNING, "DRI2: failed to find glFlush entry point");
> +      return;
> +   }
> +
> +   glFlush();
I'm slightly worries about a couple of things:

 A) before on !glFlush we'll fallback to "other" driver, now we'll just be stuck
Should be a non issue since the case should be unreachable in practise

 B) calling dri2_gl_flush from multiple threads
Currently that's implicitly handles by various locking further up the stack.
If we're to rework/drop that things will pair-shape here.

Can you please apply some magic for B?

The rest of the series is
Reviewed-by: Emil Velikov <emil.velikov at collabora.com>

Thanks
Emil


More information about the mesa-dev mailing list