iris: Allow SET_DOMAIN to fail when allocating new GEM objects
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 21 Jul 2021 19:08:14 +0000 (12:08 -0700)
committerJason Ekstrand <jason@jlekstrand.net>
Thu, 12 Aug 2021 20:07:33 +0000 (15:07 -0500)
We're just using this as a minor optimization to allocate pages for
buffers up front outside of some kernel locking.  It's not essential.
The SET_DOMAIN ioctl may be going away in the future, so let's be a
bit cautious and try it but not fail.

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

src/gallium/drivers/iris/iris_bufmgr.c

index dd69492..e5ba11f 100644 (file)
@@ -587,10 +587,7 @@ alloc_fresh_bo(struct iris_bufmgr *bufmgr, uint64_t bo_size, bool local)
       .write_domain = 0,
    };
 
-   if (intel_ioctl(bo->bufmgr->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &sd) != 0) {
-      bo_free(bo);
-      return NULL;
-   }
+   intel_ioctl(bo->bufmgr->fd, DRM_IOCTL_I915_GEM_SET_DOMAIN, &sd);
 
    return bo;
 }