@@ -507,16 +507,16 @@ static inline struct intel_engine_cs *
i915_gem_object_last_write_engine(struct drm_i915_gem_object *obj)
{
struct intel_engine_cs *engine = NULL;
+ struct dma_resv_iter cursor;
struct dma_fence *fence;
- rcu_read_lock();
- fence = dma_resv_get_excl_unlocked(obj->base.resv);
- rcu_read_unlock();
-
- if (fence && dma_fence_is_i915(fence) && !dma_fence_is_signaled(fence))
- engine = to_request(fence)->engine;
- dma_fence_put(fence);
-
+ dma_resv_iter_begin(&cursor, obj->base.resv, false);
+ dma_resv_for_each_fence_unlocked(&cursor, fence) {
+ if (fence && dma_fence_is_i915(fence) &&
+ !dma_fence_is_signaled(fence))
+ engine = to_request(fence)->engine;
+ }
+ dma_resv_iter_end(&cursor);
return engine;
}
This is maybe even a fix since the RCU usage here looks incorrect. Signed-off-by: Christian König <christian.koenig@amd.com> --- drivers/gpu/drm/i915/gem/i915_gem_object.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)