Mesa (master): intel/vulkan: Support INTEL_NO_HW environment variable

Jordan Justen jljusten at kemper.freedesktop.org
Tue Feb 27 19:17:37 UTC 2018


Module: Mesa
Branch: master
Commit: 6b274d5cc6186c06dbb8b594e54022e75f80ed8e
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=6b274d5cc6186c06dbb8b594e54022e75f80ed8e

Author: Jordan Justen <jordan.l.justen at intel.com>
Date:   Fri Feb  9 18:36:43 2018 -0800

intel/vulkan: Support INTEL_NO_HW environment variable

Signed-off-by: Jordan Justen <jordan.l.justen at intel.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias at igalia.com>
Reviewed-by: Scott D Phillips <scott.d.phillips at intel.com>

---

 src/intel/vulkan/anv_device.c  | 3 +++
 src/intel/vulkan/anv_private.h | 2 ++
 src/intel/vulkan/anv_queue.c   | 2 +-
 3 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index a83b7a39f6..dd5f2f4928 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -294,6 +294,8 @@ anv_physical_device_init(struct anv_physical_device *device,
    assert(strlen(path) < ARRAY_SIZE(device->path));
    strncpy(device->path, path, ARRAY_SIZE(device->path));
 
+   device->no_hw = getenv("INTEL_NO_HW") != NULL;
+
    device->chipset_id = anv_gem_get_param(fd, I915_PARAM_CHIPSET_ID);
    if (!device->chipset_id) {
       result = vk_error(VK_ERROR_INCOMPATIBLE_DRIVER);
@@ -1368,6 +1370,7 @@ VkResult anv_CreateDevice(
    device->_loader_data.loaderMagic = ICD_LOADER_MAGIC;
    device->instance = physical_device->instance;
    device->chipset_id = physical_device->chipset_id;
+   device->no_hw = physical_device->no_hw;
    device->lost = false;
 
    if (pAllocator)
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 104b28ee5d..fb4fd19178 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -749,6 +749,7 @@ struct anv_physical_device {
 
     struct anv_instance *                       instance;
     uint32_t                                    chipset_id;
+    bool                                        no_hw;
     char                                        path[20];
     const char *                                name;
     struct gen_device_info                      info;
@@ -852,6 +853,7 @@ struct anv_device {
 
     struct anv_instance *                       instance;
     uint32_t                                    chipset_id;
+    bool                                        no_hw;
     struct gen_device_info                      info;
     struct isl_device                           isl_dev;
     int                                         context_id;
diff --git a/src/intel/vulkan/anv_queue.c b/src/intel/vulkan/anv_queue.c
index c6b2e01c62..b0dcc882ed 100644
--- a/src/intel/vulkan/anv_queue.c
+++ b/src/intel/vulkan/anv_queue.c
@@ -39,7 +39,7 @@ anv_device_execbuf(struct anv_device *device,
                    struct drm_i915_gem_execbuffer2 *execbuf,
                    struct anv_bo **execbuf_bos)
 {
-   int ret = anv_gem_execbuffer(device, execbuf);
+   int ret = device->no_hw ? 0 : anv_gem_execbuffer(device, execbuf);
    if (ret != 0) {
       /* We don't know the real error. */
       device->lost = true;




More information about the mesa-commit mailing list