[Mesa-dev] [PATCH 9/9] egl/swrast: enable config extension for swrast

Emil Velikov emil.l.velikov at gmail.com
Fri May 8 10:27:30 PDT 2015


On 2 May 2015 at 11:15, Axel Davy <axel.davy at ens.fr> wrote:
> Enables to use dri config for swrast, like vblank_mode.
>
> Signed-off-by: Axel Davy <axel.davy at ens.fr>
> ---
>  src/egl/drivers/dri2/egl_dri2.c        | 21 ++++++++++-----------
>  src/gallium/state_trackers/dri/drisw.c |  1 +
>  src/mesa/drivers/dri/swrast/swrast.c   |  1 +
>  3 files changed, 12 insertions(+), 11 deletions(-)
>
> diff --git a/src/egl/drivers/dri2/egl_dri2.c b/src/egl/drivers/dri2/egl_dri2.c
> index 689d5ec..1434580 100644
> --- a/src/egl/drivers/dri2/egl_dri2.c
> +++ b/src/egl/drivers/dri2/egl_dri2.c
> @@ -559,6 +559,7 @@ dri2_create_screen(_EGLDisplay *disp)
>  {
>     const __DRIextension **extensions;
>     struct dri2_egl_display *dri2_dpy;
> +   unsigned i;
>
>     dri2_dpy = disp->DriverData;
>
> @@ -599,25 +600,23 @@ dri2_create_screen(_EGLDisplay *disp)
>     extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
>
>     if (dri2_dpy->dri2) {
> -      unsigned i;
> -
>        if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
>           goto cleanup_dri_screen;
> -
> -      for (i = 0; extensions[i]; i++) {
> -        if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
> -            dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
> -        }
> -        if (strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0) {
> -           dri2_dpy->config = (__DRI2configQueryExtension *) extensions[i];
> -        }
> -      }
>     } else {
>        assert(dri2_dpy->swrast);
>        if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
>           goto cleanup_dri_screen;
>     }
>
> +   for (i = 0; extensions[i]; i++) {
> +      if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
> +         dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
> +      }
> +      if (strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0) {
> +         dri2_dpy->config = (__DRI2configQueryExtension *) extensions[i];
> +      }
> +   }
> +
Side note: Applying this hunk might lead to conflict due to the newly
introduced __DRI2_FENCE. Afaict one can move it as well similarly to
robustness and config_query.

Cheers
Emil


More information about the mesa-dev mailing list