Mesa (main): iris: Stop using SET_DOMAIN on discrete GPUs altogether

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Aug 12 20:22:45 UTC 2021


Module: Mesa
Branch: main
Commit: cca51207725e9edb0410d57ff6d0c437238c0648
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=cca51207725e9edb0410d57ff6d0c437238c0648

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Wed Jul 21 12:09:59 2021 -0700

iris: Stop using SET_DOMAIN on discrete GPUs altogether

SET_DOMAIN is definitely not going to be allowed on discrete GPUs,
so don't even bother trying it.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12044>

---

 src/gallium/drivers/iris/iris_bufmgr.c | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c
index e5ba11f94c4..9534f77a6b8 100644
--- a/src/gallium/drivers/iris/iris_bufmgr.c
+++ b/src/gallium/drivers/iris/iris_bufmgr.c
@@ -577,17 +577,19 @@ alloc_fresh_bo(struct iris_bufmgr *bufmgr, uint64_t bo_size, bool local)
    bo->idle = true;
    bo->local = local;
 
-   /* Calling set_domain() will allocate pages for the BO outside of the
-    * struct mutex lock in the kernel, which is more efficient than waiting
-    * to create them during the first execbuf that uses the BO.
-    */
-   struct drm_i915_gem_set_domain sd = {
-      .handle = bo->gem_handle,
-      .read_domains = I915_GEM_DOMAIN_CPU,
-      .write_domain = 0,
-   };
+   if (bufmgr->vram.size == 0) {
+      /* Calling set_domain() will allocate pages for the BO outside of the
+       * struct mutex lock in the kernel, which is more efficient than waiting
+       * to create them during the first execbuf that uses the BO.
+       */
+      struct drm_i915_gem_set_domain sd = {
+         .handle = bo->gem_handle,
+         .read_domains = I915_GEM_DOMAIN_CPU,
+         .write_domain = 0,
+      };
 
-   intel_ioctl(bo->bufmgr->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &sd);
+      intel_ioctl(bo->bufmgr->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &sd);
+   }
 
    return bo;
 }



More information about the mesa-commit mailing list