drivers/gpu/drm/loongson/loongson_device.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/loongson/loongson_device.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/loongson/loongson_device.c- Extension
.c- Size
- 2377 bytes
- Lines
- 103
- 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/pci.hlsdc_drv.h
Detected Declarations
function lsdc_device_probe
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0+
/*
* Copyright (C) 2023 Loongson Technology Corporation Limited
*/
#include <linux/pci.h>
#include "lsdc_drv.h"
static const struct lsdc_kms_funcs ls7a1000_kms_funcs = {
.create_i2c = lsdc_create_i2c_chan,
.irq_handler = ls7a1000_dc_irq_handler,
.output_init = ls7a1000_output_init,
.cursor_plane_init = ls7a1000_cursor_plane_init,
.primary_plane_init = lsdc_primary_plane_init,
.crtc_init = ls7a1000_crtc_init,
};
static const struct lsdc_kms_funcs ls7a2000_kms_funcs = {
.create_i2c = lsdc_create_i2c_chan,
.irq_handler = ls7a2000_dc_irq_handler,
.output_init = ls7a2000_output_init,
.cursor_plane_init = ls7a2000_cursor_plane_init,
.primary_plane_init = lsdc_primary_plane_init,
.crtc_init = ls7a2000_crtc_init,
};
static const struct loongson_gfx_desc ls7a1000_gfx = {
.dc = {
.num_of_crtc = 2,
.max_pixel_clk = 200000,
.max_width = 2048,
.max_height = 2048,
.num_of_hw_cursor = 1,
.hw_cursor_w = 32,
.hw_cursor_h = 32,
.pitch_align = 256,
.has_vblank_counter = false,
.funcs = &ls7a1000_kms_funcs,
},
.conf_reg_base = LS7A1000_CONF_REG_BASE,
.gfxpll = {
.reg_offset = LS7A1000_PLL_GFX_REG,
.reg_size = 8,
},
.pixpll = {
[0] = {
.reg_offset = LS7A1000_PIXPLL0_REG,
.reg_size = 8,
},
[1] = {
.reg_offset = LS7A1000_PIXPLL1_REG,
.reg_size = 8,
},
},
.chip_id = CHIP_LS7A1000,
.model = "LS7A1000 bridge chipset",
};
static const struct loongson_gfx_desc ls7a2000_gfx = {
.dc = {
.num_of_crtc = 2,
.max_pixel_clk = 350000,
.max_width = 4096,
.max_height = 4096,
.num_of_hw_cursor = 2,
.hw_cursor_w = 64,
.hw_cursor_h = 64,
.pitch_align = 64,
.has_vblank_counter = true,
.funcs = &ls7a2000_kms_funcs,
},
.conf_reg_base = LS7A2000_CONF_REG_BASE,
.gfxpll = {
.reg_offset = LS7A2000_PLL_GFX_REG,
.reg_size = 8,
},
.pixpll = {
[0] = {
.reg_offset = LS7A2000_PIXPLL0_REG,
.reg_size = 8,
},
[1] = {
.reg_offset = LS7A2000_PIXPLL1_REG,
.reg_size = 8,
},
},
.chip_id = CHIP_LS7A2000,
.model = "LS7A2000 bridge chipset",
};
Annotation
- Immediate include surface: `linux/pci.h`, `lsdc_drv.h`.
- Detected declarations: `function lsdc_device_probe`.
- 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.