drivers/gpu/drm/loongson/lsdc_drv.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/loongson/lsdc_drv.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/loongson/lsdc_drv.h- Extension
.h- Size
- 9384 bytes
- Lines
- 389
- 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.
- Touches IRQ or DMA behavior; this matters for the representative real-device path.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/pci.hdrm/drm_connector.hdrm/drm_crtc.hdrm/drm_device.hdrm/drm_encoder.hdrm/drm_file.hdrm/drm_plane.hdrm/ttm/ttm_device.hlsdc_i2c.hlsdc_irq.hlsdc_gfxpll.hlsdc_output.hlsdc_pixpll.hlsdc_regs.h
Detected Declarations
struct lsdc_kms_funcsstruct lsdc_descstruct loongson_gfx_descstruct lsdc_reg32struct lsdc_crtcstruct lsdc_crtc_hw_opsstruct lsdc_crtcstruct lsdc_primarystruct lsdc_primary_plane_opsstruct lsdc_primarystruct lsdc_cursorstruct lsdc_cursor_plane_opsstruct lsdc_cursorstruct lsdc_outputstruct lsdc_display_pipestruct lsdc_kms_funcsstruct lsdc_crtc_statestruct lsdc_gemstruct lsdc_deviceenum loongson_chip_idfunction to_loongson_gfxfunction connector_to_lsdc_outputfunction encoder_to_lsdc_outputfunction output_to_display_pipefunction to_lsdc_crtcfunction crtc_to_display_pipefunction to_lsdc_primaryfunction to_lsdc_cursorfunction to_lsdc_crtc_statefunction lsdc_rreg32function lsdc_wreg32function lsdc_ureg32_setfunction lsdc_ureg32_clrfunction lsdc_pipe_rreg32function lsdc_pipe_wreg32
Annotated Snippet
struct lsdc_desc {
u32 num_of_crtc;
u32 max_pixel_clk;
u32 max_width;
u32 max_height;
u32 num_of_hw_cursor;
u32 hw_cursor_w;
u32 hw_cursor_h;
u32 pitch_align; /* CRTC DMA alignment constraint */
bool has_vblank_counter; /* 32 bit hw vsync counter */
/* device dependent ops, dc side */
const struct lsdc_kms_funcs *funcs;
};
/* GFX related resources wrangler */
struct loongson_gfx_desc {
struct lsdc_desc dc;
u32 conf_reg_base;
/* GFXPLL shared by the DC, GMC and GPU */
struct {
u32 reg_offset;
u32 reg_size;
} gfxpll;
/* Pixel PLL, per display pipe */
struct {
u32 reg_offset;
u32 reg_size;
} pixpll[LSDC_NUM_CRTC];
enum loongson_chip_id chip_id;
char model[64];
};
static inline const struct loongson_gfx_desc *
to_loongson_gfx(const struct lsdc_desc *dcp)
{
return container_of_const(dcp, struct loongson_gfx_desc, dc);
};
struct lsdc_reg32 {
char *name;
u32 offset;
};
/* crtc hardware related ops */
struct lsdc_crtc;
struct lsdc_crtc_hw_ops {
void (*enable)(struct lsdc_crtc *lcrtc);
void (*disable)(struct lsdc_crtc *lcrtc);
void (*enable_vblank)(struct lsdc_crtc *lcrtc);
void (*disable_vblank)(struct lsdc_crtc *lcrtc);
void (*flip)(struct lsdc_crtc *lcrtc);
void (*clone)(struct lsdc_crtc *lcrtc);
void (*get_scan_pos)(struct lsdc_crtc *lcrtc, int *hpos, int *vpos);
void (*set_mode)(struct lsdc_crtc *lcrtc, const struct drm_display_mode *mode);
void (*soft_reset)(struct lsdc_crtc *lcrtc);
void (*reset)(struct lsdc_crtc *lcrtc);
u32 (*get_vblank_counter)(struct lsdc_crtc *lcrtc);
void (*set_dma_step)(struct lsdc_crtc *lcrtc, enum lsdc_dma_steps step);
};
struct lsdc_crtc {
struct drm_crtc base;
struct lsdc_pixpll pixpll;
struct lsdc_device *ldev;
const struct lsdc_crtc_hw_ops *hw_ops;
const struct lsdc_reg32 *preg;
unsigned int nreg;
struct drm_info_list *p_info_list;
unsigned int n_info_list;
bool has_vblank;
};
/* primary plane hardware related ops */
struct lsdc_primary;
struct lsdc_primary_plane_ops {
void (*update_fb_addr)(struct lsdc_primary *plane, u64 addr);
void (*update_fb_stride)(struct lsdc_primary *plane, u32 stride);
void (*update_fb_format)(struct lsdc_primary *plane,
const struct drm_format_info *format);
Annotation
- Immediate include surface: `linux/pci.h`, `drm/drm_connector.h`, `drm/drm_crtc.h`, `drm/drm_device.h`, `drm/drm_encoder.h`, `drm/drm_file.h`, `drm/drm_plane.h`, `drm/ttm/ttm_device.h`.
- Detected declarations: `struct lsdc_kms_funcs`, `struct lsdc_desc`, `struct loongson_gfx_desc`, `struct lsdc_reg32`, `struct lsdc_crtc`, `struct lsdc_crtc_hw_ops`, `struct lsdc_crtc`, `struct lsdc_primary`, `struct lsdc_primary_plane_ops`, `struct lsdc_primary`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- IRQ or DMA behavior appears here, which is relevant to the selected PCIe/NVMe device path.
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.