diff --git a/src/gallium/drivers/iris/iris_bufmgr.c b/src/gallium/drivers/iris/iris_bufmgr.c index 1c731a44989..c1e0a3dc7b8 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.c +++ b/src/gallium/drivers/iris/iris_bufmgr.c @@ -211,7 +211,7 @@ find_and_ref_external_bo(struct hash_table *ht, unsigned int key) struct iris_bo *bo = entry ? entry->data : NULL; if (bo) { - assert(bo->external); + assert(iris_bo_is_external(bo)); assert(!bo->reusable); /* Being non-reusable, the BO cannot be in the cache lists, but it @@ -762,7 +762,7 @@ bo_close(struct iris_bo *bo) { struct iris_bufmgr *bufmgr = bo->bufmgr; - if (bo->external) { + if (iris_bo_is_external(bo)) { struct hash_entry *entry; if (bo->global_name) { @@ -1297,7 +1297,7 @@ iris_bo_wait(struct iris_bo *bo, int64_t timeout_ns) struct iris_bufmgr *bufmgr = bo->bufmgr; /* If we know it's idle, don't bother with the kernel round trip */ - if (bo->idle && !bo->external) + if (bo->idle && !iris_bo_is_external(bo)) return 0; struct drm_i915_gem_wait wait = { diff --git a/src/gallium/drivers/iris/iris_bufmgr.h b/src/gallium/drivers/iris/iris_bufmgr.h index 0b098b76110..057ba888501 100644 --- a/src/gallium/drivers/iris/iris_bufmgr.h +++ b/src/gallium/drivers/iris/iris_bufmgr.h @@ -342,6 +342,15 @@ void iris_bufmgr_unref(struct iris_bufmgr *bufmgr); */ int iris_bo_flink(struct iris_bo *bo, uint32_t *name); +/** + * Is this buffer shared with external clients (imported or exported)? + */ +static inline bool +iris_bo_is_external(const struct iris_bo *bo) +{ + return bo->external; +} + /** * Make a BO externally accessible. * diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h index c8ec0b9aa6d..967ec036fd5 100644 --- a/src/gallium/drivers/iris/iris_resource.h +++ b/src/gallium/drivers/iris/iris_resource.h @@ -307,7 +307,7 @@ iris_mocs(const struct iris_bo *bo, const struct isl_device *dev, isl_surf_usage_flags_t usage) { - return isl_mocs(dev, usage, bo && bo->external); + return isl_mocs(dev, usage, bo && iris_bo_is_external(bo)); } struct iris_format_info iris_format_for_usage(const struct intel_device_info *,