drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c- Extension
.c- Size
- 56970 bytes
- Lines
- 1147
- 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
display_mode_lib.hdisplay_mode_vba.hdml_inline_defs.h
Detected Declarations
function dml_get_voltage_levelfunction get_total_immediate_flip_bytesfunction get_total_immediate_flip_bwfunction get_total_prefetch_bwfunction get_total_surface_size_in_mall_bytesfunction get_pipe_idxfunction get_det_buffer_size_kbytesfunction get_is_phantom_pipefunction fetch_socbb_paramsfunction fetch_ip_paramsfunction fetch_pipe_paramsfunction infunction recalculate_paramsfunction Calculate256BBlockSizesfunction CalculateMinAndMaxPrefetchModefunction PixelClockAdjustmentForProgressiveToInterlaceUnitfunction CursorBppEnumToBitsfunction ModeSupportAndSystemConfigurationfunction CalculateWriteBackDISPCLK
Annotated Snippet
if (plane_idx == mode_lib->vba.pipe_plane[i]) {
pipe_idx = i;
break;
}
}
ASSERT(pipe_idx >= 0);
return pipe_idx;
}
double get_det_buffer_size_kbytes(struct display_mode_lib *mode_lib, const display_e2e_pipe_params_st *pipes,
unsigned int num_pipes, unsigned int pipe_idx)
{
unsigned int plane_idx;
double det_buf_size_kbytes;
recalculate_params(mode_lib, pipes, num_pipes);
plane_idx = mode_lib->vba.pipe_plane[pipe_idx];
dml_print("DML::%s: num_pipes=%d pipe_idx=%d plane_idx=%0d\n", __func__, num_pipes, pipe_idx, plane_idx);
det_buf_size_kbytes = mode_lib->vba.DETBufferSizeInKByte[plane_idx]; // per hubp DET buffer size
dml_print("DML::%s: det_buf_size_kbytes=%3.2f\n", __func__, det_buf_size_kbytes);
return det_buf_size_kbytes;
}
bool get_is_phantom_pipe(struct display_mode_lib *mode_lib, const display_e2e_pipe_params_st *pipes,
unsigned int num_pipes, unsigned int pipe_idx)
{
unsigned int plane_idx;
recalculate_params(mode_lib, pipes, num_pipes);
plane_idx = mode_lib->vba.pipe_plane[pipe_idx];
dml_print("DML::%s: num_pipes=%d pipe_idx=%d UseMALLForPStateChange=%0d\n", __func__, num_pipes, pipe_idx,
mode_lib->vba.UsesMALLForPStateChange[plane_idx]);
return (mode_lib->vba.UsesMALLForPStateChange[plane_idx] == dm_use_mall_pstate_change_phantom_pipe);
}
static void fetch_socbb_params(struct display_mode_lib *mode_lib)
{
soc_bounding_box_st *soc = &mode_lib->vba.soc;
unsigned int i;
// SOC Bounding Box Parameters
mode_lib->vba.ReturnBusWidth = soc->return_bus_width_bytes;
mode_lib->vba.NumberOfChannels = soc->num_chans;
mode_lib->vba.PercentOfIdealDRAMFabricAndSDPPortBWReceivedAfterUrgLatencyPixelDataOnly =
soc->pct_ideal_dram_sdp_bw_after_urgent_pixel_only; // there's always that one bastard variable that's so long it throws everything out of alignment!
mode_lib->vba.PercentOfIdealDRAMFabricAndSDPPortBWReceivedAfterUrgLatencyPixelMixedWithVMData =
soc->pct_ideal_dram_sdp_bw_after_urgent_pixel_and_vm;
mode_lib->vba.PercentOfIdealDRAMFabricAndSDPPortBWReceivedAfterUrgLatencyVMDataOnly =
soc->pct_ideal_dram_sdp_bw_after_urgent_vm_only;
mode_lib->vba.MaxAveragePercentOfIdealSDPPortBWDisplayCanUseInNormalSystemOperation =
soc->max_avg_sdp_bw_use_normal_percent;
mode_lib->vba.MaxAveragePercentOfIdealDRAMBWDisplayCanUseInNormalSystemOperation =
soc->max_avg_dram_bw_use_normal_percent;
mode_lib->vba.UrgentLatencyPixelDataOnly = soc->urgent_latency_pixel_data_only_us;
mode_lib->vba.UrgentLatencyPixelMixedWithVMData = soc->urgent_latency_pixel_mixed_with_vm_data_us;
mode_lib->vba.UrgentLatencyVMDataOnly = soc->urgent_latency_vm_data_only_us;
mode_lib->vba.RoundTripPingLatencyCycles = soc->round_trip_ping_latency_dcfclk_cycles;
mode_lib->vba.UrgentOutOfOrderReturnPerChannelPixelDataOnly =
soc->urgent_out_of_order_return_per_channel_pixel_only_bytes;
mode_lib->vba.UrgentOutOfOrderReturnPerChannelPixelMixedWithVMData =
soc->urgent_out_of_order_return_per_channel_pixel_and_vm_bytes;
mode_lib->vba.UrgentOutOfOrderReturnPerChannelVMDataOnly =
soc->urgent_out_of_order_return_per_channel_vm_only_bytes;
mode_lib->vba.WritebackLatency = soc->writeback_latency_us;
mode_lib->vba.SRExitTime = soc->sr_exit_time_us;
mode_lib->vba.SREnterPlusExitTime = soc->sr_enter_plus_exit_time_us;
mode_lib->vba.PercentOfIdealFabricAndSDPPortBWReceivedAfterUrgLatency = soc->pct_ideal_sdp_bw_after_urgent;
mode_lib->vba.PercentOfIdealDRAMBWReceivedAfterUrgLatencyPixelMixedWithVMData = soc->pct_ideal_dram_sdp_bw_after_urgent_pixel_and_vm;
mode_lib->vba.PercentOfIdealDRAMBWReceivedAfterUrgLatencyPixelDataOnly = soc->pct_ideal_dram_sdp_bw_after_urgent_pixel_only;
mode_lib->vba.PercentOfIdealDRAMBWReceivedAfterUrgLatencyVMDataOnly = soc->pct_ideal_dram_sdp_bw_after_urgent_vm_only;
mode_lib->vba.MaxAveragePercentOfIdealFabricAndSDPPortBWDisplayCanUseInNormalSystemOperation =
soc->max_avg_sdp_bw_use_normal_percent;
mode_lib->vba.SRExitZ8Time = soc->sr_exit_z8_time_us;
mode_lib->vba.SREnterPlusExitZ8Time = soc->sr_enter_plus_exit_z8_time_us;
mode_lib->vba.FCLKChangeLatency = soc->fclk_change_latency_us;
mode_lib->vba.USRRetrainingLatency = soc->usr_retraining_latency_us;
mode_lib->vba.SMNLatency = soc->smn_latency_us;
mode_lib->vba.MALLAllocatedForDCNFinal = (unsigned int)soc->mall_allocated_for_dcn_mbytes;
mode_lib->vba.PercentOfIdealDRAMBWReceivedAfterUrgLatencySTROBE = soc->pct_ideal_dram_bw_after_urgent_strobe;
mode_lib->vba.MaxAveragePercentOfIdealFabricBWDisplayCanUseInNormalSystemOperation =
soc->max_avg_fabric_bw_use_normal_percent;
mode_lib->vba.MaxAveragePercentOfIdealDRAMBWDisplayCanUseInNormalSystemOperationSTROBE =
soc->max_avg_dram_bw_use_normal_strobe_percent;
Annotation
- Immediate include surface: `display_mode_lib.h`, `display_mode_vba.h`, `dml_inline_defs.h`.
- Detected declarations: `function dml_get_voltage_level`, `function get_total_immediate_flip_bytes`, `function get_total_immediate_flip_bw`, `function get_total_prefetch_bw`, `function get_total_surface_size_in_mall_bytes`, `function get_pipe_idx`, `function get_det_buffer_size_kbytes`, `function get_is_phantom_pipe`, `function fetch_socbb_params`, `function fetch_ip_params`.
- 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.