iris: support INTEL_NO_HW environment variable
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>
Tue, 9 Apr 2019 16:40:06 +0000 (12:40 -0400)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 10 Apr 2019 19:59:17 +0000 (12:59 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/drivers/iris/iris_batch.c
src/gallium/drivers/iris/iris_screen.c
src/gallium/drivers/iris/iris_screen.h

index 556422c38bca13704f2253ee86e00effb60b28c0..2e349891fbd688aecd6e4ac057eb27383aabe501 100644 (file)
@@ -491,7 +491,7 @@ submit_batch(struct iris_batch *batch)
          (uintptr_t)util_dynarray_begin(&batch->exec_fences);
    }
 
-   int ret = drm_ioctl(batch->screen->fd,
+   int ret = batch->screen->no_hw ? 0 : drm_ioctl(batch->screen->fd,
                        DRM_IOCTL_I915_GEM_EXECBUFFER2,
                        &execbuf);
    if (ret != 0) {
index 6a06eccf2ed1a4a6206f3323c2f63b694241c058..5333a2a303cfe30abe75811525519200a81d4360 100644 (file)
@@ -560,6 +560,9 @@ iris_screen_create(int fd)
    screen->devinfo.timestamp_frequency =
       iris_getparam_integer(screen, I915_PARAM_CS_TIMESTAMP_FREQUENCY);
 
+   if (getenv("INTEL_NO_HW") != NULL)
+      screen->no_hw = true;
+
    screen->bufmgr = iris_bufmgr_init(&screen->devinfo, fd);
    if (!screen->bufmgr)
       return NULL;
index 386a5ba6343325a8626d9887ab046ec7f7c079d5..475975747c3963404b0e591944c1b53911ec1dd4 100644 (file)
@@ -52,6 +52,8 @@ struct iris_screen {
    /** PCI ID for our GPU device */
    int pci_id;
 
+   bool no_hw;
+
    /** Global program_string_id counter (see get_program_string_id()) */
    unsigned program_id;