@@ -1848,7 +1848,7 @@ static bool bo_has_valid_encryption(struct drm_i915_gem_object *obj)
{
struct drm_i915_private *i915 = to_i915(obj->base.dev);
- return intel_pxp_key_check(&to_gt(i915)->pxp, obj, false) == 0;
+ return intel_pxp_key_check(i915, obj, false) == 0;
}
static bool pxp_is_borked(struct drm_i915_gem_object *obj)
@@ -869,7 +869,7 @@ static struct i915_vma *eb_lookup_vma(struct i915_execbuffer *eb, u32 handle)
*/
if (i915_gem_context_uses_protected_content(eb->gem_context) &&
i915_gem_object_is_protected(obj)) {
- err = intel_pxp_key_check(&vm->gt->pxp, obj, true);
+ err = intel_pxp_key_check(vm->gt->i915, obj, true);
if (err) {
i915_gem_object_put(obj);
return ERR_PTR(err);
@@ -300,10 +300,18 @@ void intel_pxp_fini_hw(struct intel_pxp *pxp)
intel_pxp_irq_disable(pxp);
}
-int intel_pxp_key_check(struct intel_pxp *pxp,
+int intel_pxp_key_check(struct drm_i915_private *i915,
struct drm_i915_gem_object *obj,
bool assign)
{
+ struct intel_gt *gt = intel_pxp_get_owning_gt(i915);
+ struct intel_pxp *pxp;
+
+ if (!gt)
+ return -ENODEV;
+
+ pxp = >->pxp;
+
if (!intel_pxp_is_active_on_gt(pxp))
return -ENODEV;
@@ -34,7 +34,7 @@ void intel_pxp_mark_termination_in_progress(struct intel_pxp *pxp);
int intel_pxp_start(struct drm_i915_private *i915);
-int intel_pxp_key_check(struct intel_pxp *pxp,
+int intel_pxp_key_check(struct drm_i915_private *i915,
struct drm_i915_gem_object *obj,
bool assign);