[Mesa-dev] [PATCH 4/4] dri: Add KHR_no_error toggle to driconf

Emil Velikov emil.l.velikov at gmail.com
Wed Jul 12 13:15:01 UTC 2017


On 11 July 2017 at 23:26, Grigori Goronzy <greg at chown.ath.cx> wrote:
> Allows applications to be whitelisted.
> ---
>  src/gallium/state_trackers/dri/dri_context.c    | 3 +++
>  src/gallium/state_trackers/dri/dri_screen.c     | 1 +
>  src/mesa/drivers/dri/common/dri_util.c          | 3 +++
>  src/mesa/drivers/dri/common/xmlpool/t_options.h | 5 +++++
>  4 files changed, 12 insertions(+)
>
> diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
> index 275c0d4..e4f7c96 100644
> --- a/src/gallium/state_trackers/dri/dri_context.c
> +++ b/src/gallium/state_trackers/dri/dri_context.c
> @@ -124,6 +124,9 @@ dri_create_context(gl_api api, const struct gl_config * visual,
>     ctx->cPriv = cPriv;
>     ctx->sPriv = sPriv;
>
> +   if (driQueryOptionb(&screen->optionCache, "mesa_no_error"))
> +      attribs.flags |=  ST_CONTEXT_FLAG_NO_ERROR;
> +
>     attribs.options = screen->options;
>     dri_fill_st_visual(&attribs.visual, screen, visual);
>     ctx->st = stapi->create_context(stapi, &screen->base, &attribs, &ctx_err,
> diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
> index 6b58830..de0840b 100644
> --- a/src/gallium/state_trackers/dri/dri_screen.c
> +++ b/src/gallium/state_trackers/dri/dri_screen.c
> @@ -56,6 +56,7 @@ const __DRIconfigOptionsExtension gallium_config_options = {
>     DRI_CONF_BEGIN
>        DRI_CONF_SECTION_PERFORMANCE
>           DRI_CONF_MESA_GLTHREAD("false")
> +         DRI_CONF_MESA_NO_ERROR("false")
>           DRI_CONF_DISABLE_EXT_BUFFER_AGE("false")
>           DRI_CONF_DISABLE_OML_SYNC_CONTROL("false")
>        DRI_CONF_SECTION_END
> diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
> index 174356f..cc97c2d 100644
> --- a/src/mesa/drivers/dri/common/dri_util.c
> +++ b/src/mesa/drivers/dri/common/dri_util.c
> @@ -437,6 +437,9 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
>                                    major_version, minor_version, error))
>         return NULL;
>
> +    if (driQueryOptionb(&screen->optionCache, "mesa_no_error"))
> +        flags |= __DRI_CTX_FLAG_NO_ERROR;
> +
As mentioned in earlier commit no_error should be device agnostic.
Hence removing the st/dri bits and adding a DRI_CONF_MESA_NO_ERROR()
line next to DRI_CONF_VBLANK_MODE seems like the better solution.

As always, if you think I'm off my rocker at any point don't be afraid
to let me know.

-Emil


More information about the mesa-dev mailing list