drivers/gpu/drm/i915/display/intel_tc.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/display/intel_tc.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/display/intel_tc.c- Extension
.c- Size
- 54788 bytes
- Lines
- 2025
- 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/iopoll.hdrm/drm_print.hintel_atomic.hintel_cx0_phy_regs.hintel_ddi.hintel_de.hintel_display.hintel_display_driver.hintel_display_power_map.hintel_display_regs.hintel_display_types.hintel_display_utils.hintel_dkl_phy_regs.hintel_dp.hintel_dp_mst.hintel_mg_phy_regs.hintel_modeset_lock.hintel_tc.h
Detected Declarations
struct intel_tc_portstruct intel_tc_phy_opsstruct intel_tc_portenum tc_port_modefunction intel_tc_port_in_modefunction intel_tc_port_in_tbt_alt_modefunction intel_tc_port_in_dp_alt_modefunction intel_tc_port_in_legacy_modefunction intel_tc_port_handles_hpd_glitchesfunction modefunction __tc_cold_blockfunction tc_cold_blockfunction __tc_cold_unblockfunction tc_cold_unblockfunction assert_display_core_power_enabledfunction assert_tc_cold_blockedfunction tc_port_power_domainfunction assert_tc_port_power_enabledfunction get_lane_maskfunction pin_assignment_namefunction get_pin_assignmentfunction mtl_get_max_lane_countfunction icl_get_max_lane_countfunction get_max_lane_countfunction read_pin_configurationfunction intel_tc_port_max_lane_countfunction intel_tc_port_get_pin_assignmentfunction intel_tc_port_set_fia_lane_countfunction tc_port_fixup_legacy_flagfunction tc_phy_load_fia_paramsfunction icl_tc_phy_cold_off_domainfunction icl_tc_phy_hpd_live_statusfunction with_intel_display_powerfunction icl_tc_phy_is_readyfunction icl_tc_phy_take_ownershipfunction icl_tc_phy_is_ownedfunction icl_tc_phy_get_hw_statefunction tc_phy_verify_legacy_or_dp_alt_modefunction icl_tc_phy_connectfunction icl_tc_phy_disconnectfunction icl_tc_phy_initfunction tgl_tc_phy_cold_off_domainfunction tgl_tc_phy_initfunction adlp_tc_phy_cold_off_domainfunction adlp_tc_phy_hpd_live_statusfunction with_intel_display_powerfunction adlp_tc_phy_is_readyfunction adlp_tc_phy_take_ownership
Annotated Snippet
struct intel_tc_phy_ops {
enum intel_display_power_domain (*cold_off_domain)(struct intel_tc_port *tc);
u32 (*hpd_live_status)(struct intel_tc_port *tc);
bool (*is_ready)(struct intel_tc_port *tc);
bool (*is_owned)(struct intel_tc_port *tc);
void (*get_hw_state)(struct intel_tc_port *tc);
bool (*connect)(struct intel_tc_port *tc, int required_lanes);
void (*disconnect)(struct intel_tc_port *tc);
void (*init)(struct intel_tc_port *tc);
};
struct intel_tc_port {
struct intel_digital_port *dig_port;
const struct intel_tc_phy_ops *phy_ops;
struct mutex lock; /* protects the TypeC port mode */
struct ref_tracker *lock_wakeref;
#if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM)
enum intel_display_power_domain lock_power_domain;
#endif
struct delayed_work disconnect_phy_work;
struct delayed_work link_reset_work;
int link_refcount;
bool legacy_port:1;
const char *port_name;
enum tc_port_mode mode;
enum tc_port_mode init_mode;
enum phy_fia phy_fia;
enum intel_tc_pin_assignment pin_assignment;
u8 phy_fia_idx;
u8 max_lane_count;
};
static enum intel_display_power_domain
tc_phy_cold_off_domain(struct intel_tc_port *);
static u32 tc_phy_hpd_live_status(struct intel_tc_port *tc);
static bool tc_phy_is_ready(struct intel_tc_port *tc);
static bool tc_phy_wait_for_ready(struct intel_tc_port *tc);
static enum tc_port_mode tc_phy_get_current_mode(struct intel_tc_port *tc);
static const char *tc_port_mode_name(enum tc_port_mode mode)
{
static const char * const names[] = {
[TC_PORT_DISCONNECTED] = "disconnected",
[TC_PORT_TBT_ALT] = "tbt-alt",
[TC_PORT_DP_ALT] = "dp-alt",
[TC_PORT_LEGACY] = "legacy",
};
if (WARN_ON(mode >= ARRAY_SIZE(names)))
mode = TC_PORT_DISCONNECTED;
return names[mode];
}
static struct intel_tc_port *to_tc_port(struct intel_digital_port *dig_port)
{
return dig_port->tc;
}
static bool intel_tc_port_in_mode(struct intel_digital_port *dig_port,
enum tc_port_mode mode)
{
struct intel_tc_port *tc = to_tc_port(dig_port);
return intel_encoder_is_tc(&dig_port->base) && tc->mode == mode;
}
bool intel_tc_port_in_tbt_alt_mode(struct intel_digital_port *dig_port)
{
return intel_tc_port_in_mode(dig_port, TC_PORT_TBT_ALT);
}
bool intel_tc_port_in_dp_alt_mode(struct intel_digital_port *dig_port)
{
return intel_tc_port_in_mode(dig_port, TC_PORT_DP_ALT);
}
bool intel_tc_port_in_legacy_mode(struct intel_digital_port *dig_port)
{
return intel_tc_port_in_mode(dig_port, TC_PORT_LEGACY);
}
bool intel_tc_port_handles_hpd_glitches(struct intel_digital_port *dig_port)
{
struct intel_tc_port *tc = to_tc_port(dig_port);
return intel_encoder_is_tc(&dig_port->base) && !tc->legacy_port;
}
Annotation
- Immediate include surface: `linux/iopoll.h`, `drm/drm_print.h`, `intel_atomic.h`, `intel_cx0_phy_regs.h`, `intel_ddi.h`, `intel_de.h`, `intel_display.h`, `intel_display_driver.h`.
- Detected declarations: `struct intel_tc_port`, `struct intel_tc_phy_ops`, `struct intel_tc_port`, `enum tc_port_mode`, `function intel_tc_port_in_mode`, `function intel_tc_port_in_tbt_alt_mode`, `function intel_tc_port_in_dp_alt_mode`, `function intel_tc_port_in_legacy_mode`, `function intel_tc_port_handles_hpd_glitches`, `function mode`.
- 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.