drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_drv.c- Extension
.c- Size
- 9175 bytes
- Lines
- 391
- 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/clk-provider.hlinux/console.hlinux/io.hlinux/mfd/syscon.hlinux/mm.hlinux/module.hlinux/of_platform.hlinux/platform_device.hlinux/pm.hlinux/pm_runtime.hlinux/regmap.hdrm/clients/drm_client_setup.hdrm/drm_atomic_helper.hdrm/drm_drv.hdrm/drm_fbdev_dma.hdrm/drm_gem_dma_helper.hdrm/drm_modeset_helper.hdrm/drm_module.hdrm/drm_probe_helper.hdrm/drm_vblank.hfsl_dcu_drm_crtc.hfsl_dcu_drm_drv.hfsl_tcon.h
Detected Declarations
function fsl_dcu_drm_is_volatile_regfunction fsl_dcu_irq_resetfunction fsl_dcu_drm_irqfunction fsl_dcu_irq_installfunction fsl_dcu_irq_uninstallfunction fsl_dcu_loadfunction fsl_dcu_unloadfunction fsl_dcu_drm_pm_suspendfunction fsl_dcu_drm_pm_resumefunction fsl_dcu_drm_probefunction fsl_dcu_drm_removefunction fsl_dcu_drm_shutdown
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0-or-later
/*
* Copyright 2015 Freescale Semiconductor, Inc.
*
* Freescale DCU drm device driver
*/
#include <linux/clk.h>
#include <linux/clk-provider.h>
#include <linux/console.h>
#include <linux/io.h>
#include <linux/mfd/syscon.h>
#include <linux/mm.h>
#include <linux/module.h>
#include <linux/of_platform.h>
#include <linux/platform_device.h>
#include <linux/pm.h>
#include <linux/pm_runtime.h>
#include <linux/regmap.h>
#include <drm/clients/drm_client_setup.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_drv.h>
#include <drm/drm_fbdev_dma.h>
#include <drm/drm_gem_dma_helper.h>
#include <drm/drm_modeset_helper.h>
#include <drm/drm_module.h>
#include <drm/drm_probe_helper.h>
#include <drm/drm_vblank.h>
#include "fsl_dcu_drm_crtc.h"
#include "fsl_dcu_drm_drv.h"
#include "fsl_tcon.h"
static int legacyfb_depth = 24;
module_param(legacyfb_depth, int, 0444);
static bool fsl_dcu_drm_is_volatile_reg(struct device *dev, unsigned int reg)
{
if (reg == DCU_INT_STATUS || reg == DCU_UPDATE_MODE)
return true;
return false;
}
static const struct regmap_config fsl_dcu_regmap_config = {
.reg_bits = 32,
.reg_stride = 4,
.val_bits = 32,
.volatile_reg = fsl_dcu_drm_is_volatile_reg,
};
static void fsl_dcu_irq_reset(struct drm_device *dev)
{
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
regmap_write(fsl_dev->regmap, DCU_INT_STATUS, ~0);
regmap_write(fsl_dev->regmap, DCU_INT_MASK, ~0);
}
static irqreturn_t fsl_dcu_drm_irq(int irq, void *arg)
{
struct drm_device *dev = arg;
struct fsl_dcu_drm_device *fsl_dev = dev->dev_private;
unsigned int int_status;
int ret;
ret = regmap_read(fsl_dev->regmap, DCU_INT_STATUS, &int_status);
if (ret) {
dev_err(dev->dev, "read DCU_INT_STATUS failed\n");
return IRQ_NONE;
}
if (int_status & DCU_INT_STATUS_VBLANK)
drm_handle_vblank(dev, 0);
regmap_write(fsl_dev->regmap, DCU_INT_STATUS, int_status);
return IRQ_HANDLED;
}
static int fsl_dcu_irq_install(struct drm_device *dev, unsigned int irq)
{
if (irq == IRQ_NOTCONNECTED)
return -ENOTCONN;
fsl_dcu_irq_reset(dev);
return request_irq(irq, fsl_dcu_drm_irq, 0, dev->driver->name, dev);
Annotation
- Immediate include surface: `linux/clk.h`, `linux/clk-provider.h`, `linux/console.h`, `linux/io.h`, `linux/mfd/syscon.h`, `linux/mm.h`, `linux/module.h`, `linux/of_platform.h`.
- Detected declarations: `function fsl_dcu_drm_is_volatile_reg`, `function fsl_dcu_irq_reset`, `function fsl_dcu_drm_irq`, `function fsl_dcu_irq_install`, `function fsl_dcu_irq_uninstall`, `function fsl_dcu_load`, `function fsl_dcu_unload`, `function fsl_dcu_drm_pm_suspend`, `function fsl_dcu_drm_pm_resume`, `function fsl_dcu_drm_probe`.
- 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.