[PATCH v5 3/8] drm/i915/pxp: Add MTL helpers to submit Heci-Cmd-Packet to GSC

Teres Alexis, Alan Previn alan.previn.teres.alexis at intel.com
Wed Feb 22 23:41:38 UTC 2023


On Tue, 2023-02-14 at 13:38 -0800, Teres Alexis, Alan Previn wrote:
> Add helper functions into a new file for heci-packet-submission.
> The helpers will handle generating the MTL GSC-CS Memory-Header
> and submission of the Heci-Cmd-Packet instructions to the engine.
> 
> NOTE1: These common functions for heci-packet-submission will be used
> by different i915 callers:
>      1- GSC-SW-Proxy: This is pending upstream publication awaiting
>         a few remaining opens
>      2- MTL-HDCP: An equivalent patch has also been published at:
>         https://patchwork.freedesktop.org/series/111876/. (Patch 1)
>      3- PXP: This series.
> 
> NOTE2: A difference in this patch vs what is appearing is in bullet 2
> above is that HDCP (and SW-Proxy) will be using priveleged submission
> (GGTT and common gsc-uc-context) while PXP will be using non-priveleged
> PPGTT, context and batch buffer. Therefore this patch will only slightly
> overlap with the MTL-HDCP patches despite have very similar function
> names (emit_foo vs emit_nonpriv_foo). This is because HECI_CMD_PKT
> instructions require different flows and hw-specific code when done
> via PPGTT based submission (not different from other engines). MTL-HDCP
> contains the same intel_gsc_mtl_header_t structures as this but the
> helpers there are different. Both add the same new file names.
> 

alan: snip

> +int
> +intel_gsc_uc_heci_cmd_submit_nonpriv(struct intel_gsc_uc *gsc,
> +				     struct intel_context *ce,
> +				     struct intel_gsc_heci_non_priv_pkt *pkt,
> +				     u32 *cmd, int timeout_ms)
> +{
> +	struct intel_engine_cs *eng;
> +	struct i915_request *rq;
> +	int err;
> +
> +	rq = intel_context_create_request(ce);

alan: i need to  this to below the vma-lock-unlock pairs below to avoid any kind of lockdep warning because of expected primed ordering of calls across driver

> +	if (IS_ERR(rq))
> +		return PTR_ERR(rq);
> +
> +	emit_gsc_heci_pkt_nonpriv(cmd, pkt);
> +
> +	i915_vma_lock(pkt->bb_vma);
> +	err = i915_vma_move_to_active(pkt->bb_vma, rq, EXEC_OBJECT_WRITE);
> +	i915_vma_unlock(pkt->bb_vma);
> +	if (err)
> +		return err;
> +
> +	i915_vma_lock(pkt->heci_pkt_vma);
> +	err = i915_vma_move_to_active(pkt->heci_pkt_vma, rq, EXEC_OBJECT_WRITE);
> +	i915_vma_unlock(pkt->heci_pkt_vma);
> +	if (err)
> +		return err;
> +
> +	eng = rq->context->engine;
> +	if (eng->emit_init_breadcrumb) {
> +		err = eng->emit_init_breadcrumb(rq);
> +		if (err)
> +			goto out_rq;
> +	}

alan: snip


More information about the dri-devel mailing list