drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c- Extension
.c- Size
- 269287 bytes
- Lines
- 6493
- 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_vba_util_32.h../dml_inline_defs.h../dml1_frl_cap_chk.hdisplay_mode_vba_32.h../display_mode_lib.h
Detected Declarations
function filesfunction dml32_dscComputeDelayfunction IsVerticalfunction dml32_CalculateSinglePipeDPPCLKAndSCLThroughputfunction dml32_CalculateBytePerPixelAndBlockSizesfunction dml32_CalculateSwathAndDETConfigurationfunction dml32_UnboundedRequestfunction dml32_CalculateDETBufferSizefunction dml32_CalculateODMModefunction dml32_CalculateRequiredDispclkfunction dml32_RoundToDFSGranularityfunction dml32_CalculateOutputLinkfunction dml32_CalculateDPPCLKfunction dml32_TruncToValidBPPfunction dml32_RequiredDTBCLKfunction dml32_DSCDelayRequirementfunction dml32_CalculateSurfaceSizeInMallfunction dml32_CalculateVMRowAndSwathfunction dml32_CalculateVMAndRowBytesfunction dml32_CalculatePrefetchSourceLinesfunction dml32_CalculateMALLUseForStaticScreenfunction dml32_CalculateRowBandwidthfunction dml32_CalculateUrgentLatencyfunction dml32_CalculateUrgentBurstFactorfunction dml32_CalculateDCFCLKDeepSleepfunction dml32_CalculateWriteBackDelayfunction dml32_UseMinimumDCFCLKfunction dml32_CalculateExtraLatencyBytesfunction dml32_CalculateVUpdateAndDynamicMetadataParametersfunction dml32_CalculateTWaitfunction dml32_get_return_bw_mbpsfunction dml32_get_return_bw_mbps_vm_onlyfunction dml32_CalculateExtraLatencyfunction dml32_CalculatePrefetchSchedulefunction dml32_CalculateFlipSchedulefunction dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupportfunction dml32_CalculateWriteBackDISPCLKfunction dml32_CalculateMinAndMaxPrefetchModefunction dml32_CalculatePixelDeliveryTimesfunction dml32_CalculateMetaAndPTETimesfunction dml32_CalculateVMGroupAndRequestTimesfunction dml32_CalculateDCCConfigurationfunction dml32_CalculateStutterEfficiencyfunction dml32_CalculateMaxDETAndMinCompressedBufferSizefunction dml32_CalculateVActiveBandwithSupportfunction dml32_CalculatePrefetchBandwithSupportfunction dml32_CalculateBandwidthAvailableForImmediateFlipfunction dml32_CalculateImmediateFlipBandwithSupport
Annotated Snippet
if (HRatioChroma > 1) {
*PSCL_THROUGHPUT_CHROMA = dml_min(MaxDCHUBToPSCLThroughput, MaxPSCLToLBThroughput *
HRatioChroma / dml_ceil((double) HTapsChroma / 6.0, 1.0));
} else {
*PSCL_THROUGHPUT_CHROMA = dml_min(MaxDCHUBToPSCLThroughput, MaxPSCLToLBThroughput);
}
DPPCLKUsingSingleDPPChroma = PixelClock * dml_max3(VTapsChroma / 6 * dml_min(1, HRatioChroma),
HRatioChroma * VRatioChroma / *PSCL_THROUGHPUT_CHROMA, 1);
if ((HTapsChroma > 6 || VTapsChroma > 6) && DPPCLKUsingSingleDPPChroma < 2 * PixelClock)
DPPCLKUsingSingleDPPChroma = 2 * PixelClock;
*DPPCLKUsingSingleDPP = dml_max(DPPCLKUsingSingleDPPLuma, DPPCLKUsingSingleDPPChroma);
}
}
void dml32_CalculateBytePerPixelAndBlockSizes(
enum source_format_class SourcePixelFormat,
enum dm_swizzle_mode SurfaceTiling,
/* Output */
unsigned int *BytePerPixelY,
unsigned int *BytePerPixelC,
double *BytePerPixelDETY,
double *BytePerPixelDETC,
unsigned int *BlockHeight256BytesY,
unsigned int *BlockHeight256BytesC,
unsigned int *BlockWidth256BytesY,
unsigned int *BlockWidth256BytesC,
unsigned int *MacroTileHeightY,
unsigned int *MacroTileHeightC,
unsigned int *MacroTileWidthY,
unsigned int *MacroTileWidthC)
{
if (SourcePixelFormat == dm_444_64) {
*BytePerPixelDETY = 8;
*BytePerPixelDETC = 0;
*BytePerPixelY = 8;
*BytePerPixelC = 0;
} else if (SourcePixelFormat == dm_444_32 || SourcePixelFormat == dm_rgbe) {
*BytePerPixelDETY = 4;
*BytePerPixelDETC = 0;
*BytePerPixelY = 4;
*BytePerPixelC = 0;
} else if (SourcePixelFormat == dm_444_16) {
*BytePerPixelDETY = 2;
*BytePerPixelDETC = 0;
*BytePerPixelY = 2;
*BytePerPixelC = 0;
} else if (SourcePixelFormat == dm_444_8) {
*BytePerPixelDETY = 1;
*BytePerPixelDETC = 0;
*BytePerPixelY = 1;
*BytePerPixelC = 0;
} else if (SourcePixelFormat == dm_rgbe_alpha) {
*BytePerPixelDETY = 4;
*BytePerPixelDETC = 1;
*BytePerPixelY = 4;
*BytePerPixelC = 1;
} else if (SourcePixelFormat == dm_420_8) {
*BytePerPixelDETY = 1;
*BytePerPixelDETC = 2;
*BytePerPixelY = 1;
*BytePerPixelC = 2;
} else if (SourcePixelFormat == dm_420_12) {
*BytePerPixelDETY = 2;
*BytePerPixelDETC = 4;
*BytePerPixelY = 2;
*BytePerPixelC = 4;
} else {
*BytePerPixelDETY = 4.0 / 3;
*BytePerPixelDETC = 8.0 / 3;
*BytePerPixelY = 2;
*BytePerPixelC = 4;
}
#ifdef __DML_VBA_DEBUG__
dml_print("DML::%s: SourcePixelFormat = %d\n", __func__, SourcePixelFormat);
dml_print("DML::%s: BytePerPixelDETY = %f\n", __func__, *BytePerPixelDETY);
dml_print("DML::%s: BytePerPixelDETC = %f\n", __func__, *BytePerPixelDETC);
dml_print("DML::%s: BytePerPixelY = %d\n", __func__, *BytePerPixelY);
dml_print("DML::%s: BytePerPixelC = %d\n", __func__, *BytePerPixelC);
#endif
if ((SourcePixelFormat == dm_444_64 || SourcePixelFormat == dm_444_32
|| SourcePixelFormat == dm_444_16
|| SourcePixelFormat == dm_444_8
|| SourcePixelFormat == dm_mono_16
|| SourcePixelFormat == dm_mono_8
|| SourcePixelFormat == dm_rgbe)) {
if (SurfaceTiling == dm_sw_linear)
*BlockHeight256BytesY = 1;
else if (SourcePixelFormat == dm_444_64)
*BlockHeight256BytesY = 4;
Annotation
- Immediate include surface: `display_mode_vba_util_32.h`, `../dml_inline_defs.h`, `../dml1_frl_cap_chk.h`, `display_mode_vba_32.h`, `../display_mode_lib.h`.
- Detected declarations: `function files`, `function dml32_dscComputeDelay`, `function IsVertical`, `function dml32_CalculateSinglePipeDPPCLKAndSCLThroughput`, `function dml32_CalculateBytePerPixelAndBlockSizes`, `function dml32_CalculateSwathAndDETConfiguration`, `function dml32_UnboundedRequest`, `function dml32_CalculateDETBufferSize`, `function dml32_CalculateODMMode`, `function dml32_CalculateRequiredDispclk`.
- 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.