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.

Dependency Surface

Detected Declarations

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

Implementation Notes