mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 18:40:13 +01:00
iris: Move i915_gem_set_domain() call to i915 backend
This was being called from the common code, so it was being executed for Xe KMD. Luckily Xe don't have any uAPI at 0x1f offset. There is still one user of i915_gem_set_domain() in iris_bufmgr.c so it was duplicated in i915 backend but a future patch in this series will take to remove it when the userptr code moves to backend. Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/23817>
This commit is contained in:
parent
7f6e6eb8ec
commit
36bc3da586
2 changed files with 20 additions and 7 deletions
|
|
@ -36,6 +36,19 @@
|
|||
|
||||
#define FILE_DEBUG_FLAG DEBUG_BUFMGR
|
||||
|
||||
static int
|
||||
i915_gem_set_domain(struct iris_bufmgr *bufmgr, uint32_t handle,
|
||||
uint32_t read_domains, uint32_t write_domains)
|
||||
{
|
||||
struct drm_i915_gem_set_domain sd = {
|
||||
.handle = handle,
|
||||
.read_domains = read_domains,
|
||||
.write_domain = write_domains,
|
||||
};
|
||||
return intel_ioctl(iris_bufmgr_get_fd(bufmgr),
|
||||
DRM_IOCTL_I915_GEM_SET_DOMAIN, &sd);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
i915_gem_create(struct iris_bufmgr *bufmgr,
|
||||
const struct intel_memory_class_instance **regions,
|
||||
|
|
@ -108,6 +121,13 @@ i915_gem_create(struct iris_bufmgr *bufmgr,
|
|||
&create))
|
||||
return 0;
|
||||
|
||||
if (iris_bufmgr_vram_size(bufmgr) == 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.
|
||||
*/
|
||||
i915_gem_set_domain(bufmgr, create.handle, I915_GEM_DOMAIN_CPU, 0);
|
||||
|
||||
return create.handle;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1123,13 +1123,6 @@ alloc_fresh_bo(struct iris_bufmgr *bufmgr, uint64_t bo_size, unsigned flags)
|
|||
bo->size = bo_size;
|
||||
bo->idle = true;
|
||||
|
||||
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.
|
||||
*/
|
||||
i915_gem_set_domain(bufmgr, bo->gem_handle, I915_GEM_DOMAIN_CPU, 0);
|
||||
|
||||
return bo;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue