drivers/gpu/drm/xe/xe_pxp_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_pxp_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_pxp_debugfs.c- Extension
.c- Size
- 2882 bytes
- Lines
- 130
- 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.
- Allocates kernel memory; connect allocation flags and lifetime to context constraints.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
xe_pxp_debugfs.hlinux/debugfs.hdrm/drm_debugfs.hdrm/drm_managed.hdrm/drm_print.hxe_device_types.hxe_pxp.hxe_pxp_types.hregs/xe_irq_regs.h
Detected Declarations
function pxp_infofunction pxp_terminatefunction xe_pxp_debugfs_register
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2024 Intel Corporation
*/
#include "xe_pxp_debugfs.h"
#include <linux/debugfs.h>
#include <drm/drm_debugfs.h>
#include <drm/drm_managed.h>
#include <drm/drm_print.h>
#include "xe_device_types.h"
#include "xe_pxp.h"
#include "xe_pxp_types.h"
#include "regs/xe_irq_regs.h"
static struct xe_pxp *node_to_pxp(struct drm_info_node *node)
{
return node->info_ent->data;
}
static const char *pxp_status_to_str(struct xe_pxp *pxp)
{
lockdep_assert_held(&pxp->mutex);
switch (pxp->status) {
case XE_PXP_ERROR:
return "error";
case XE_PXP_NEEDS_TERMINATION:
return "needs termination";
case XE_PXP_TERMINATION_IN_PROGRESS:
return "termination in progress";
case XE_PXP_READY_TO_START:
return "ready to start";
case XE_PXP_ACTIVE:
return "active";
case XE_PXP_SUSPENDED:
return "suspended";
default:
return "unknown";
}
};
static int pxp_info(struct seq_file *m, void *data)
{
struct xe_pxp *pxp = node_to_pxp(m->private);
struct drm_printer p = drm_seq_file_printer(m);
const char *status;
if (!xe_pxp_is_enabled(pxp))
return -ENODEV;
mutex_lock(&pxp->mutex);
status = pxp_status_to_str(pxp);
drm_printf(&p, "status: %s\n", status);
drm_printf(&p, "instance counter: %u\n", pxp->key_instance);
mutex_unlock(&pxp->mutex);
return 0;
}
static int pxp_terminate(struct seq_file *m, void *data)
{
struct xe_pxp *pxp = node_to_pxp(m->private);
struct drm_printer p = drm_seq_file_printer(m);
int ready = xe_pxp_get_readiness_status(pxp);
if (ready < 0)
return ready; /* disabled or error occurred */
else if (!ready)
return -EBUSY; /* init still in progress */
/* no need for a termination if PXP is not active */
if (pxp->status != XE_PXP_ACTIVE) {
drm_printf(&p, "PXP not active\n");
return 0;
}
/* simulate a termination interrupt */
spin_lock_irq(&pxp->xe->irq.lock);
xe_pxp_irq_handler(pxp->xe, KCR_PXP_STATE_TERMINATED_INTERRUPT);
spin_unlock_irq(&pxp->xe->irq.lock);
drm_printf(&p, "PXP termination queued\n");
return 0;
}
Annotation
- Immediate include surface: `xe_pxp_debugfs.h`, `linux/debugfs.h`, `drm/drm_debugfs.h`, `drm/drm_managed.h`, `drm/drm_print.h`, `xe_device_types.h`, `xe_pxp.h`, `xe_pxp_types.h`.
- Detected declarations: `function pxp_info`, `function pxp_terminate`, `function xe_pxp_debugfs_register`.
- 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.