[Mesa-dev] [PATCH 4/4] dri: Add a default drirc to be installed to provide application workarounds.

Marek Olšák maraeo at gmail.com
Wed Jan 25 14:56:27 PST 2012


Hi Eric,

I don't like this, because I don't have drirc in my system. Obviously
Canonical decided not to include it and that also means some of my
users don't have it. Please can we add workarounds directly in the
code and on a per-app basis? Something like:

if (is_linked("libUnigine_x86.so") ||
    is_linked("libUnigine_x64.so"))
   apply_workarounds_for_unigine();

Marek

On Wed, Jan 25, 2012 at 11:29 PM, Eric Anholt <eric at anholt.net> wrote:
> Specifially, this being present works around a bug in Unigine
> Sanctuary on i965 which previously resulted in bad rendering.
> ---
>  configure.ac                                  |    1 +
>  src/mesa/drivers/dri/Makefile.am              |    2 +-
>  src/mesa/drivers/dri/common/Makefile.am       |   22 ++++++++++++++++++++++
>  src/mesa/drivers/dri/common/drirc             |    7 +++++++
>  src/mesa/drivers/dri/common/xmlpool/options.h |   12 ++++++------
>  5 files changed, 37 insertions(+), 7 deletions(-)
>  create mode 100644 src/mesa/drivers/dri/common/Makefile.am
>  create mode 100644 src/mesa/drivers/dri/common/drirc
>
> diff --git a/configure.ac b/configure.ac
> index 2472cc1..b3cdf13 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1948,6 +1948,7 @@ AC_CONFIG_FILES([configs/autoconf
>                src/gbm/main/gbm.pc
>                src/mesa/drivers/dri/dri.pc
>                src/mesa/drivers/dri/Makefile
> +               src/mesa/drivers/dri/common/Makefile
>                src/mesa/drivers/dri/i915/Makefile
>                src/mesa/drivers/dri/i965/Makefile
>                src/mesa/drivers/dri/nouveau/Makefile
> diff --git a/src/mesa/drivers/dri/Makefile.am b/src/mesa/drivers/dri/Makefile.am
> index 3722082..8dea0ac 100644
> --- a/src/mesa/drivers/dri/Makefile.am
> +++ b/src/mesa/drivers/dri/Makefile.am
> @@ -1,4 +1,4 @@
> -SUBDIRS=
> +SUBDIRS=common
>
>  if HAVE_I915_DRI
>  SUBDIRS+=i915
> diff --git a/src/mesa/drivers/dri/common/Makefile.am b/src/mesa/drivers/dri/common/Makefile.am
> new file mode 100644
> index 0000000..3b5324d
> --- /dev/null
> +++ b/src/mesa/drivers/dri/common/Makefile.am
> @@ -0,0 +1,22 @@
> +# Copyright © 2012 Intel Corporation
> +#
> +# Permission is hereby granted, free of charge, to any person obtaining a
> +# copy of this software and associated documentation files (the "Software"),
> +# to deal in the Software without restriction, including without limitation
> +# the rights to use, copy, modify, merge, publish, distribute, sublicense,
> +# and/or sell copies of the Software, and to permit persons to whom the
> +# Software is furnished to do so, subject to the following conditions:
> +#
> +# The above copyright notice and this permission notice (including the next
> +# paragraph) shall be included in all copies or substantial portions of the
> +# Software.
> +#
> +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> +# IN THE SOFTWARE.
> +
> +sysconf_DATA = drirc
> diff --git a/src/mesa/drivers/dri/common/drirc b/src/mesa/drivers/dri/common/drirc
> new file mode 100644
> index 0000000..7abc646
> --- /dev/null
> +++ b/src/mesa/drivers/dri/common/drirc
> @@ -0,0 +1,7 @@
> +<driconf>
> +    <device screen="0" driver="i965">
> +        <application name="Sanctuary">
> +            <option name="force_glsl_extensions_warn" value="true" />
> +       </application>
> +    </device>
> +</driconf>
> diff --git a/src/mesa/drivers/dri/common/xmlpool/options.h b/src/mesa/drivers/dri/common/xmlpool/options.h
> index a5890af..75c887e 100644
> --- a/src/mesa/drivers/dri/common/xmlpool/options.h
> +++ b/src/mesa/drivers/dri/common/xmlpool/options.h
> @@ -629,10 +629,10 @@ DRI_CONF_OPT_END
>
>  #define DRI_CONF_FORCE_GLSL_EXTENSIONS_WARN(def) \
>  DRI_CONF_OPT_BEGIN(force_glsl_extensions_warn,bool,def) \
> -        DRI_CONF_DESC(en,"Force GLSL extension default behavior to \"warn\"") \
> -        DRI_CONF_DESC(de,"Force GLSL extension default behavior to \"warn\"") \
> -        DRI_CONF_DESC(es,"Force GLSL extension default behavior to \"warn\"") \
> -        DRI_CONF_DESC(nl,"Force GLSL extension default behavior to \"warn\"") \
> -        DRI_CONF_DESC(fr,"Force GLSL extension default behavior to \"warn\"") \
> -        DRI_CONF_DESC(sv,"Force GLSL extension default behavior to \"warn\"") \
> +        DRI_CONF_DESC(en,"Force GLSL extension default behavior to 'warn'") \
> +        DRI_CONF_DESC(de,"Force GLSL extension default behavior to 'warn'") \
> +        DRI_CONF_DESC(es,"Force GLSL extension default behavior to 'warn'") \
> +        DRI_CONF_DESC(nl,"Force GLSL extension default behavior to 'warn'") \
> +        DRI_CONF_DESC(fr,"Force GLSL extension default behavior to 'warn'") \
> +        DRI_CONF_DESC(sv,"Force GLSL extension default behavior to 'warn'") \
>  DRI_CONF_OPT_END
> --
> 1.7.7.3
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list