drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/link/accessories/link_dp_trace.c- Extension
.c- Size
- 5010 bytes
- Lines
- 173
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
link_dp_trace.hlink/protocols/link_dpcd.h
Detected Declarations
function filesfunction dp_trace_resetfunction dp_trace_is_initializedfunction dp_trace_detect_lt_initfunction dp_trace_commit_lt_initfunction dp_trace_link_loss_incrementfunction dp_trace_lt_fail_count_updatefunction dp_trace_lt_total_count_incrementfunction dp_trace_set_is_logged_flagfunction dp_trace_is_loggedfunction dp_trace_lt_result_updatefunction dp_trace_set_lt_start_timestampfunction dp_trace_set_lt_end_timestampfunction dp_trace_get_lt_end_timestampfunction dp_trace_get_link_loss_countfunction dp_trace_set_edp_power_timestampfunction dp_trace_get_edp_poweron_timestampfunction dp_trace_get_edp_poweroff_timestampfunction dp_trace_source_sequence
Annotated Snippet
#include "link_dp_trace.h"
#include "link/protocols/link_dpcd.h"
void dp_trace_init(struct dc_link *link)
{
memset(&link->dp_trace, 0, sizeof(link->dp_trace));
link->dp_trace.is_initialized = true;
}
void dp_trace_reset(struct dc_link *link)
{
memset(&link->dp_trace, 0, sizeof(link->dp_trace));
}
bool dp_trace_is_initialized(struct dc_link *link)
{
return link->dp_trace.is_initialized;
}
void dp_trace_detect_lt_init(struct dc_link *link)
{
memset(&link->dp_trace.detect_lt_trace, 0, sizeof(link->dp_trace.detect_lt_trace));
}
void dp_trace_commit_lt_init(struct dc_link *link)
{
memset(&link->dp_trace.commit_lt_trace, 0, sizeof(link->dp_trace.commit_lt_trace));
}
void dp_trace_link_loss_increment(struct dc_link *link)
{
link->dp_trace.link_loss_count++;
}
void dp_trace_lt_fail_count_update(struct dc_link *link,
unsigned int fail_count,
bool in_detection)
{
if (in_detection)
link->dp_trace.detect_lt_trace.counts.fail = fail_count;
else
link->dp_trace.commit_lt_trace.counts.fail = fail_count;
}
void dp_trace_lt_total_count_increment(struct dc_link *link,
bool in_detection)
{
if (in_detection)
link->dp_trace.detect_lt_trace.counts.total++;
else
link->dp_trace.commit_lt_trace.counts.total++;
}
void dp_trace_set_is_logged_flag(struct dc_link *link,
bool in_detection,
bool is_logged)
{
if (in_detection)
link->dp_trace.detect_lt_trace.is_logged = is_logged;
else
link->dp_trace.commit_lt_trace.is_logged = is_logged;
}
bool dp_trace_is_logged(struct dc_link *link, bool in_detection)
{
if (in_detection)
return link->dp_trace.detect_lt_trace.is_logged;
else
return link->dp_trace.commit_lt_trace.is_logged;
}
void dp_trace_lt_result_update(struct dc_link *link,
enum link_training_result result,
bool in_detection)
{
if (in_detection)
link->dp_trace.detect_lt_trace.result = result;
else
link->dp_trace.commit_lt_trace.result = result;
}
void dp_trace_set_lt_start_timestamp(struct dc_link *link,
bool in_detection)
{
if (in_detection)
link->dp_trace.detect_lt_trace.timestamps.start = dm_get_timestamp(link->dc->ctx);
else
link->dp_trace.commit_lt_trace.timestamps.start = dm_get_timestamp(link->dc->ctx);
}
Annotation
- Immediate include surface: `link_dp_trace.h`, `link/protocols/link_dpcd.h`.
- Detected declarations: `function files`, `function dp_trace_reset`, `function dp_trace_is_initialized`, `function dp_trace_detect_lt_init`, `function dp_trace_commit_lt_init`, `function dp_trace_link_loss_increment`, `function dp_trace_lt_fail_count_update`, `function dp_trace_lt_total_count_increment`, `function dp_trace_set_is_logged_flag`, `function dp_trace_is_logged`.
- 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.