mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-07 13:00:21 +01:00
iris: Move iris_bo_busy_gem() to i915/iris_bufmgr.c
Signed-off-by: José Roberto de Souza <jose.souza@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21494>
This commit is contained in:
parent
7553d921f6
commit
97becc1b6f
3 changed files with 25 additions and 19 deletions
|
|
@ -27,3 +27,15 @@
|
|||
|
||||
#include "drm-uapi/i915_drm.h"
|
||||
|
||||
bool iris_i915_bo_busy_gem(struct iris_bo *bo)
|
||||
{
|
||||
assert(iris_bo_is_real(bo));
|
||||
|
||||
struct iris_bufmgr *bufmgr = bo->bufmgr;
|
||||
struct drm_i915_gem_busy busy = { .handle = bo->gem_handle };
|
||||
|
||||
if (intel_ioctl(iris_bufmgr_get_fd(bufmgr), DRM_IOCTL_I915_GEM_BUSY, &busy))
|
||||
return false;
|
||||
|
||||
return busy.busy;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,3 +26,4 @@
|
|||
|
||||
struct iris_bo;
|
||||
|
||||
bool iris_i915_bo_busy_gem(struct iris_bo *bo);
|
||||
|
|
|
|||
|
|
@ -432,21 +432,6 @@ vma_free(struct iris_bufmgr *bufmgr,
|
|||
util_vma_heap_free(&bufmgr->vma_allocator[memzone], address, size);
|
||||
}
|
||||
|
||||
static bool
|
||||
iris_bo_busy_gem(struct iris_bo *bo)
|
||||
{
|
||||
assert(iris_bo_is_real(bo));
|
||||
|
||||
struct iris_bufmgr *bufmgr = bo->bufmgr;
|
||||
struct drm_i915_gem_busy busy = { .handle = bo->gem_handle };
|
||||
|
||||
int ret = intel_ioctl(bufmgr->fd, DRM_IOCTL_I915_GEM_BUSY, &busy);
|
||||
if (ret == 0) {
|
||||
return busy.busy;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/* A timeout of 0 just checks for busyness. */
|
||||
static int
|
||||
iris_bo_wait_syncobj(struct iris_bo *bo, int64_t timeout_ns)
|
||||
|
|
@ -518,10 +503,18 @@ bool
|
|||
iris_bo_busy(struct iris_bo *bo)
|
||||
{
|
||||
bool busy;
|
||||
if (iris_bo_is_external(bo))
|
||||
busy = iris_bo_busy_gem(bo);
|
||||
else
|
||||
busy = iris_bo_busy_syncobj(bo);
|
||||
|
||||
switch (iris_bufmgr_get_device_info(bo->bufmgr)->kmd_type) {
|
||||
case INTEL_KMD_TYPE_I915:
|
||||
if (iris_bo_is_external(bo))
|
||||
busy = iris_i915_bo_busy_gem(bo);
|
||||
else
|
||||
busy = iris_bo_busy_syncobj(bo);
|
||||
break;
|
||||
default:
|
||||
unreachable("missing");
|
||||
busy = true;
|
||||
}
|
||||
|
||||
bo->idle = !busy;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue