drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.c- Extension
.c- Size
- 13344 bytes
- Lines
- 449
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
drm/drm_print.hgem/i915_gem_internal.hgt/intel_context.hgt/intel_gt.hgt/uc/intel_gsc_fw.hgt/uc/intel_gsc_uc_heci_cmd_submit.hi915_drv.hintel_pxp.hintel_pxp_cmd_interface_42.hintel_pxp_cmd_interface_43.hintel_pxp_gsccs.hintel_pxp_types.h
Detected Declarations
function Copyrightfunction fw_err_to_stringfunction gsccs_send_messagefunction gsccs_send_message_retry_completefunction intel_pxp_gsccs_is_ready_for_sessionsfunction intel_pxp_gsccs_create_sessionfunction intel_pxp_gsccs_end_arb_fw_sessionfunction gsccs_cleanup_fw_host_session_handlefunction gsccs_destroy_execution_resourcefunction gsccs_create_bufferfunction gsccs_allocate_execution_resourcefunction intel_pxp_gsccs_finifunction intel_pxp_gsccs_init
Annotated Snippet
if (is_fw_err_platform_config(pxp, msg_out.header.status)) {
drm_info_once(&i915->drm,
"PXP init-session-%d failed due to BIOS/SOC:0x%08x:%s\n",
arb_session_id, msg_out.header.status,
fw_err_to_string(msg_out.header.status));
} else {
drm_dbg(&i915->drm, "PXP init-session-%d failed 0x%08x:%st:\n",
arb_session_id, msg_out.header.status,
fw_err_to_string(msg_out.header.status));
drm_dbg(&i915->drm, " cmd-detail: ID=[0x%08x],API-Ver-[0x%08x]\n",
msg_in.header.command_id, msg_in.header.api_version);
}
}
return ret;
}
void intel_pxp_gsccs_end_arb_fw_session(struct intel_pxp *pxp, u32 session_id)
{
struct drm_i915_private *i915 = pxp->ctrl_gt->i915;
struct pxp42_inv_stream_key_in msg_in = {};
struct pxp42_inv_stream_key_out msg_out = {};
int ret = 0;
/*
* Stream key invalidation reuses the same version 4.2 input/output
* command format but firmware requires 4.3 API interaction
*/
msg_in.header.api_version = PXP_APIVER(4, 3);
msg_in.header.command_id = PXP42_CMDID_INVALIDATE_STREAM_KEY;
msg_in.header.buffer_len = sizeof(msg_in) - sizeof(msg_in.header);
msg_in.header.stream_id = FIELD_PREP(PXP_CMDHDR_EXTDATA_SESSION_VALID, 1);
msg_in.header.stream_id |= FIELD_PREP(PXP_CMDHDR_EXTDATA_APP_TYPE, 0);
msg_in.header.stream_id |= FIELD_PREP(PXP_CMDHDR_EXTDATA_SESSION_ID, session_id);
ret = gsccs_send_message_retry_complete(pxp,
&msg_in, sizeof(msg_in),
&msg_out, sizeof(msg_out), NULL);
if (ret) {
drm_err(&i915->drm, "Failed to inv-stream-key-%u, ret=[%d]\n",
session_id, ret);
} else if (msg_out.header.status != 0) {
if (is_fw_err_platform_config(pxp, msg_out.header.status)) {
drm_info_once(&i915->drm,
"PXP inv-stream-key-%u failed due to BIOS/SOC :0x%08x:%s\n",
session_id, msg_out.header.status,
fw_err_to_string(msg_out.header.status));
} else {
drm_dbg(&i915->drm, "PXP inv-stream-key-%u failed 0x%08x:%s:\n",
session_id, msg_out.header.status,
fw_err_to_string(msg_out.header.status));
drm_dbg(&i915->drm, " cmd-detail: ID=[0x%08x],API-Ver-[0x%08x]\n",
msg_in.header.command_id, msg_in.header.api_version);
}
}
}
static void
gsccs_cleanup_fw_host_session_handle(struct intel_pxp *pxp)
{
struct drm_i915_private *i915 = pxp->ctrl_gt->i915;
int ret;
ret = gsccs_send_message_retry_complete(pxp, NULL, 0, NULL, 0, NULL);
if (ret)
drm_dbg(&i915->drm, "Failed to send gsccs msg host-session-cleanup: ret=[%d]\n",
ret);
}
static void
gsccs_destroy_execution_resource(struct intel_pxp *pxp)
{
struct gsccs_session_resources *exec_res = &pxp->gsccs_res;
if (exec_res->host_session_handle)
gsccs_cleanup_fw_host_session_handle(pxp);
if (exec_res->ce)
intel_context_put(exec_res->ce);
if (exec_res->bb_vma)
i915_vma_unpin_and_release(&exec_res->bb_vma, I915_VMA_RELEASE_MAP);
if (exec_res->pkt_vma)
i915_vma_unpin_and_release(&exec_res->pkt_vma, I915_VMA_RELEASE_MAP);
memset(exec_res, 0, sizeof(*exec_res));
}
static int
gsccs_create_buffer(struct intel_gt *gt,
const char *bufname, size_t size,
Annotation
- Immediate include surface: `drm/drm_print.h`, `gem/i915_gem_internal.h`, `gt/intel_context.h`, `gt/intel_gt.h`, `gt/uc/intel_gsc_fw.h`, `gt/uc/intel_gsc_uc_heci_cmd_submit.h`, `i915_drv.h`, `intel_pxp.h`.
- Detected declarations: `function Copyright`, `function fw_err_to_string`, `function gsccs_send_message`, `function gsccs_send_message_retry_complete`, `function intel_pxp_gsccs_is_ready_for_sessions`, `function intel_pxp_gsccs_create_session`, `function intel_pxp_gsccs_end_arb_fw_session`, `function gsccs_cleanup_fw_host_session_handle`, `function gsccs_destroy_execution_resource`, `function gsccs_create_buffer`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.