drm/i915/mtl: Add function to send command to GSC CS
authorSuraj Kandpal <suraj.kandpal@intel.com>
Thu, 16 Mar 2023 09:29:26 +0000 (14:59 +0530)
committerUma Shankar <uma.shankar@intel.com>
Thu, 23 Mar 2023 06:47:22 +0000 (12:17 +0530)
commit18fd7f8aaedfd40e19ed8228db856326afbd9aa4
tree65de33c7d76d4d4d58a77323db1b3d9db530178f
parent33898377feb8ecf45fa29965bd1618e0997f76aa
drm/i915/mtl: Add function to send command to GSC CS

Add function that takes care of sending command to gsc cs. We start
of with allocation of memory for our command intel_hdcp_gsc_message that
contains gsc cs memory header as directed in specs followed by the
actual payload hdcp message that we want to send.
Spec states that we need to poll pending bit of response header around
20 times each try being 50ms apart hence adding that to current
gsc_msg_send function
Also we use the same function to take care of both sending and receiving
hence no separate function to get the response.

--v4
-Create common function to fill in gsc_mtl_header [Alan]
-define host session bitmask [Alan]

--v5
-use i915 directly instead of gt->i915 [Alan]
-No need to make fields NULL as we are already
using kzalloc [Alan]

--v8
-change mechanism to reuse the same memory for one hdcp session[Alan]
-fix header ordering
-add comments to explain flags and host session mask [Alan]

--v9
-remove gem obj from hdcp message as we can use
i915_vma_unpin_and_release [Alan]
-move hdcp message allocation and deallocation from hdcp2_enable and
hdcp2_disable to init and teardown of HDCP [Alan]

--v10
-remove unnecessary i915_vma_unpin [Alan]

--v11
-fix comment style [Uma]

Cc: Ankit Nautiyal <ankit.k.nautiyal@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com>
Cc: Alan Pervin Teres <alan.previn.teres.alexis@intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Cc: Anshuman Gupta <anshuman.gupta@intel.com>
Signed-off-by: Suraj Kandpal <suraj.kandpal@intel.com>
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com>
Reviewed-by: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Uma Shankar <uma.shankar@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230316092927.668980-6-suraj.kandpal@intel.com
drivers/gpu/drm/i915/Makefile
drivers/gpu/drm/i915/display/intel_display_core.h
drivers/gpu/drm/i915/display/intel_hdcp_gsc.c [new file with mode: 0644]
drivers/gpu/drm/i915/display/intel_hdcp_gsc.h [new file with mode: 0644]
drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.c
drivers/gpu/drm/i915/gt/uc/intel_gsc_uc_heci_cmd_submit.h