drm/i915/pxp: Add ARB session creation and cleanup
authorAlan Previn <alan.previn.teres.alexis@intel.com>
Thu, 11 May 2023 23:17:35 +0000 (16:17 -0700)
committerRadhakrishna Sripada <radhakrishna.sripada@intel.com>
Fri, 12 May 2023 00:26:29 +0000 (17:26 -0700)
commit99afb7cc8c44578615200ea4806b183e1e35a81d
tree34fd16848fa9b1840f6ee80c0dd831109642abdb
parentdc9ac125d81faf4761574a9f613ebc8eb35717e1
drm/i915/pxp: Add ARB session creation and cleanup

Add MTL's function for ARB session creation using PXP firmware
version 4.3 ABI structure format.

While relooking at the ARB session creation flow in intel_pxp_start,
let's address missing UAPI documentation. Without actually changing
backward compatible behavior, update i915's drm-uapi comments
that describe the possible error values when creating a context
with I915_CONTEXT_PARAM_PROTECTED_CONTENT:
   Since the first merge of PXP support on ADL, i915 returns -ENXIO
   if a dependency such as firmware or component driver was yet to
   be loaded or returns -EIO if the creation attempt failed when
   requested by the PXP firmware (specific firmware error responses
   are reported in dmesg).

Add MTL's function for ARB session invalidation but this
reuses PXP firmware version 4.2 ABI structure format.

For both cases, in the back-end gsccs functions for sending messages
to the firmware inspect the GSC-CS-Mem-Header's pending-bit which
means the GSC firmware is busy and we should retry.

Given the last hw requirement, lets also update functions in
front-end layer that wait for session creation or teardown
completion to use new worst case timeout periods.

Signed-off-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Signed-off-by: Radhakrishna Sripada <radhakrishna.sripada@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230511231738.1077674-6-alan.previn.teres.alexis@intel.com
drivers/gpu/drm/i915/pxp/intel_pxp.c
drivers/gpu/drm/i915/pxp/intel_pxp_cmd_interface_43.h
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h
drivers/gpu/drm/i915/pxp/intel_pxp_session.c
include/uapi/drm/i915_drm.h