drivers/gpu/drm/tegra/dc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tegra/dc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tegra/dc.c- Extension
.c- Size
- 101433 bytes
- Lines
- 3425
- 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.
- Uses kernel synchronization; read lock ordering, sleepability, and interrupt context assumptions before translating.
- 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/debugfs.hlinux/delay.hlinux/dma-mapping.hlinux/iommu.hlinux/interconnect.hlinux/module.hlinux/of.hlinux/platform_device.hlinux/pm_domain.hlinux/pm_opp.hlinux/pm_runtime.hlinux/reset.hsoc/tegra/common.hsoc/tegra/pmc.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_blend.hdrm/drm_debugfs.hdrm/drm_fourcc.hdrm/drm_framebuffer.hdrm/drm_print.hdrm/drm_vblank.hdc.hdrm.hgem.hhub.hplane.h
Detected Declarations
function tegra_dc_stats_resetfunction tegra_dc_readl_activefunction tegra_plane_offsetfunction tegra_plane_readlfunction tegra_plane_writelfunction tegra_dc_has_outputfunction of_for_each_phandlefunction tegra_dc_commitfunction compute_dda_incfunction compute_initial_ddafunction tegra_plane_setup_blending_legacyfunction tegra_plane_setup_blendingfunction tegra_plane_use_horizontal_filteringfunction tegra_plane_use_vertical_filteringfunction tegra_dc_setup_windowfunction tegra_plane_atomic_checkfunction tegra_plane_atomic_disablefunction tegra_plane_atomic_updatefunction tegra_plane_get_possible_crtcsfunction tegra_cursor_atomic_checkfunction __tegra_cursor_atomic_updatefunction tegra_cursor_atomic_updatefunction tegra_cursor_atomic_disablefunction tegra_cursor_atomic_async_checkfunction tegra_cursor_atomic_async_updatefunction tegra_dc_destroyfunction tegra_crtc_resetfunction tegra_crtc_atomic_duplicate_statefunction tegra_crtc_atomic_destroy_statefunction tegra_dc_show_regsfunction tegra_dc_show_crcfunction tegra_dc_show_statsfunction tegra_dc_late_registerfunction tegra_dc_early_unregisterfunction tegra_dc_get_vblank_counterfunction tegra_dc_enable_vblankfunction tegra_dc_disable_vblankfunction tegra_dc_set_timingsfunction tegra_dc_state_setup_clockfunction tegra_dc_update_voltage_statefunction tegra_dc_set_clock_ratefunction tegra_dc_stopfunction tegra_dc_idlefunction tegra_dc_wait_idlefunction tegra_crtc_update_memory_bandwidthfunction drm_atomic_crtc_for_each_planefunction for_each_old_plane_in_statefunction phase
Annotated Snippet
if (it.node == dev->of_node) {
of_node_put(it.node);
return true;
}
return false;
}
/*
* Double-buffered registers have two copies: ASSEMBLY and ACTIVE. When the
* *_ACT_REQ bits are set the ASSEMBLY copy is latched into the ACTIVE copy.
* Latching happens mmediately if the display controller is in STOP mode or
* on the next frame boundary otherwise.
*
* Triple-buffered registers have three copies: ASSEMBLY, ARM and ACTIVE. The
* ASSEMBLY copy is latched into the ARM copy immediately after *_UPDATE bits
* are written. When the *_ACT_REQ bits are written, the ARM copy is latched
* into the ACTIVE copy, either immediately if the display controller is in
* STOP mode, or at the next frame boundary otherwise.
*/
void tegra_dc_commit(struct tegra_dc *dc)
{
tegra_dc_writel(dc, GENERAL_ACT_REQ << 8, DC_CMD_STATE_CONTROL);
tegra_dc_writel(dc, GENERAL_ACT_REQ, DC_CMD_STATE_CONTROL);
}
static inline u32 compute_dda_inc(unsigned int in, unsigned int out, bool v,
unsigned int bpp)
{
fixed20_12 outf = dfixed_init(out);
fixed20_12 inf = dfixed_init(in);
u32 dda_inc;
int max;
if (v)
max = 15;
else {
switch (bpp) {
case 2:
max = 8;
break;
default:
WARN_ON_ONCE(1);
fallthrough;
case 4:
max = 4;
break;
}
}
outf.full = max_t(u32, outf.full - dfixed_const(1), dfixed_const(1));
inf.full -= dfixed_const(1);
dda_inc = dfixed_div(inf, outf);
dda_inc = min_t(u32, dda_inc, dfixed_const(max));
return dda_inc;
}
static inline u32 compute_initial_dda(unsigned int in)
{
fixed20_12 inf = dfixed_init(in);
return dfixed_frac(inf);
}
static void tegra_plane_setup_blending_legacy(struct tegra_plane *plane)
{
u32 background[3] = {
BLEND_WEIGHT1(0) | BLEND_WEIGHT0(0) | BLEND_COLOR_KEY_NONE,
BLEND_WEIGHT1(0) | BLEND_WEIGHT0(0) | BLEND_COLOR_KEY_NONE,
BLEND_WEIGHT1(0) | BLEND_WEIGHT0(0) | BLEND_COLOR_KEY_NONE,
};
u32 foreground = BLEND_WEIGHT1(255) | BLEND_WEIGHT0(255) |
BLEND_COLOR_KEY_NONE;
u32 blendnokey = BLEND_WEIGHT1(255) | BLEND_WEIGHT0(255);
struct tegra_plane_state *state;
u32 blending[2];
unsigned int i;
/* disable blending for non-overlapping case */
tegra_plane_writel(plane, blendnokey, DC_WIN_BLEND_NOKEY);
tegra_plane_writel(plane, foreground, DC_WIN_BLEND_1WIN);
state = to_tegra_plane_state(plane->base.state);
if (state->opaque) {
/*
* Since custom fix-weight blending isn't utilized and weight
* of top window is set to max, we can enforce dependent
Annotation
- Immediate include surface: `linux/clk.h`, `linux/debugfs.h`, `linux/delay.h`, `linux/dma-mapping.h`, `linux/iommu.h`, `linux/interconnect.h`, `linux/module.h`, `linux/of.h`.
- Detected declarations: `function tegra_dc_stats_reset`, `function tegra_dc_readl_active`, `function tegra_plane_offset`, `function tegra_plane_readl`, `function tegra_plane_writel`, `function tegra_dc_has_output`, `function of_for_each_phandle`, `function tegra_dc_commit`, `function compute_dda_inc`, `function compute_initial_dda`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
- Synchronization appears in or near this file; preserve lock ordering, sleepability, and interrupt-context constraints.
- 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.