drivers/gpu/drm/exynos/exynos_drm_gsc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/exynos/exynos_drm_gsc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/exynos/exynos_drm_gsc.c- Extension
.c- Size
- 37901 bytes
- Lines
- 1430
- 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.
- 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
linux/clk.hlinux/component.hlinux/kernel.hlinux/mfd/syscon.hlinux/mod_devicetable.hlinux/platform_device.hlinux/pm_runtime.hlinux/property.hlinux/regmap.hdrm/drm_fourcc.hdrm/drm_print.hdrm/exynos_drm.hexynos_drm_drv.hexynos_drm_ipp.hregs-gsc.h
Detected Declarations
struct gsc_scalerstruct gsc_contextstruct gsc_driverdatafunction gsc_sw_resetfunction gsc_handle_irqfunction gsc_src_set_fmtfunction gsc_src_set_transffunction gsc_src_set_sizefunction gsc_src_set_buf_seqfunction gsc_src_set_addrfunction gsc_dst_set_fmtfunction gsc_get_ratio_shiftfunction gsc_get_prescaler_shfactorfunction gsc_set_prescalerfunction gsc_set_h_coeffunction gsc_set_v_coeffunction gsc_set_scalerfunction gsc_dst_set_sizefunction gsc_dst_get_buf_seqfunction gsc_dst_set_buf_seqfunction gsc_dst_set_addrfunction gsc_get_src_buf_indexfunction gsc_get_dst_buf_indexfunction gsc_irq_handlerfunction gsc_resetfunction gsc_startfunction gsc_commitfunction gsc_abortfunction gsc_bindfunction gsc_unbindfunction gsc_probefunction gsc_removefunction gsc_runtime_suspendfunction gsc_runtime_resume
Annotated Snippet
struct gsc_scaler {
bool range;
u32 pre_shfactor;
u32 pre_hratio;
u32 pre_vratio;
unsigned long main_hratio;
unsigned long main_vratio;
};
/*
* A structure of gsc context.
*
* @regs: memory mapped io registers.
* @gsc_clk: gsc gate clock.
* @sc: scaler infomations.
* @id: gsc id.
* @irq: irq number.
* @rotation: supports rotation of src.
*/
struct gsc_context {
struct exynos_drm_ipp ipp;
struct drm_device *drm_dev;
void *dma_priv;
struct device *dev;
struct exynos_drm_ipp_task *task;
struct exynos_drm_ipp_formats *formats;
unsigned int num_formats;
void __iomem *regs;
const char *const *clk_names;
struct clk *clocks[GSC_MAX_CLOCKS];
int num_clocks;
struct gsc_scaler sc;
int id;
int irq;
bool rotation;
};
/**
* struct gsc_driverdata - per device type driver data for init time.
*
* @limits: picture size limits array
* @num_limits: number of items in the aforementioned array
* @clk_names: names of clocks needed by this variant
* @num_clocks: the number of clocks needed by this variant
*/
struct gsc_driverdata {
const struct drm_exynos_ipp_limit *limits;
int num_limits;
const char *clk_names[GSC_MAX_CLOCKS];
int num_clocks;
};
/* 8-tap Filter Coefficient */
static const int h_coef_8t[GSC_COEF_RATIO][GSC_COEF_ATTR][GSC_COEF_H_8T] = {
{ /* Ratio <= 65536 (~8:8) */
{ 0, 0, 0, 128, 0, 0, 0, 0 },
{ -1, 2, -6, 127, 7, -2, 1, 0 },
{ -1, 4, -12, 125, 16, -5, 1, 0 },
{ -1, 5, -15, 120, 25, -8, 2, 0 },
{ -1, 6, -18, 114, 35, -10, 3, -1 },
{ -1, 6, -20, 107, 46, -13, 4, -1 },
{ -2, 7, -21, 99, 57, -16, 5, -1 },
{ -1, 6, -20, 89, 68, -18, 5, -1 },
{ -1, 6, -20, 79, 79, -20, 6, -1 },
{ -1, 5, -18, 68, 89, -20, 6, -1 },
{ -1, 5, -16, 57, 99, -21, 7, -2 },
{ -1, 4, -13, 46, 107, -20, 6, -1 },
{ -1, 3, -10, 35, 114, -18, 6, -1 },
{ 0, 2, -8, 25, 120, -15, 5, -1 },
{ 0, 1, -5, 16, 125, -12, 4, -1 },
{ 0, 1, -2, 7, 127, -6, 2, -1 }
}, { /* 65536 < Ratio <= 74898 (~8:7) */
{ 3, -8, 14, 111, 13, -8, 3, 0 },
{ 2, -6, 7, 112, 21, -10, 3, -1 },
{ 2, -4, 1, 110, 28, -12, 4, -1 },
{ 1, -2, -3, 106, 36, -13, 4, -1 },
{ 1, -1, -7, 103, 44, -15, 4, -1 },
{ 1, 1, -11, 97, 53, -16, 4, -1 },
{ 0, 2, -13, 91, 61, -16, 4, -1 },
{ 0, 3, -15, 85, 69, -17, 4, -1 },
{ 0, 3, -16, 77, 77, -16, 3, 0 },
{ -1, 4, -17, 69, 85, -15, 3, 0 },
{ -1, 4, -16, 61, 91, -13, 2, 0 },
{ -1, 4, -16, 53, 97, -11, 1, 1 },
{ -1, 4, -15, 44, 103, -7, -1, 1 },
{ -1, 4, -13, 36, 106, -3, -2, 1 },
{ -1, 4, -12, 28, 110, 1, -4, 2 },
{ -1, 3, -10, 21, 112, 7, -6, 2 }
}, { /* 74898 < Ratio <= 87381 (~8:6) */
Annotation
- Immediate include surface: `linux/clk.h`, `linux/component.h`, `linux/kernel.h`, `linux/mfd/syscon.h`, `linux/mod_devicetable.h`, `linux/platform_device.h`, `linux/pm_runtime.h`, `linux/property.h`.
- Detected declarations: `struct gsc_scaler`, `struct gsc_context`, `struct gsc_driverdata`, `function gsc_sw_reset`, `function gsc_handle_irq`, `function gsc_src_set_fmt`, `function gsc_src_set_transf`, `function gsc_src_set_size`, `function gsc_src_set_buf_seq`, `function gsc_src_set_addr`.
- 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.