drivers/gpu/drm/tidss/tidss_irq.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/tidss/tidss_irq.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/tidss/tidss_irq.c- Extension
.c- Size
- 3706 bytes
- Lines
- 139
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/platform_device.hdrm/drm_drv.hdrm/drm_print.htidss_crtc.htidss_dispc.htidss_drv.htidss_irq.htidss_plane.h
Detected Declarations
function Copyrightfunction tidss_irq_enable_vblankfunction tidss_irq_disable_vblankfunction tidss_irq_handlerfunction tidss_irq_resumefunction tidss_irq_installfunction tidss_irq_uninstall
Annotated Snippet
// SPDX-License-Identifier: GPL-2.0
/*
* Copyright (C) 2018 Texas Instruments Incorporated - https://www.ti.com/
* Author: Tomi Valkeinen <tomi.valkeinen@ti.com>
*/
#include <linux/platform_device.h>
#include <drm/drm_drv.h>
#include <drm/drm_print.h>
#include "tidss_crtc.h"
#include "tidss_dispc.h"
#include "tidss_drv.h"
#include "tidss_irq.h"
#include "tidss_plane.h"
static void tidss_irq_update(struct tidss_device *tidss)
{
assert_spin_locked(&tidss->irq_lock);
dispc_set_irqenable(tidss->dispc, tidss->irq_mask);
}
void tidss_irq_enable_vblank(struct drm_crtc *crtc)
{
struct drm_device *ddev = crtc->dev;
struct tidss_device *tidss = to_tidss(ddev);
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
u32 hw_videoport = tcrtc->hw_videoport;
unsigned long flags;
spin_lock_irqsave(&tidss->irq_lock, flags);
tidss->irq_mask |= DSS_IRQ_VP_VSYNC_EVEN(hw_videoport) |
DSS_IRQ_VP_VSYNC_ODD(hw_videoport);
tidss_irq_update(tidss);
spin_unlock_irqrestore(&tidss->irq_lock, flags);
}
void tidss_irq_disable_vblank(struct drm_crtc *crtc)
{
struct drm_device *ddev = crtc->dev;
struct tidss_device *tidss = to_tidss(ddev);
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
u32 hw_videoport = tcrtc->hw_videoport;
unsigned long flags;
spin_lock_irqsave(&tidss->irq_lock, flags);
tidss->irq_mask &= ~(DSS_IRQ_VP_VSYNC_EVEN(hw_videoport) |
DSS_IRQ_VP_VSYNC_ODD(hw_videoport));
tidss_irq_update(tidss);
spin_unlock_irqrestore(&tidss->irq_lock, flags);
}
static irqreturn_t tidss_irq_handler(int irq, void *arg)
{
struct drm_device *ddev = (struct drm_device *)arg;
struct tidss_device *tidss = to_tidss(ddev);
unsigned int id;
dispc_irq_t irqstatus;
spin_lock(&tidss->irq_lock);
irqstatus = dispc_read_and_clear_irqstatus(tidss->dispc);
spin_unlock(&tidss->irq_lock);
for (id = 0; id < tidss->num_crtcs; id++) {
struct drm_crtc *crtc = tidss->crtcs[id];
struct tidss_crtc *tcrtc = to_tidss_crtc(crtc);
u32 hw_videoport = tcrtc->hw_videoport;
if (irqstatus & (DSS_IRQ_VP_VSYNC_EVEN(hw_videoport) |
DSS_IRQ_VP_VSYNC_ODD(hw_videoport)))
tidss_crtc_vblank_irq(crtc);
if (irqstatus & (DSS_IRQ_VP_FRAME_DONE(hw_videoport)))
tidss_crtc_framedone_irq(crtc);
if (irqstatus & DSS_IRQ_VP_SYNC_LOST(hw_videoport))
tidss_crtc_error_irq(crtc, irqstatus);
}
for (unsigned int i = 0; i < tidss->num_planes; ++i) {
struct drm_plane *plane = tidss->planes[i];
struct tidss_plane *tplane = to_tidss_plane(plane);
if (irqstatus & DSS_IRQ_PLANE_FIFO_UNDERFLOW(tplane->hw_plane_id))
tidss_plane_error_irq(plane, irqstatus);
}
return IRQ_HANDLED;
Annotation
- Immediate include surface: `linux/platform_device.h`, `drm/drm_drv.h`, `drm/drm_print.h`, `tidss_crtc.h`, `tidss_dispc.h`, `tidss_drv.h`, `tidss_irq.h`, `tidss_plane.h`.
- Detected declarations: `function Copyright`, `function tidss_irq_enable_vblank`, `function tidss_irq_disable_vblank`, `function tidss_irq_handler`, `function tidss_irq_resume`, `function tidss_irq_install`, `function tidss_irq_uninstall`.
- 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.