Mesa (staging/19.1): anv: add support for driconf

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Sep 9 11:31:42 UTC 2019


Module: Mesa
Branch: staging/19.1
Commit: 2977a3e0e1a5f0950001e12402c9936e5d38ab9e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2977a3e0e1a5f0950001e12402c9936e5d38ab9e

Author: Eric Engestrom <eric.engestrom at intel.com>
Date:   Wed Apr 24 16:42:25 2019 +0100

anv: add support for driconf

No option is supported yet, this is just the boilerplate.

Cc: mesa-stable at lists.freedesktop.org
Signed-off-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
(cherry picked from commit 4dcb1fff19383ae451f3228e55d3fc987a7ab46d)
[Juan A. Suarez: resolve trivial conflicts]
Signed-off-by: Juan A. Suarez Romero <jasuarez at igalia.com>

Conflicts:
	src/intel/vulkan/meson.build

---

 src/intel/vulkan/anv_device.c  | 12 ++++++++++++
 src/intel/vulkan/anv_private.h |  4 ++++
 src/intel/vulkan/anv_wsi.c     |  2 +-
 src/intel/vulkan/meson.build   |  2 +-
 4 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 8ec7df2a45d..eb8112b10bd 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.
  */
@@ -776,6 +781,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;
@@ -806,6 +815,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 e86561adf97..f942410d653 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 d0120d8026c..cdc18e34be9 100644
--- a/src/intel/vulkan/meson.build
+++ b/src/intel/vulkan/meson.build
@@ -193,7 +193,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,




More information about the mesa-commit mailing list