drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/pxp/intel_pxp_tee.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/pxp/intel_pxp_tee.c- Extension
.c- Size
- 11208 bytes
- Lines
- 414
- 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
linux/component.hdrm/intel/i915_pxp_tee_interface.hdrm/intel/i915_component.hgem/i915_gem_lmem.hgt/intel_gt_print.hi915_drv.hgt/intel_gt.hintel_pxp.hintel_pxp_cmd_interface_42.hintel_pxp_huc.hintel_pxp_session.hintel_pxp_tee.hintel_pxp_types.h
Detected Declarations
function Copyrightfunction fw_err_to_stringfunction intel_pxp_tee_io_messagefunction intel_pxp_tee_stream_messagefunction i915_pxp_tee_component_bindfunction i915_pxp_tee_component_unbindfunction alloc_streaming_commandfunction free_streaming_commandfunction intel_pxp_tee_component_initfunction intel_pxp_tee_component_finifunction intel_pxp_tee_cmd_create_arb_sessionfunction intel_pxp_tee_end_arb_fw_session
Annotated Snippet
with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
/* load huc via pxp */
ret = intel_huc_fw_load_and_auth_via_gsc(&uc->huc);
if (ret < 0)
gt_probe_error(gt, "failed to load huc via gsc %d\n", ret);
}
}
/* if we are suspended, the HW will be re-initialized on resume */
wakeref = intel_runtime_pm_get_if_in_use(&i915->runtime_pm);
if (!wakeref)
return 0;
/* the component is required to fully start the PXP HW */
if (intel_pxp_is_enabled(pxp))
intel_pxp_init_hw(pxp);
intel_runtime_pm_put(&i915->runtime_pm, wakeref);
return ret;
}
static void i915_pxp_tee_component_unbind(struct device *i915_kdev,
struct device *tee_kdev, void *data)
{
struct drm_i915_private *i915 = kdev_to_i915(i915_kdev);
struct intel_pxp *pxp = i915->pxp;
intel_wakeref_t wakeref;
if (intel_pxp_is_enabled(pxp))
with_intel_runtime_pm_if_in_use(&i915->runtime_pm, wakeref)
intel_pxp_fini_hw(pxp);
mutex_lock(&pxp->tee_mutex);
pxp->pxp_component = NULL;
mutex_unlock(&pxp->tee_mutex);
if (pxp->dev_link) {
device_link_del(pxp->dev_link);
pxp->dev_link = NULL;
}
}
static const struct component_ops i915_pxp_tee_component_ops = {
.bind = i915_pxp_tee_component_bind,
.unbind = i915_pxp_tee_component_unbind,
};
static int alloc_streaming_command(struct intel_pxp *pxp)
{
struct drm_i915_private *i915 = pxp->ctrl_gt->i915;
struct drm_i915_gem_object *obj = NULL;
void *cmd;
int err;
pxp->stream_cmd.obj = NULL;
pxp->stream_cmd.vaddr = NULL;
if (!IS_DGFX(i915))
return 0;
/* allocate lmem object of one page for PXP command memory and store it */
obj = i915_gem_object_create_lmem(i915, PAGE_SIZE, I915_BO_ALLOC_CONTIGUOUS);
if (IS_ERR(obj)) {
drm_err(&i915->drm, "Failed to allocate pxp streaming command!\n");
return PTR_ERR(obj);
}
err = i915_gem_object_pin_pages_unlocked(obj);
if (err) {
drm_err(&i915->drm, "Failed to pin gsc message page!\n");
goto out_put;
}
/* map the lmem into the virtual memory pointer */
cmd = i915_gem_object_pin_map_unlocked(obj,
intel_gt_coherent_map_type(pxp->ctrl_gt,
obj, true));
if (IS_ERR(cmd)) {
drm_err(&i915->drm, "Failed to map gsc message page!\n");
err = PTR_ERR(cmd);
goto out_unpin;
}
memset(cmd, 0, obj->base.size);
pxp->stream_cmd.obj = obj;
pxp->stream_cmd.vaddr = cmd;
return 0;
Annotation
- Immediate include surface: `linux/component.h`, `drm/intel/i915_pxp_tee_interface.h`, `drm/intel/i915_component.h`, `gem/i915_gem_lmem.h`, `gt/intel_gt_print.h`, `i915_drv.h`, `gt/intel_gt.h`, `intel_pxp.h`.
- Detected declarations: `function Copyright`, `function fw_err_to_string`, `function intel_pxp_tee_io_message`, `function intel_pxp_tee_stream_message`, `function i915_pxp_tee_component_bind`, `function i915_pxp_tee_component_unbind`, `function alloc_streaming_command`, `function free_streaming_command`, `function intel_pxp_tee_component_init`, `function intel_pxp_tee_component_fini`.
- 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.