driconfig: add a new engine name/version parameter
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sun, 8 Sep 2019 09:59:32 +0000 (12:59 +0300)
committerLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sun, 15 Sep 2019 12:37:02 +0000 (15:37 +0300)
commit04dc6074cf7f651b720868e0ba24362b585d1b31
treea4d6f4ec7a4ce32b397fbca1a0e6510539da14dc
parent6d5f11ab345b05759c22acbcd2f79928311689e3
driconfig: add a new engine name/version parameter

Vulkan applications can register with the following structure :

typedef struct VkApplicationInfo {
    VkStructureType    sType;
    const void*        pNext;
    const char*        pApplicationName;
    uint32_t           applicationVersion;
    const char*        pEngineName;
    uint32_t           engineVersion;
    uint32_t           apiVersion;
} VkApplicationInfo;

This enables the Vulkan implementations to apply workarounds based off
matching this description.

Here we add a new parameter for matching the driconfig options with
the following :

    <device driver="anv">
        <application engine_name_match="MyOwnEngine.*" engine_versions="10:12,40:42">
            <option name="blaaah" value="true" />
        </application>
    </device>

v2: switch engine name match to use regexps

v3: Verify that the regexec returns REG_NOMATCH for match failure (Eric)

v4: Add missing bit that went to the following commit (Eric)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: 19.2 <mesa-stable@lists.freedesktop.org>
14 files changed:
src/amd/vulkan/radv_device.c
src/gallium/auxiliary/pipe-loader/pipe_loader.c
src/gallium/targets/d3dadapter9/drm.c
src/intel/vulkan/anv_device.c
src/loader/loader.c
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/i915/intel_context.c
src/mesa/drivers/dri/i965/brw_context.c
src/mesa/drivers/dri/i965/intel_screen.c
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/radeon/radeon_context.c
src/util/00-mesa-defaults.conf
src/util/xmlconfig.c
src/util/xmlconfig.h