drivers/gpu/drm/i915/display/intel_encoder.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_encoder.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_encoder.c- Extension
.c- Size
- 2956 bytes
- Lines
- 124
- 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.
- 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/workqueue.hintel_display_core.hintel_display_types.hintel_encoder.hintel_hotplug.h
Detected Declarations
function intel_encoder_link_check_work_fnfunction intel_encoder_link_check_initfunction intel_encoder_link_check_flush_workfunction intel_encoder_link_check_queue_workfunction intel_encoder_unblock_all_hpdsfunction intel_encoder_block_all_hpdsfunction intel_encoder_suspend_allfunction intel_encoder_shutdown_all
Annotated Snippet
// SPDX-License-Identifier: MIT
/*
* Copyright © 2024 Intel Corporation
*/
#include <linux/workqueue.h>
#include "intel_display_core.h"
#include "intel_display_types.h"
#include "intel_encoder.h"
#include "intel_hotplug.h"
static void intel_encoder_link_check_work_fn(struct work_struct *work)
{
struct intel_encoder *encoder =
container_of(work, typeof(*encoder), link_check_work.work);
encoder->link_check(encoder);
}
void intel_encoder_link_check_init(struct intel_encoder *encoder,
void (*callback)(struct intel_encoder *encoder))
{
INIT_DELAYED_WORK(&encoder->link_check_work, intel_encoder_link_check_work_fn);
encoder->link_check = callback;
}
void intel_encoder_link_check_flush_work(struct intel_encoder *encoder)
{
cancel_delayed_work_sync(&encoder->link_check_work);
}
void intel_encoder_link_check_queue_work(struct intel_encoder *encoder, int delay_ms)
{
struct intel_display *display = to_intel_display(encoder);
mod_delayed_work(display->wq.unordered,
&encoder->link_check_work, msecs_to_jiffies(delay_ms));
}
void intel_encoder_unblock_all_hpds(struct intel_display *display)
{
struct intel_encoder *encoder;
if (!HAS_DISPLAY(display))
return;
for_each_intel_encoder(display->drm, encoder)
intel_hpd_unblock(encoder);
}
void intel_encoder_block_all_hpds(struct intel_display *display)
{
struct intel_encoder *encoder;
if (!HAS_DISPLAY(display))
return;
for_each_intel_encoder(display->drm, encoder)
intel_hpd_block(encoder);
}
void intel_encoder_suspend_all(struct intel_display *display)
{
struct intel_encoder *encoder;
if (!HAS_DISPLAY(display))
return;
/*
* TODO: check and remove holding the modeset locks if none of
* the encoders depends on this.
*/
drm_modeset_lock_all(display->drm);
for_each_intel_encoder(display->drm, encoder)
if (encoder->suspend)
encoder->suspend(encoder);
drm_modeset_unlock_all(display->drm);
for_each_intel_encoder(display->drm, encoder)
if (encoder->suspend_complete)
encoder->suspend_complete(encoder);
}
void intel_encoder_shutdown_all(struct intel_display *display)
{
struct intel_encoder *encoder;
if (!HAS_DISPLAY(display))
return;
Annotation
- Immediate include surface: `linux/workqueue.h`, `intel_display_core.h`, `intel_display_types.h`, `intel_encoder.h`, `intel_hotplug.h`.
- Detected declarations: `function intel_encoder_link_check_work_fn`, `function intel_encoder_link_check_init`, `function intel_encoder_link_check_flush_work`, `function intel_encoder_link_check_queue_work`, `function intel_encoder_unblock_all_hpds`, `function intel_encoder_block_all_hpds`, `function intel_encoder_suspend_all`, `function intel_encoder_shutdown_all`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
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.