drivers/video/fbdev/omap/lcdc.c
Source file repositories/reference/linux-study-clean/drivers/video/fbdev/omap/lcdc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/video/fbdev/omap/lcdc.c- Extension
.c- Size
- 17954 bytes
- Lines
- 783
- Domain
- Driver Families
- Bucket
- drivers/video
- Inferred role
- Driver Families: exported/initcall integration point
- Status
- integration 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.
- Exports symbols or registers init work; inspect boot/module ordering and who consumes the exported contract.
- 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/module.hlinux/device.hlinux/export.hlinux/interrupt.hlinux/spinlock.hlinux/err.hlinux/mm.hlinux/fb.hlinux/dma-mapping.hlinux/vmalloc.hlinux/clk.hlinux/gfp.hlinux/soc/ti/omap1-io.hlinux/soc/ti/omap1-soc.hlinux/omap-dma.hasm/mach-types.homapfb.hlcdc.hlcd_dma.h
Detected Declarations
enum lcdc_load_modefunction enable_irqsfunction disable_irqsfunction set_load_modefunction enable_controllerfunction disable_controller_asyncfunction disable_controllerfunction reset_controllerfunction setup_lcd_dmafunction lcdc_irq_handlerfunction omap_lcdc_setup_planefunction omap_lcdc_enable_planefunction load_palettefunction omap_lcdc_setcolregfunction calc_ck_divfunction setup_regsfunction omap_lcdc_set_update_modefunction omap_lcdc_get_update_modefunction omap_lcdc_suspendfunction omap_lcdc_resumefunction omap_lcdc_get_capsfunction omap_lcdc_set_dma_callbackfunction omap_lcdc_free_dma_callbackfunction lcdc_dma_handlerfunction alloc_palette_ramfunction free_palette_ramfunction alloc_fbmemfunction free_fbmemfunction setup_fbmemfunction omap_lcdc_initfunction omap_lcdc_cleanupexport omap_lcdc_set_dma_callbackexport omap_lcdc_free_dma_callback
Annotated Snippet
if (cpu_is_omap15xx()) {
BUG();
}
esize = 2;
xelem = lcdc.yres * lcdc.bpp / 16;
yelem = lcdc.xres;
break;
default:
BUG();
return;
}
#ifdef VERBOSE
dev_dbg(lcdc.fbdev->dev,
"setup_dma: src %#010lx esize %d xelem %d yelem %d\n",
src, esize, xelem, yelem);
#endif
omap_set_lcd_dma_b1(src, xelem, yelem, dma_elem_type[esize]);
if (!cpu_is_omap15xx()) {
int bpp = lcdc.bpp;
/*
* YUV support is only for external mode when we have the
* YUV window embedded in a 16bpp frame buffer.
*/
if (lcdc.color_mode == OMAPFB_COLOR_YUV420)
bpp = 16;
/* Set virtual xres elem size */
omap_set_lcd_dma_b1_vxres(
lcdc.screen_width * bpp / 8 / esize);
/* Setup transformations */
omap_set_lcd_dma_b1_rotation(var->rotate);
omap_set_lcd_dma_b1_mirror(plane->info.mirror);
}
omap_setup_lcd_dma();
}
static irqreturn_t lcdc_irq_handler(int irq, void *dev_id)
{
u32 status;
status = omap_readl(OMAP_LCDC_STATUS);
if (status & (OMAP_LCDC_STAT_FUF | OMAP_LCDC_STAT_SYNC_LOST))
reset_controller(status);
else {
if (status & OMAP_LCDC_STAT_DONE) {
u32 l;
/*
* Disable IRQ_DONE. The status bit will be cleared
* only when the controller is reenabled and we don't
* want to get more interrupts.
*/
l = omap_readl(OMAP_LCDC_CONTROL);
l &= ~OMAP_LCDC_IRQ_DONE;
omap_writel(l, OMAP_LCDC_CONTROL);
complete(&lcdc.last_frame_complete);
}
if (status & OMAP_LCDC_STAT_LOADED_PALETTE) {
disable_controller_async();
complete(&lcdc.palette_load_complete);
}
}
/*
* Clear these interrupt status bits.
* Sync_lost, FUF bits were cleared by disabling the LCD controller
* LOADED_PALETTE can be cleared this way only in palette only
* load mode. In other load modes it's cleared by disabling the
* controller.
*/
status &= ~(OMAP_LCDC_STAT_VSYNC |
OMAP_LCDC_STAT_LOADED_PALETTE |
OMAP_LCDC_STAT_ABC |
OMAP_LCDC_STAT_LINE_INT);
omap_writel(status, OMAP_LCDC_STATUS);
return IRQ_HANDLED;
}
/*
* Change to a new video mode. We defer this to a later time to avoid any
* flicker and not to mess up the current LCD DMA context. For this we disable
* the LCD controller, which will generate a DONE irq after the last frame has
* been transferred. Then it'll be safe to reconfigure both the LCD controller
* as well as the LCD DMA.
*/
static int omap_lcdc_setup_plane(int plane, int channel_out,
unsigned long offset, int screen_width,
int pos_x, int pos_y, int width, int height,
int color_mode)
Annotation
- Immediate include surface: `linux/module.h`, `linux/device.h`, `linux/export.h`, `linux/interrupt.h`, `linux/spinlock.h`, `linux/err.h`, `linux/mm.h`, `linux/fb.h`.
- Detected declarations: `enum lcdc_load_mode`, `function enable_irqs`, `function disable_irqs`, `function set_load_mode`, `function enable_controller`, `function disable_controller_async`, `function disable_controller`, `function reset_controller`, `function setup_lcd_dma`, `function lcdc_irq_handler`.
- Atlas domain: Driver Families / drivers/video.
- Implementation status: integration 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.