drivers/gpu/drm/loongson/lsdc_debugfs.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/loongson/lsdc_debugfs.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/loongson/lsdc_debugfs.c- Extension
.c- Size
- 3008 bytes
- Lines
- 112
- 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
drm/drm_debugfs.hdrm/drm_print.hlsdc_benchmark.hlsdc_drv.hlsdc_gem.hlsdc_probe.hlsdc_ttm.h
Detected Declarations
function Copyrightfunction lsdc_show_mmfunction lsdc_show_gfxpll_clockfunction lsdc_show_benchmarkfunction lsdc_pdev_enable_io_memfunction lsdc_debugfs_init
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2023 Loongson Technology Corporation Limited
*/
#include <drm/drm_debugfs.h>
#include <drm/drm_print.h>
#include "lsdc_benchmark.h"
#include "lsdc_drv.h"
#include "lsdc_gem.h"
#include "lsdc_probe.h"
#include "lsdc_ttm.h"
/* device level debugfs */
static int lsdc_identify(struct seq_file *m, void *arg)
{
struct drm_info_node *node = (struct drm_info_node *)m->private;
struct lsdc_device *ldev = (struct lsdc_device *)node->info_ent->data;
const struct loongson_gfx_desc *gfx = to_loongson_gfx(ldev->descp);
u8 impl, rev;
loongson_cpu_get_prid(&impl, &rev);
seq_printf(m, "Running on cpu 0x%x, cpu revision: 0x%x\n",
impl, rev);
seq_printf(m, "Contained in: %s\n", gfx->model);
return 0;
}
static int lsdc_show_mm(struct seq_file *m, void *arg)
{
struct drm_info_node *node = (struct drm_info_node *)m->private;
struct drm_device *ddev = node->minor->dev;
struct drm_printer p = drm_seq_file_printer(m);
drm_mm_print(&ddev->vma_offset_manager->vm_addr_space_mm, &p);
return 0;
}
static int lsdc_show_gfxpll_clock(struct seq_file *m, void *arg)
{
struct drm_info_node *node = (struct drm_info_node *)m->private;
struct lsdc_device *ldev = (struct lsdc_device *)node->info_ent->data;
struct drm_printer printer = drm_seq_file_printer(m);
struct loongson_gfxpll *gfxpll = ldev->gfxpll;
gfxpll->funcs->print(gfxpll, &printer, true);
return 0;
}
static int lsdc_show_benchmark(struct seq_file *m, void *arg)
{
struct drm_info_node *node = (struct drm_info_node *)m->private;
struct lsdc_device *ldev = (struct lsdc_device *)node->info_ent->data;
struct drm_printer printer = drm_seq_file_printer(m);
lsdc_show_benchmark_copy(ldev, &printer);
return 0;
}
static int lsdc_pdev_enable_io_mem(struct seq_file *m, void *arg)
{
struct drm_info_node *node = (struct drm_info_node *)m->private;
struct lsdc_device *ldev = (struct lsdc_device *)node->info_ent->data;
u16 cmd;
pci_read_config_word(ldev->dc, PCI_COMMAND, &cmd);
seq_printf(m, "PCI_COMMAND: 0x%x\n", cmd);
cmd |= PCI_COMMAND_MEMORY | PCI_COMMAND_IO;
pci_write_config_word(ldev->dc, PCI_COMMAND, cmd);
pci_read_config_word(ldev->dc, PCI_COMMAND, &cmd);
seq_printf(m, "PCI_COMMAND: 0x%x\n", cmd);
return 0;
}
static struct drm_info_list lsdc_debugfs_list[] = {
{ "benchmark", lsdc_show_benchmark, 0, NULL },
Annotation
- Immediate include surface: `drm/drm_debugfs.h`, `drm/drm_print.h`, `lsdc_benchmark.h`, `lsdc_drv.h`, `lsdc_gem.h`, `lsdc_probe.h`, `lsdc_ttm.h`.
- Detected declarations: `function Copyright`, `function lsdc_show_mm`, `function lsdc_show_gfxpll_clock`, `function lsdc_show_benchmark`, `function lsdc_pdev_enable_io_mem`, `function lsdc_debugfs_init`.
- 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.