summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEric Engestrom <[email protected]>2019-04-24 16:42:25 +0100
committerDylan Baker <[email protected]>2019-09-09 09:12:41 -0700
commit172cff63576c7caa02ca456cec61d7a1a62dfe2a (patch)
treea19698a35f2e84e2a388268090dd812d54407655 /src
parentc1114994f3c98753972b471cd4173a247d272681 (diff)
anv: add support for driconf
No option is supported yet, this is just the boilerplate. Cc: [email protected] Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> (cherry picked from commit 4dcb1fff19383ae451f3228e55d3fc987a7ab46d)
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_device.c12
-rw-r--r--src/intel/vulkan/anv_private.h4
-rw-r--r--src/intel/vulkan/anv_wsi.c2
-rw-r--r--src/intel/vulkan/meson.build4
4 files changed, 19 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index f15575ba31a..1777be65aa5 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -40,6 +40,7 @@
#include "util/os_file.h"
#include "util/u_atomic.h"
#include "util/u_string.h"
+#include "util/xmlpool.h"
#include "git_sha1.h"
#include "vk_util.h"
#include "common/gen_defines.h"
@@ -47,6 +48,10 @@
#include "genxml/gen7_pack.h"
+static const char anv_dri_options_xml[] =
+DRI_CONF_BEGIN
+DRI_CONF_END;
+
/* This is probably far to big but it reflects the max size used for messages
* in OpenGLs KHR_debug.
*/
@@ -768,6 +773,10 @@ VkResult anv_CreateInstance(
VG(VALGRIND_CREATE_MEMPOOL(instance, 0, false));
+ driParseOptionInfo(&instance->available_dri_options, anv_dri_options_xml);
+ driParseConfigFiles(&instance->dri_options, &instance->available_dri_options,
+ 0, "anv", NULL);
+
*pInstance = anv_instance_to_handle(instance);
return VK_SUCCESS;
@@ -798,6 +807,9 @@ void anv_DestroyInstance(
glsl_type_singleton_decref();
_mesa_locale_fini();
+ driDestroyOptionCache(&instance->dri_options);
+ driDestroyOptionInfo(&instance->available_dri_options);
+
vk_free(&instance->alloc, instance);
}
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index b6bb2019bb3..9298ed88a49 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -57,6 +57,7 @@
#include "util/u_vector.h"
#include "util/u_math.h"
#include "util/vma.h"
+#include "util/xmlconfig.h"
#include "vk_alloc.h"
#include "vk_debug_report.h"
@@ -1009,6 +1010,9 @@ struct anv_instance {
bool pipeline_cache_enabled;
struct vk_debug_report_instance debug_report_callbacks;
+
+ struct driOptionCache dri_options;
+ struct driOptionCache available_dri_options;
};
VkResult anv_init_wsi(struct anv_physical_device *physical_device);
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index ba07bcef8b3..9edadb13d2d 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -50,7 +50,7 @@ anv_init_wsi(struct anv_physical_device *physical_device)
anv_wsi_proc_addr,
&physical_device->instance->alloc,
physical_device->master_fd,
- NULL);
+ &physical_device->instance->dri_options);
if (result != VK_SUCCESS)
return result;
diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build
index 5aa35738060..81659708815 100644
--- a/src/intel/vulkan/meson.build
+++ b/src/intel/vulkan/meson.build
@@ -178,7 +178,7 @@ libanv_common = static_library(
],
include_directories : [
inc_common, inc_intel, inc_compiler, inc_include,
- inc_vulkan_wsi,
+ inc_vulkan_wsi, inc_util,
],
c_args : anv_flags,
dependencies : anv_deps,
@@ -196,7 +196,7 @@ libvulkan_intel = shared_library(
],
dependencies : [
dep_thread, dep_dl, dep_m, anv_deps, idep_libintel_common,
- idep_nir, idep_genxml, idep_vulkan_util, idep_mesautil,
+ idep_nir, idep_genxml, idep_vulkan_util, idep_mesautil, idep_xmlconfig,
],
c_args : anv_flags,
link_args : ['-Wl,--build-id=sha1', ld_args_bsymbolic, ld_args_gc_sections],