drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/intel_gt_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/intel_gt_debugfs.c- Extension
.c- Size
- 2826 bytes
- Lines
- 123
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/debugfs.hdrm/drm_print.hi915_drv.hintel_gt.hintel_gt_debugfs.hintel_gt_engines_debugfs.hintel_gt_mcr.hintel_gt_pm_debugfs.hintel_sseu_debugfs.huc/intel_uc_debugfs.h
Detected Declarations
function intel_gt_debugfs_reset_showfunction intel_gt_debugfs_reset_storefunction __intel_gt_debugfs_reset_showfunction __intel_gt_debugfs_reset_storefunction steering_showfunction gt_debugfs_registerfunction intel_gt_debugfs_registerfunction intel_gt_debugfs_register_files
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2019 Intel Corporation
*/
#include <linux/debugfs.h>
#include <drm/drm_print.h>
#include "i915_drv.h"
#include "intel_gt.h"
#include "intel_gt_debugfs.h"
#include "intel_gt_engines_debugfs.h"
#include "intel_gt_mcr.h"
#include "intel_gt_pm_debugfs.h"
#include "intel_sseu_debugfs.h"
#include "uc/intel_uc_debugfs.h"
int intel_gt_debugfs_reset_show(struct intel_gt *gt, u64 *val)
{
int ret = intel_gt_terminally_wedged(gt);
switch (ret) {
case -EIO:
*val = 1;
return 0;
case 0:
*val = 0;
return 0;
default:
return ret;
}
}
void intel_gt_debugfs_reset_store(struct intel_gt *gt, u64 val)
{
/* Flush any previous reset before applying for a new one */
wait_event(gt->reset.queue,
!test_bit(I915_RESET_BACKOFF, >->reset.flags));
intel_gt_handle_error(gt, val, I915_ERROR_CAPTURE,
"Manually reset engine mask to %llx", val);
}
/*
* keep the interface clean where the first parameter
* is a 'struct intel_gt *' instead of 'void *'
*/
static int __intel_gt_debugfs_reset_show(void *data, u64 *val)
{
return intel_gt_debugfs_reset_show(data, val);
}
static int __intel_gt_debugfs_reset_store(void *data, u64 val)
{
intel_gt_debugfs_reset_store(data, val);
return 0;
}
DEFINE_SIMPLE_ATTRIBUTE(reset_fops, __intel_gt_debugfs_reset_show,
__intel_gt_debugfs_reset_store, "%llu\n");
static int steering_show(struct seq_file *m, void *data)
{
struct drm_printer p = drm_seq_file_printer(m);
struct intel_gt *gt = m->private;
intel_gt_mcr_report_steering(&p, gt, true);
return 0;
}
DEFINE_INTEL_GT_DEBUGFS_ATTRIBUTE(steering);
static void gt_debugfs_register(struct intel_gt *gt, struct dentry *root)
{
static const struct intel_gt_debugfs_file files[] = {
{ .name = "reset", .fops = &reset_fops },
{ .name = "steering", .fops = &steering_fops },
};
intel_gt_debugfs_register_files(root, files, ARRAY_SIZE(files), gt);
}
void intel_gt_debugfs_register(struct intel_gt *gt)
{
struct dentry *debugfs_root = gt->i915->drm.debugfs_root;
struct dentry *root;
char gtname[4];
Annotation
- Immediate include surface: `linux/debugfs.h`, `drm/drm_print.h`, `i915_drv.h`, `intel_gt.h`, `intel_gt_debugfs.h`, `intel_gt_engines_debugfs.h`, `intel_gt_mcr.h`, `intel_gt_pm_debugfs.h`.
- Detected declarations: `function intel_gt_debugfs_reset_show`, `function intel_gt_debugfs_reset_store`, `function __intel_gt_debugfs_reset_show`, `function __intel_gt_debugfs_reset_store`, `function steering_show`, `function gt_debugfs_register`, `function intel_gt_debugfs_register`, `function intel_gt_debugfs_register_files`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.