Commit b51ed60e authored by Maarten Lankhorst's avatar Maarten Lankhorst Committed by Daniel Vetter

drm/i915: Make __engine_unpark() compatible with ww locking.

Take the ww lock around engine_unpark. Because of the
many many places where rpm is used, I chose the safest option
and used a trylock to opportunistically take this lock for
__engine_unpark.
Signed-off-by: default avatarMaarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: default avatarThomas Hellström <thomas.hellstrom@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20210323155059.628690-28-maarten.lankhorst@linux.intel.com
parent 5ace5e96
...@@ -27,12 +27,16 @@ static void dbg_poison_ce(struct intel_context *ce) ...@@ -27,12 +27,16 @@ static void dbg_poison_ce(struct intel_context *ce)
int type = i915_coherent_map_type(ce->engine->i915); int type = i915_coherent_map_type(ce->engine->i915);
void *map; void *map;
if (!i915_gem_object_trylock(obj))
return;
map = i915_gem_object_pin_map(obj, type); map = i915_gem_object_pin_map(obj, type);
if (!IS_ERR(map)) { if (!IS_ERR(map)) {
memset(map, CONTEXT_REDZONE, obj->base.size); memset(map, CONTEXT_REDZONE, obj->base.size);
i915_gem_object_flush_map(obj); i915_gem_object_flush_map(obj);
i915_gem_object_unpin_map(obj); i915_gem_object_unpin_map(obj);
} }
i915_gem_object_unlock(obj);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment