drivers/gpu/drm/omapdrm/omap_crtc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/omapdrm/omap_crtc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/omapdrm/omap_crtc.c- Extension
.c- Size
- 23018 bytes
- Lines
- 850
- 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.
- 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/math64.hdrm/drm_atomic.hdrm/drm_atomic_helper.hdrm/drm_crtc.hdrm/drm_mode.hdrm/drm_print.hdrm/drm_vblank.homap_drv.h
Detected Declarations
struct omap_crtc_statestruct omap_crtcfunction omap_crtc_channelfunction omap_crtc_is_pendingfunction omap_crtc_wait_pendingfunction omap_crtc_dss_start_updatefunction omap_crtc_set_enabledfunction omap_crtc_dss_enablefunction omap_crtc_dss_disablefunction omap_crtc_dss_set_timingsfunction omap_crtc_dss_set_lcd_configfunction omap_crtc_dss_register_framedonefunction omap_crtc_dss_unregister_framedonefunction omap_crtc_error_irqfunction omap_crtc_vblank_irqfunction omap_crtc_framedone_irqfunction omap_crtc_flushfunction omap_crtc_manual_display_updatefunction omap_crtc_s31_32_to_s2_8function omap_crtc_cpr_coefs_from_ctmfunction omap_crtc_write_crtc_propertiesfunction omap_crtc_destroyfunction omap_crtc_arm_eventfunction omap_crtc_atomic_enablefunction omap_crtc_atomic_disablefunction omap_crtc_mode_validfunction omap_crtc_mode_set_nofbfunction omap_crtc_is_manually_updatedfunction omap_crtc_atomic_checkfunction omap_crtc_atomic_beginfunction omap_crtc_atomic_set_propertyfunction omap_crtc_atomic_get_propertyfunction omap_crtc_resetfunction omap_crtc_duplicate_statefunction dispc_mgr_gamma_size
Annotated Snippet
struct omap_crtc_state {
/* Must be first. */
struct drm_crtc_state base;
/* Shadow values for legacy userspace support. */
unsigned int rotation;
unsigned int zpos;
bool manually_updated;
};
#define to_omap_crtc(x) container_of(x, struct omap_crtc, base)
struct omap_crtc {
struct drm_crtc base;
const char *name;
struct omap_drm_pipeline *pipe;
enum omap_channel channel;
struct videomode vm;
bool ignore_digit_sync_lost;
bool enabled;
bool pending;
wait_queue_head_t pending_wait;
struct drm_pending_vblank_event *event;
struct delayed_work update_work;
void (*framedone_handler)(void *);
void *framedone_handler_data;
};
/* -----------------------------------------------------------------------------
* Helper Functions
*/
struct videomode *omap_crtc_timings(struct drm_crtc *crtc)
{
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
return &omap_crtc->vm;
}
enum omap_channel omap_crtc_channel(struct drm_crtc *crtc)
{
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
return omap_crtc->channel;
}
static bool omap_crtc_is_pending(struct drm_crtc *crtc)
{
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
unsigned long flags;
bool pending;
spin_lock_irqsave(&crtc->dev->event_lock, flags);
pending = omap_crtc->pending;
spin_unlock_irqrestore(&crtc->dev->event_lock, flags);
return pending;
}
int omap_crtc_wait_pending(struct drm_crtc *crtc)
{
struct omap_crtc *omap_crtc = to_omap_crtc(crtc);
/*
* Timeout is set to a "sufficiently" high value, which should cover
* a single frame refresh even on slower displays.
*/
return wait_event_timeout(omap_crtc->pending_wait,
!omap_crtc_is_pending(crtc),
msecs_to_jiffies(250));
}
/* -----------------------------------------------------------------------------
* DSS Manager Functions
*/
/*
* Manager-ops, callbacks from output when they need to configure
* the upstream part of the video pipe.
*/
void omap_crtc_dss_start_update(struct omap_drm_private *priv,
enum omap_channel channel)
{
dispc_mgr_enable(priv->dispc, channel, true);
}
/* Called only from the encoder enable/disable and suspend/resume handlers. */
Annotation
- Immediate include surface: `linux/math64.h`, `drm/drm_atomic.h`, `drm/drm_atomic_helper.h`, `drm/drm_crtc.h`, `drm/drm_mode.h`, `drm/drm_print.h`, `drm/drm_vblank.h`, `omap_drv.h`.
- Detected declarations: `struct omap_crtc_state`, `struct omap_crtc`, `function omap_crtc_channel`, `function omap_crtc_is_pending`, `function omap_crtc_wait_pending`, `function omap_crtc_dss_start_update`, `function omap_crtc_set_enabled`, `function omap_crtc_dss_enable`, `function omap_crtc_dss_disable`, `function omap_crtc_dss_set_timings`.
- 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.
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.