2 * Copyright 2022 Advanced Micro Devices, Inc.
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20 * OTHER DEALINGS IN THE SOFTWARE.
26 #ifndef __DML_DCN32_DISPLAY_MODE_VBA_UTIL_32_H__
27 #define __DML_DCN32_DISPLAY_MODE_VBA_UTIL_32_H__
29 #include "../display_mode_enums.h"
31 #include "../dc_features.h"
32 #include "../display_mode_structs.h"
34 unsigned int dml32_dscceComputeDelay(
37 unsigned int sliceWidth,
38 unsigned int numSlices,
39 enum output_format_class pixelFormat,
40 enum output_encoder_class Output);
42 unsigned int dml32_dscComputeDelay(enum output_format_class pixelFormat, enum output_encoder_class Output);
44 bool IsVertical(enum dm_rotation_angle Scan);
46 void dml32_CalculateBytePerPixelAndBlockSizes(
47 enum source_format_class SourcePixelFormat,
48 enum dm_swizzle_mode SurfaceTiling,
51 unsigned int *BytePerPixelY,
52 unsigned int *BytePerPixelC,
53 double *BytePerPixelDETY,
54 double *BytePerPixelDETC,
55 unsigned int *BlockHeight256BytesY,
56 unsigned int *BlockHeight256BytesC,
57 unsigned int *BlockWidth256BytesY,
58 unsigned int *BlockWidth256BytesC,
59 unsigned int *MacroTileHeightY,
60 unsigned int *MacroTileHeightC,
61 unsigned int *MacroTileWidthY,
62 unsigned int *MacroTileWidthC);
64 void dml32_CalculateSinglePipeDPPCLKAndSCLThroughput(
69 double MaxDCHUBToPSCLThroughput,
70 double MaxPSCLToLBThroughput,
72 enum source_format_class SourcePixelFormat,
74 unsigned int HTapsChroma,
76 unsigned int VTapsChroma,
79 double *PSCL_THROUGHPUT,
80 double *PSCL_THROUGHPUT_CHROMA,
81 double *DPPCLKUsingSingleDPP);
83 void dml32_CalculateSwathAndDETConfiguration(
84 unsigned int DETSizeOverride[],
85 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
86 unsigned int ConfigReturnBufferSizeInKByte,
87 unsigned int MaxTotalDETInKByte,
88 unsigned int MinCompressedBufferSizeInKByte,
89 double ForceSingleDPP,
90 unsigned int NumberOfActiveSurfaces,
91 unsigned int nomDETInKByte,
92 enum unbounded_requesting_policy UseUnboundedRequestingFinal,
93 bool DisableUnboundRequestIfCompBufReservedSpaceNeedAdjustment,
94 unsigned int PixelChunkSizeKBytes,
95 unsigned int ROBSizeKBytes,
96 unsigned int CompressedBufferSegmentSizeInkByteFinal,
97 enum output_encoder_class Output[],
98 double ReadBandwidthLuma[],
99 double ReadBandwidthChroma[],
100 double MaximumSwathWidthLuma[],
101 double MaximumSwathWidthChroma[],
102 enum dm_rotation_angle SourceRotation[],
103 bool ViewportStationary[],
104 enum source_format_class SourcePixelFormat[],
105 enum dm_swizzle_mode SurfaceTiling[],
106 unsigned int ViewportWidth[],
107 unsigned int ViewportHeight[],
108 unsigned int ViewportXStart[],
109 unsigned int ViewportYStart[],
110 unsigned int ViewportXStartC[],
111 unsigned int ViewportYStartC[],
112 unsigned int SurfaceWidthY[],
113 unsigned int SurfaceWidthC[],
114 unsigned int SurfaceHeightY[],
115 unsigned int SurfaceHeightC[],
116 unsigned int Read256BytesBlockHeightY[],
117 unsigned int Read256BytesBlockHeightC[],
118 unsigned int Read256BytesBlockWidthY[],
119 unsigned int Read256BytesBlockWidthC[],
120 enum odm_combine_mode ODMMode[],
121 unsigned int BlendingAndTiming[],
122 unsigned int BytePerPixY[],
123 unsigned int BytePerPixC[],
124 double BytePerPixDETY[],
125 double BytePerPixDETC[],
126 unsigned int HActive[],
128 double HRatioChroma[],
129 unsigned int DPPPerSurface[],
132 unsigned int swath_width_luma_ub[],
133 unsigned int swath_width_chroma_ub[],
135 double SwathWidthChroma[],
136 unsigned int SwathHeightY[],
137 unsigned int SwathHeightC[],
138 unsigned int DETBufferSizeInKByte[],
139 unsigned int DETBufferSizeY[],
140 unsigned int DETBufferSizeC[],
141 bool *UnboundedRequestEnabled,
142 unsigned int *CompressedBufferSizeInkByte,
143 unsigned int *CompBufReservedSpaceKBytes,
144 bool *CompBufReservedSpaceNeedAdjustment,
145 bool ViewportSizeSupportPerSurface[],
146 bool *ViewportSizeSupport);
148 void dml32_CalculateSwathWidth(
150 unsigned int NumberOfActiveSurfaces,
151 enum source_format_class SourcePixelFormat[],
152 enum dm_rotation_angle SourceScan[],
153 bool ViewportStationary[],
154 unsigned int ViewportWidth[],
155 unsigned int ViewportHeight[],
156 unsigned int ViewportXStart[],
157 unsigned int ViewportYStart[],
158 unsigned int ViewportXStartC[],
159 unsigned int ViewportYStartC[],
160 unsigned int SurfaceWidthY[],
161 unsigned int SurfaceWidthC[],
162 unsigned int SurfaceHeightY[],
163 unsigned int SurfaceHeightC[],
164 enum odm_combine_mode ODMMode[],
165 unsigned int BytePerPixY[],
166 unsigned int BytePerPixC[],
167 unsigned int Read256BytesBlockHeightY[],
168 unsigned int Read256BytesBlockHeightC[],
169 unsigned int Read256BytesBlockWidthY[],
170 unsigned int Read256BytesBlockWidthC[],
171 unsigned int BlendingAndTiming[],
172 unsigned int HActive[],
174 unsigned int DPPPerSurface[],
177 double SwathWidthdoubleDPPY[],
178 double SwathWidthdoubleDPPC[],
179 double SwathWidthY[], // per-pipe
180 double SwathWidthC[], // per-pipe
181 unsigned int MaximumSwathHeightY[],
182 unsigned int MaximumSwathHeightC[],
183 unsigned int swath_width_luma_ub[], // per-pipe
184 unsigned int swath_width_chroma_ub[]);
186 bool dml32_UnboundedRequest(enum unbounded_requesting_policy UseUnboundedRequestingFinal,
187 unsigned int TotalNumberOfActiveDPP,
189 enum output_encoder_class Output,
190 enum dm_swizzle_mode SurfaceTiling,
191 bool CompBufReservedSpaceNeedAdjustment,
192 bool DisableUnboundRequestIfCompBufReservedSpaceNeedAdjustment);
194 void dml32_CalculateDETBufferSize(
195 unsigned int DETSizeOverride[],
196 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
198 unsigned int NumberOfActiveSurfaces,
199 bool UnboundedRequestEnabled,
200 unsigned int nomDETInKByte,
201 unsigned int MaxTotalDETInKByte,
202 unsigned int ConfigReturnBufferSizeInKByte,
203 unsigned int MinCompressedBufferSizeInKByte,
204 unsigned int CompressedBufferSegmentSizeInkByteFinal,
205 enum source_format_class SourcePixelFormat[],
206 double ReadBandwidthLuma[],
207 double ReadBandwidthChroma[],
208 unsigned int RoundedUpMaxSwathSizeBytesY[],
209 unsigned int RoundedUpMaxSwathSizeBytesC[],
210 unsigned int DPPPerSurface[],
212 unsigned int DETBufferSizeInKByte[],
213 unsigned int *CompressedBufferSizeInkByte);
215 void dml32_CalculateODMMode(
216 unsigned int MaximumPixelsPerLinePerDSCUnit,
217 unsigned int HActive,
218 enum output_encoder_class Output,
219 enum odm_combine_policy ODMUse,
223 unsigned int TotalNumberOfActiveDPP,
224 unsigned int MaxNumDPP,
226 double DISPCLKDPPCLKDSCCLKDownSpreading,
227 double DISPCLKRampingMargin,
228 double DISPCLKDPPCLKVCOSpeed,
231 bool *TotalAvailablePipesSupport,
232 unsigned int *NumberOfDPP,
233 enum odm_combine_mode *ODMMode,
234 double *RequiredDISPCLKPerSurface);
236 double dml32_CalculateRequiredDispclk(
237 enum odm_combine_mode ODMMode,
239 double DISPCLKDPPCLKDSCCLKDownSpreading,
240 double DISPCLKRampingMargin,
241 double DISPCLKDPPCLKVCOSpeed,
244 double dml32_RoundToDFSGranularity(double Clock, bool round_up, double VCOSpeed);
246 void dml32_CalculateOutputLink(
247 double PHYCLKPerState,
248 double PHYCLKD18PerState,
249 double PHYCLKD32PerState,
250 double Downspreading,
251 bool IsMainSurfaceUsingTheIndicatedTiming,
252 enum output_encoder_class Output,
253 enum output_format_class OutputFormat,
255 unsigned int HActive,
256 double PixelClockBackEnd,
257 double ForcedOutputLinkBPP,
258 unsigned int DSCInputBitPerComponent,
259 unsigned int NumberOfDSCSlices,
260 double AudioSampleRate,
261 unsigned int AudioSampleLayout,
262 enum odm_combine_mode ODMModeNoDSC,
263 enum odm_combine_mode ODMModeDSC,
265 unsigned int OutputLinkDPLanes,
266 enum dm_output_link_dp_rate OutputLinkDPRate,
272 enum dm_output_type *OutputType,
273 enum dm_output_rate *OutputRate,
274 unsigned int *RequiredSlots);
276 void dml32_CalculateDPPCLK(
277 unsigned int NumberOfActiveSurfaces,
278 double DISPCLKDPPCLKDSCCLKDownSpreading,
279 double DISPCLKDPPCLKVCOSpeed,
280 double DPPCLKUsingSingleDPP[],
281 unsigned int DPPPerSurface[],
284 double *GlobalDPPCLK,
287 double dml32_TruncToValidBPP(
291 unsigned int HActive,
295 enum output_encoder_class Output,
296 enum output_format_class Format,
297 unsigned int DSCInputBitPerComponent,
298 unsigned int DSCSlices,
299 unsigned int AudioRate,
300 unsigned int AudioLayout,
301 enum odm_combine_mode ODMModeNoDSC,
302 enum odm_combine_mode ODMModeDSC,
304 unsigned int *RequiredSlots);
306 double dml32_RequiredDTBCLK(
309 enum output_format_class OutputFormat,
311 unsigned int DSCSlices,
313 unsigned int HActive,
314 unsigned int AudioRate,
315 unsigned int AudioLayout);
317 unsigned int dml32_DSCDelayRequirement(bool DSCEnabled,
318 enum odm_combine_mode ODMMode,
319 unsigned int DSCInputBitPerComponent,
321 unsigned int HActive,
323 unsigned int NumberOfDSCSlices,
324 enum output_format_class OutputFormat,
325 enum output_encoder_class Output,
327 double PixelClockBackEnd);
329 void dml32_CalculateSurfaceSizeInMall(
330 unsigned int NumberOfActiveSurfaces,
331 unsigned int MALLAllocatedForDCN,
332 enum dm_use_mall_for_static_screen_mode UseMALLForStaticScreen[],
334 bool ViewportStationary[],
335 unsigned int ViewportXStartY[],
336 unsigned int ViewportYStartY[],
337 unsigned int ViewportXStartC[],
338 unsigned int ViewportYStartC[],
339 unsigned int ViewportWidthY[],
340 unsigned int ViewportHeightY[],
341 unsigned int BytesPerPixelY[],
342 unsigned int ViewportWidthC[],
343 unsigned int ViewportHeightC[],
344 unsigned int BytesPerPixelC[],
345 unsigned int SurfaceWidthY[],
346 unsigned int SurfaceWidthC[],
347 unsigned int SurfaceHeightY[],
348 unsigned int SurfaceHeightC[],
349 unsigned int Read256BytesBlockWidthY[],
350 unsigned int Read256BytesBlockWidthC[],
351 unsigned int Read256BytesBlockHeightY[],
352 unsigned int Read256BytesBlockHeightC[],
353 unsigned int ReadBlockWidthY[],
354 unsigned int ReadBlockWidthC[],
355 unsigned int ReadBlockHeightY[],
356 unsigned int ReadBlockHeightC[],
359 unsigned int SurfaceSizeInMALL[],
360 bool *ExceededMALLSize);
362 void dml32_CalculateVMRowAndSwath(
363 unsigned int NumberOfActiveSurfaces,
365 unsigned int SurfaceSizeInMALL[],
366 unsigned int PTEBufferSizeInRequestsLuma,
367 unsigned int PTEBufferSizeInRequestsChroma,
368 unsigned int DCCMetaBufferSizeBytes,
369 enum dm_use_mall_for_static_screen_mode UseMALLForStaticScreen[],
370 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
371 unsigned int MALLAllocatedForDCN,
372 double SwathWidthY[],
373 double SwathWidthC[],
376 unsigned int HostVMMaxNonCachedPageTableLevels,
377 unsigned int GPUVMMaxPageTableLevels,
378 unsigned int GPUVMMinPageSizeKBytes[],
379 unsigned int HostVMMinPageSize,
382 bool PTEBufferSizeNotExceeded[],
383 bool DCCMetaBufferSizeNotExceeded[],
384 unsigned int dpte_row_width_luma_ub[],
385 unsigned int dpte_row_width_chroma_ub[],
386 unsigned int dpte_row_height_luma[],
387 unsigned int dpte_row_height_chroma[],
388 unsigned int dpte_row_height_linear_luma[], // VBA_DELTA
389 unsigned int dpte_row_height_linear_chroma[], // VBA_DELTA
390 unsigned int meta_req_width[],
391 unsigned int meta_req_width_chroma[],
392 unsigned int meta_req_height[],
393 unsigned int meta_req_height_chroma[],
394 unsigned int meta_row_width[],
395 unsigned int meta_row_width_chroma[],
396 unsigned int meta_row_height[],
397 unsigned int meta_row_height_chroma[],
398 unsigned int vm_group_bytes[],
399 unsigned int dpte_group_bytes[],
400 unsigned int PixelPTEReqWidthY[],
401 unsigned int PixelPTEReqHeightY[],
402 unsigned int PTERequestSizeY[],
403 unsigned int PixelPTEReqWidthC[],
404 unsigned int PixelPTEReqHeightC[],
405 unsigned int PTERequestSizeC[],
406 unsigned int dpde0_bytes_per_frame_ub_l[],
407 unsigned int meta_pte_bytes_per_frame_ub_l[],
408 unsigned int dpde0_bytes_per_frame_ub_c[],
409 unsigned int meta_pte_bytes_per_frame_ub_c[],
410 double PrefetchSourceLinesY[],
411 double PrefetchSourceLinesC[],
412 double VInitPreFillY[],
413 double VInitPreFillC[],
414 unsigned int MaxNumSwathY[],
415 unsigned int MaxNumSwathC[],
416 double meta_row_bw[],
417 double dpte_row_bw[],
418 double PixelPTEBytesPerRow[],
419 double PDEAndMetaPTEBytesFrame[],
420 double MetaRowByte[],
421 bool use_one_row_for_frame[],
422 bool use_one_row_for_frame_flip[],
423 bool UsesMALLForStaticScreen[],
424 bool PTE_BUFFER_MODE[],
425 unsigned int BIGK_FRAGMENT_SIZE[]);
427 unsigned int dml32_CalculateVMAndRowBytes(
428 bool ViewportStationary,
430 unsigned int NumberOfDPPs,
431 unsigned int BlockHeight256Bytes,
432 unsigned int BlockWidth256Bytes,
433 enum source_format_class SourcePixelFormat,
434 unsigned int SurfaceTiling,
435 unsigned int BytePerPixel,
436 enum dm_rotation_angle SourceScan,
438 unsigned int ViewportHeight,
439 unsigned int ViewportXStart,
440 unsigned int ViewportYStart,
443 unsigned int HostVMMaxNonCachedPageTableLevels,
444 unsigned int GPUVMMaxPageTableLevels,
445 unsigned int GPUVMMinPageSizeKBytes,
446 unsigned int HostVMMinPageSize,
447 unsigned int PTEBufferSizeInRequests,
449 unsigned int DCCMetaPitch,
450 unsigned int MacroTileWidth,
451 unsigned int MacroTileHeight,
454 unsigned int *MetaRowByte,
455 unsigned int *PixelPTEBytesPerRow,
456 unsigned int *dpte_row_width_ub,
457 unsigned int *dpte_row_height,
458 unsigned int *dpte_row_height_linear,
459 unsigned int *PixelPTEBytesPerRow_one_row_per_frame,
460 unsigned int *dpte_row_width_ub_one_row_per_frame,
461 unsigned int *dpte_row_height_one_row_per_frame,
462 unsigned int *MetaRequestWidth,
463 unsigned int *MetaRequestHeight,
464 unsigned int *meta_row_width,
465 unsigned int *meta_row_height,
466 unsigned int *PixelPTEReqWidth,
467 unsigned int *PixelPTEReqHeight,
468 unsigned int *PTERequestSize,
469 unsigned int *DPDE0BytesFrame,
470 unsigned int *MetaPTEBytesFrame);
472 double dml32_CalculatePrefetchSourceLines(
476 bool ProgressiveToInterlaceUnitInOPP,
477 unsigned int SwathHeight,
478 enum dm_rotation_angle SourceRotation,
479 bool ViewportStationary,
481 unsigned int ViewportHeight,
482 unsigned int ViewportXStart,
483 unsigned int ViewportYStart,
486 double *VInitPreFill,
487 unsigned int *MaxNumSwath);
489 void dml32_CalculateMALLUseForStaticScreen(
490 unsigned int NumberOfActiveSurfaces,
491 unsigned int MALLAllocatedForDCNFinal,
492 enum dm_use_mall_for_static_screen_mode *UseMALLForStaticScreen,
493 unsigned int SurfaceSizeInMALL[],
494 bool one_row_per_frame_fits_in_buffer[],
497 bool UsesMALLForStaticScreen[]);
499 void dml32_CalculateRowBandwidth(
501 enum source_format_class SourcePixelFormat,
506 unsigned int MetaRowByteLuma,
507 unsigned int MetaRowByteChroma,
508 unsigned int meta_row_height_luma,
509 unsigned int meta_row_height_chroma,
510 unsigned int PixelPTEBytesPerRowLuma,
511 unsigned int PixelPTEBytesPerRowChroma,
512 unsigned int dpte_row_height_luma,
513 unsigned int dpte_row_height_chroma,
516 double *dpte_row_bw);
518 double dml32_CalculateUrgentLatency(
519 double UrgentLatencyPixelDataOnly,
520 double UrgentLatencyPixelMixedWithVMData,
521 double UrgentLatencyVMDataOnly,
522 bool DoUrgentLatencyAdjustment,
523 double UrgentLatencyAdjustmentFabricClockComponent,
524 double UrgentLatencyAdjustmentFabricClockReference,
527 void dml32_CalculateUrgentBurstFactor(
528 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange,
529 unsigned int swath_width_luma_ub,
530 unsigned int swath_width_chroma_ub,
531 unsigned int SwathHeightY,
532 unsigned int SwathHeightC,
534 double UrgentLatency,
535 double CursorBufferSize,
536 unsigned int CursorWidth,
537 unsigned int CursorBPP,
540 double BytePerPixelInDETY,
541 double BytePerPixelInDETC,
542 unsigned int DETBufferSizeY,
543 unsigned int DETBufferSizeC,
545 double *UrgentBurstFactorCursor,
546 double *UrgentBurstFactorLuma,
547 double *UrgentBurstFactorChroma,
548 bool *NotEnoughUrgentLatencyHiding);
550 void dml32_CalculateDCFCLKDeepSleep(
551 unsigned int NumberOfActiveSurfaces,
552 unsigned int BytePerPixelY[],
553 unsigned int BytePerPixelC[],
555 double VRatioChroma[],
556 double SwathWidthY[],
557 double SwathWidthC[],
558 unsigned int DPPPerSurface[],
560 double HRatioChroma[],
562 double PSCL_THROUGHPUT[],
563 double PSCL_THROUGHPUT_CHROMA[],
565 double ReadBandwidthLuma[],
566 double ReadBandwidthChroma[],
567 unsigned int ReturnBusWidth,
570 double *DCFClkDeepSleep);
572 double dml32_CalculateWriteBackDelay(
573 enum source_format_class WritebackPixelFormat,
574 double WritebackHRatio,
575 double WritebackVRatio,
576 unsigned int WritebackVTaps,
577 unsigned int WritebackDestinationWidth,
578 unsigned int WritebackDestinationHeight,
579 unsigned int WritebackSourceHeight,
580 unsigned int HTotal);
582 void dml32_UseMinimumDCFCLK(
583 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
585 bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
586 unsigned int MaxInterDCNTileRepeaters,
587 unsigned int MaxPrefetchMode,
588 double DRAMClockChangeLatencyFinal,
589 double FCLKChangeLatency,
590 double SREnterPlusExitTime,
591 unsigned int ReturnBusWidth,
592 unsigned int RoundTripPingLatencyCycles,
593 unsigned int ReorderingBytes,
594 unsigned int PixelChunkSizeInKByte,
595 unsigned int MetaChunkSize,
597 unsigned int GPUVMMaxPageTableLevels,
599 unsigned int NumberOfActiveSurfaces,
600 double HostVMMinPageSize,
601 unsigned int HostVMMaxNonCachedPageTableLevels,
602 bool DynamicMetadataVMEnabled,
603 bool ImmediateFlipRequirement,
604 bool ProgressiveToInterlaceUnitInOPP,
605 double MaxAveragePercentOfIdealSDPPortBWDisplayCanUseInNormalSystemOperation,
606 double PercentOfIdealSDPPortBWReceivedAfterUrgLatency,
607 unsigned int VTotal[],
608 unsigned int VActive[],
609 unsigned int DynamicMetadataTransmittedBytes[],
610 unsigned int DynamicMetadataLinesBeforeActiveRequired[],
612 double RequiredDPPCLKPerSurface[][2][DC__NUM_DPP__MAX],
613 double RequiredDISPCLK[][2],
615 unsigned int NoOfDPP[][2][DC__NUM_DPP__MAX],
616 double ProjectedDCFClkDeepSleep[][2],
617 double MaximumVStartup[][2][DC__NUM_DPP__MAX],
618 unsigned int TotalNumberOfActiveDPP[][2],
619 unsigned int TotalNumberOfDCCActiveDPP[][2],
620 unsigned int dpte_group_bytes[],
621 double PrefetchLinesY[][2][DC__NUM_DPP__MAX],
622 double PrefetchLinesC[][2][DC__NUM_DPP__MAX],
623 unsigned int swath_width_luma_ub_all_states[][2][DC__NUM_DPP__MAX],
624 unsigned int swath_width_chroma_ub_all_states[][2][DC__NUM_DPP__MAX],
625 unsigned int BytePerPixelY[],
626 unsigned int BytePerPixelC[],
627 unsigned int HTotal[],
629 double PDEAndMetaPTEBytesPerFrame[][2][DC__NUM_DPP__MAX],
630 double DPTEBytesPerRow[][2][DC__NUM_DPP__MAX],
631 double MetaRowBytes[][2][DC__NUM_DPP__MAX],
632 bool DynamicMetadataEnable[],
633 double ReadBandwidthLuma[],
634 double ReadBandwidthChroma[],
635 double DCFCLKPerState[],
637 double DCFCLKState[][2]);
639 unsigned int dml32_CalculateExtraLatencyBytes(unsigned int ReorderingBytes,
640 unsigned int TotalNumberOfActiveDPP,
641 unsigned int PixelChunkSizeInKByte,
642 unsigned int TotalNumberOfDCCActiveDPP,
643 unsigned int MetaChunkSize,
646 unsigned int NumberOfActiveSurfaces,
647 unsigned int NumberOfDPP[],
648 unsigned int dpte_group_bytes[],
649 double HostVMInefficiencyFactor,
650 double HostVMMinPageSize,
651 unsigned int HostVMMaxNonCachedPageTableLevels);
653 void dml32_CalculateVUpdateAndDynamicMetadataParameters(
654 unsigned int MaxInterDCNTileRepeaters,
657 double DCFClkDeepSleep,
661 unsigned int DynamicMetadataTransmittedBytes,
662 unsigned int DynamicMetadataLinesBeforeActiveRequired,
663 unsigned int InterlaceEnable,
664 bool ProgressiveToInterlaceUnitInOPP,
669 unsigned int *VUpdateOffsetPix,
670 double *VUpdateWidthPix,
671 double *VReadyOffsetPix);
673 double dml32_CalculateTWait(
674 unsigned int PrefetchMode,
675 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange,
676 bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
678 double DRAMClockChangeLatency,
679 double FCLKChangeLatency,
680 double UrgentLatency,
681 double SREnterPlusExitTime);
683 double dml32_get_return_bw_mbps(const soc_bounding_box_st *soc,
684 const int VoltageLevel,
685 const bool HostVMEnable,
687 const double FabricClock,
688 const double DRAMSpeed);
690 double dml32_get_return_bw_mbps_vm_only(const soc_bounding_box_st *soc,
691 const int VoltageLevel,
693 const double FabricClock,
694 const double DRAMSpeed);
696 double dml32_CalculateExtraLatency(
697 unsigned int RoundTripPingLatencyCycles,
698 unsigned int ReorderingBytes,
700 unsigned int TotalNumberOfActiveDPP,
701 unsigned int PixelChunkSizeInKByte,
702 unsigned int TotalNumberOfDCCActiveDPP,
703 unsigned int MetaChunkSize,
707 unsigned int NumberOfActiveSurfaces,
708 unsigned int NumberOfDPP[],
709 unsigned int dpte_group_bytes[],
710 double HostVMInefficiencyFactor,
711 double HostVMMinPageSize,
712 unsigned int HostVMMaxNonCachedPageTableLevels);
714 bool dml32_CalculatePrefetchSchedule(
715 double HostVMInefficiencyFactor,
717 unsigned int DSCDelay,
718 double DPPCLKDelaySubtotalPlusCNVCFormater,
719 double DPPCLKDelaySCL,
720 double DPPCLKDelaySCLLBOnly,
721 double DPPCLKDelayCNVCCursor,
722 double DISPCLKDelaySubtotal,
723 unsigned int DPP_RECOUT_WIDTH,
724 enum output_format_class OutputFormat,
725 unsigned int MaxInterDCNTileRepeaters,
726 unsigned int VStartup,
727 unsigned int MaxVStartup,
728 unsigned int GPUVMPageTableLevels,
731 unsigned int HostVMMaxNonCachedPageTableLevels,
732 double HostVMMinPageSize,
733 bool DynamicMetadataEnable,
734 bool DynamicMetadataVMEnabled,
735 int DynamicMetadataLinesBeforeActiveRequired,
736 unsigned int DynamicMetadataTransmittedBytes,
737 double UrgentLatency,
738 double UrgentExtraLatency,
740 unsigned int PDEAndMetaPTEBytesFrame,
741 unsigned int MetaRowByte,
742 unsigned int PixelPTEBytesPerRow,
743 double PrefetchSourceLinesY,
744 unsigned int SwathWidthY,
745 unsigned int VInitPreFillY,
746 unsigned int MaxNumSwathY,
747 double PrefetchSourceLinesC,
748 unsigned int SwathWidthC,
749 unsigned int VInitPreFillC,
750 unsigned int MaxNumSwathC,
751 unsigned int swath_width_luma_ub,
752 unsigned int swath_width_chroma_ub,
753 unsigned int SwathHeightY,
754 unsigned int SwathHeightC,
757 double *DSTXAfterScaler,
758 double *DSTYAfterScaler,
759 double *DestinationLinesForPrefetch,
760 double *PrefetchBandwidth,
761 double *DestinationLinesToRequestVMInVBlank,
762 double *DestinationLinesToRequestRowInVBlank,
763 double *VRatioPrefetchY,
764 double *VRatioPrefetchC,
765 double *RequiredPrefetchPixDataBWLuma,
766 double *RequiredPrefetchPixDataBWChroma,
767 bool *NotEnoughTimeForDynamicMetadata,
769 double *prefetch_vmrow_bw,
773 unsigned int *VUpdateOffsetPix,
774 double *VUpdateWidthPix,
775 double *VReadyOffsetPix);
777 void dml32_CalculateFlipSchedule(
778 double HostVMInefficiencyFactor,
779 double UrgentExtraLatency,
780 double UrgentLatency,
781 unsigned int GPUVMMaxPageTableLevels,
783 unsigned int HostVMMaxNonCachedPageTableLevels,
785 double HostVMMinPageSize,
786 double PDEAndMetaPTEBytesPerFrame,
788 double DPTEBytesPerRow,
789 double BandwidthAvailableForImmediateFlip,
790 unsigned int TotImmediateFlipBytes,
791 enum source_format_class SourcePixelFormat,
797 unsigned int dpte_row_height,
798 unsigned int meta_row_height,
799 unsigned int dpte_row_height_chroma,
800 unsigned int meta_row_height_chroma,
801 bool use_one_row_for_frame_flip,
804 double *DestinationLinesToRequestVMInImmediateFlip,
805 double *DestinationLinesToRequestRowInImmediateFlip,
806 double *final_flip_bw,
807 bool *ImmediateFlipSupportedForPipe);
809 void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
810 bool USRRetrainingRequiredFinal,
811 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
812 unsigned int PrefetchMode,
813 unsigned int NumberOfActiveSurfaces,
814 unsigned int MaxLineBufferLines,
815 unsigned int LineBufferSize,
816 unsigned int WritebackInterfaceBufferSize,
819 bool SynchronizeTimingsFinal,
820 bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
822 unsigned int dpte_group_bytes[],
823 unsigned int meta_row_height[],
824 unsigned int meta_row_height_chroma[],
825 SOCParametersList mmSOCParameters,
826 unsigned int WritebackChunkSize,
828 double DCFClkDeepSleep,
829 unsigned int DETBufferSizeY[],
830 unsigned int DETBufferSizeC[],
831 unsigned int SwathHeightY[],
832 unsigned int SwathHeightC[],
833 unsigned int LBBitPerPixel[],
834 double SwathWidthY[],
835 double SwathWidthC[],
837 double HRatioChroma[],
838 unsigned int VTaps[],
839 unsigned int VTapsChroma[],
841 double VRatioChroma[],
842 unsigned int HTotal[],
843 unsigned int VTotal[],
844 unsigned int VActive[],
846 unsigned int BlendingAndTiming[],
847 unsigned int DPPPerSurface[],
848 double BytePerPixelDETY[],
849 double BytePerPixelDETC[],
850 double DSTXAfterScaler[],
851 double DSTYAfterScaler[],
852 bool WritebackEnable[],
853 enum source_format_class WritebackPixelFormat[],
854 double WritebackDestinationWidth[],
855 double WritebackDestinationHeight[],
856 double WritebackSourceHeight[],
857 bool UnboundedRequestEnabled,
858 unsigned int CompressedBufferSizeInkByte,
861 Watermarks *Watermark,
862 enum clock_change_support *DRAMClockChangeSupport,
863 double MaxActiveDRAMClockChangeLatencySupported[],
864 unsigned int SubViewportLinesNeededInMALL[],
865 enum dm_fclock_change_support *FCLKChangeSupport,
866 double *MinActiveFCLKChangeLatencySupported,
867 bool *USRRetrainingSupport,
868 double ActiveDRAMClockChangeLatencyMargin[]);
870 double dml32_CalculateWriteBackDISPCLK(
871 enum source_format_class WritebackPixelFormat,
873 double WritebackHRatio,
874 double WritebackVRatio,
875 unsigned int WritebackHTaps,
876 unsigned int WritebackVTaps,
877 unsigned int WritebackSourceWidth,
878 unsigned int WritebackDestinationWidth,
880 unsigned int WritebackLineBufferSize,
881 double DISPCLKDPPCLKVCOSpeed);
883 void dml32_CalculateMinAndMaxPrefetchMode(
884 enum dm_prefetch_modes AllowForPStateChangeOrStutterInVBlankFinal,
885 unsigned int *MinPrefetchMode,
886 unsigned int *MaxPrefetchMode);
888 void dml32_CalculatePixelDeliveryTimes(
889 unsigned int NumberOfActiveSurfaces,
891 double VRatioChroma[],
892 double VRatioPrefetchY[],
893 double VRatioPrefetchC[],
894 unsigned int swath_width_luma_ub[],
895 unsigned int swath_width_chroma_ub[],
896 unsigned int DPPPerSurface[],
898 double HRatioChroma[],
900 double PSCL_THROUGHPUT[],
901 double PSCL_THROUGHPUT_CHROMA[],
903 unsigned int BytePerPixelC[],
904 enum dm_rotation_angle SourceRotation[],
905 unsigned int NumberOfCursors[],
906 unsigned int CursorWidth[][DC__NUM_CURSOR__MAX],
907 unsigned int CursorBPP[][DC__NUM_CURSOR__MAX],
908 unsigned int BlockWidth256BytesY[],
909 unsigned int BlockHeight256BytesY[],
910 unsigned int BlockWidth256BytesC[],
911 unsigned int BlockHeight256BytesC[],
914 double DisplayPipeLineDeliveryTimeLuma[],
915 double DisplayPipeLineDeliveryTimeChroma[],
916 double DisplayPipeLineDeliveryTimeLumaPrefetch[],
917 double DisplayPipeLineDeliveryTimeChromaPrefetch[],
918 double DisplayPipeRequestDeliveryTimeLuma[],
919 double DisplayPipeRequestDeliveryTimeChroma[],
920 double DisplayPipeRequestDeliveryTimeLumaPrefetch[],
921 double DisplayPipeRequestDeliveryTimeChromaPrefetch[],
922 double CursorRequestDeliveryTime[],
923 double CursorRequestDeliveryTimePrefetch[]);
925 void dml32_CalculateMetaAndPTETimes(
926 bool use_one_row_for_frame[],
927 unsigned int NumberOfActiveSurfaces,
929 unsigned int MetaChunkSize,
930 unsigned int MinMetaChunkSizeBytes,
931 unsigned int HTotal[],
933 double VRatioChroma[],
934 double DestinationLinesToRequestRowInVBlank[],
935 double DestinationLinesToRequestRowInImmediateFlip[],
938 unsigned int BytePerPixelY[],
939 unsigned int BytePerPixelC[],
940 enum dm_rotation_angle SourceRotation[],
941 unsigned int dpte_row_height[],
942 unsigned int dpte_row_height_chroma[],
943 unsigned int meta_row_width[],
944 unsigned int meta_row_width_chroma[],
945 unsigned int meta_row_height[],
946 unsigned int meta_row_height_chroma[],
947 unsigned int meta_req_width[],
948 unsigned int meta_req_width_chroma[],
949 unsigned int meta_req_height[],
950 unsigned int meta_req_height_chroma[],
951 unsigned int dpte_group_bytes[],
952 unsigned int PTERequestSizeY[],
953 unsigned int PTERequestSizeC[],
954 unsigned int PixelPTEReqWidthY[],
955 unsigned int PixelPTEReqHeightY[],
956 unsigned int PixelPTEReqWidthC[],
957 unsigned int PixelPTEReqHeightC[],
958 unsigned int dpte_row_width_luma_ub[],
959 unsigned int dpte_row_width_chroma_ub[],
962 double DST_Y_PER_PTE_ROW_NOM_L[],
963 double DST_Y_PER_PTE_ROW_NOM_C[],
964 double DST_Y_PER_META_ROW_NOM_L[],
965 double DST_Y_PER_META_ROW_NOM_C[],
966 double TimePerMetaChunkNominal[],
967 double TimePerChromaMetaChunkNominal[],
968 double TimePerMetaChunkVBlank[],
969 double TimePerChromaMetaChunkVBlank[],
970 double TimePerMetaChunkFlip[],
971 double TimePerChromaMetaChunkFlip[],
972 double time_per_pte_group_nom_luma[],
973 double time_per_pte_group_vblank_luma[],
974 double time_per_pte_group_flip_luma[],
975 double time_per_pte_group_nom_chroma[],
976 double time_per_pte_group_vblank_chroma[],
977 double time_per_pte_group_flip_chroma[]);
979 void dml32_CalculateVMGroupAndRequestTimes(
980 unsigned int NumberOfActiveSurfaces,
982 unsigned int GPUVMMaxPageTableLevels,
983 unsigned int HTotal[],
984 unsigned int BytePerPixelC[],
985 double DestinationLinesToRequestVMInVBlank[],
986 double DestinationLinesToRequestVMInImmediateFlip[],
989 unsigned int dpte_row_width_luma_ub[],
990 unsigned int dpte_row_width_chroma_ub[],
991 unsigned int vm_group_bytes[],
992 unsigned int dpde0_bytes_per_frame_ub_l[],
993 unsigned int dpde0_bytes_per_frame_ub_c[],
994 unsigned int meta_pte_bytes_per_frame_ub_l[],
995 unsigned int meta_pte_bytes_per_frame_ub_c[],
998 double TimePerVMGroupVBlank[],
999 double TimePerVMGroupFlip[],
1000 double TimePerVMRequestVBlank[],
1001 double TimePerVMRequestFlip[]);
1003 void dml32_CalculateDCCConfiguration(
1005 bool DCCProgrammingAssumesScanDirectionUnknown,
1006 enum source_format_class SourcePixelFormat,
1007 unsigned int SurfaceWidthLuma,
1008 unsigned int SurfaceWidthChroma,
1009 unsigned int SurfaceHeightLuma,
1010 unsigned int SurfaceHeightChroma,
1011 unsigned int nomDETInKByte,
1012 unsigned int RequestHeight256ByteLuma,
1013 unsigned int RequestHeight256ByteChroma,
1014 enum dm_swizzle_mode TilingFormat,
1015 unsigned int BytePerPixelY,
1016 unsigned int BytePerPixelC,
1017 double BytePerPixelDETY,
1018 double BytePerPixelDETC,
1019 enum dm_rotation_angle SourceRotation,
1021 unsigned int *MaxUncompressedBlockLuma,
1022 unsigned int *MaxUncompressedBlockChroma,
1023 unsigned int *MaxCompressedBlockLuma,
1024 unsigned int *MaxCompressedBlockChroma,
1025 unsigned int *IndependentBlockLuma,
1026 unsigned int *IndependentBlockChroma);
1028 void dml32_CalculateStutterEfficiency(
1029 unsigned int CompressedBufferSizeInkByte,
1030 enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
1031 bool UnboundedRequestEnabled,
1032 unsigned int MetaFIFOSizeInKEntries,
1033 unsigned int ZeroSizeBufferEntries,
1034 unsigned int PixelChunkSizeInKByte,
1035 unsigned int NumberOfActiveSurfaces,
1036 unsigned int ROBBufferSizeInKByte,
1037 double TotalDataReadBandwidth,
1040 unsigned int CompbufReservedSpace64B,
1041 unsigned int CompbufReservedSpaceZs,
1043 double SRExitZ8Time,
1044 bool SynchronizeTimingsFinal,
1045 unsigned int BlendingAndTiming[],
1046 double StutterEnterPlusExitWatermark,
1047 double Z8StutterEnterPlusExitWatermark,
1048 bool ProgressiveToInterlaceUnitInOPP,
1050 double MinTTUVBlank[],
1051 unsigned int DPPPerSurface[],
1052 unsigned int DETBufferSizeY[],
1053 unsigned int BytePerPixelY[],
1054 double BytePerPixelDETY[],
1055 double SwathWidthY[],
1056 unsigned int SwathHeightY[],
1057 unsigned int SwathHeightC[],
1058 double NetDCCRateLuma[],
1059 double NetDCCRateChroma[],
1060 double DCCFractionOfZeroSizeRequestsLuma[],
1061 double DCCFractionOfZeroSizeRequestsChroma[],
1062 unsigned int HTotal[],
1063 unsigned int VTotal[],
1064 double PixelClock[],
1066 enum dm_rotation_angle SourceRotation[],
1067 unsigned int BlockHeight256BytesY[],
1068 unsigned int BlockWidth256BytesY[],
1069 unsigned int BlockHeight256BytesC[],
1070 unsigned int BlockWidth256BytesC[],
1071 unsigned int DCCYMaxUncompressedBlock[],
1072 unsigned int DCCCMaxUncompressedBlock[],
1073 unsigned int VActive[],
1075 bool WritebackEnable[],
1076 double ReadBandwidthSurfaceLuma[],
1077 double ReadBandwidthSurfaceChroma[],
1078 double meta_row_bw[],
1079 double dpte_row_bw[],
1082 double *StutterEfficiencyNotIncludingVBlank,
1083 double *StutterEfficiency,
1084 unsigned int *NumberOfStutterBurstsPerFrame,
1085 double *Z8StutterEfficiencyNotIncludingVBlank,
1086 double *Z8StutterEfficiency,
1087 unsigned int *Z8NumberOfStutterBurstsPerFrame,
1088 double *StutterPeriod,
1089 bool *DCHUBBUB_ARB_CSTATE_MAX_CAP_MODE);
1091 void dml32_CalculateMaxDETAndMinCompressedBufferSize(
1092 unsigned int ConfigReturnBufferSizeInKByte,
1093 unsigned int ROBBufferSizeInKByte,
1094 unsigned int MaxNumDPP,
1095 bool nomDETInKByteOverrideEnable, // VBA_DELTA, allow DV to override default DET size
1096 unsigned int nomDETInKByteOverrideValue, // VBA_DELTA
1099 unsigned int *MaxTotalDETInKByte,
1100 unsigned int *nomDETInKByte,
1101 unsigned int *MinCompressedBufferSizeInKByte);
1103 bool dml32_CalculateVActiveBandwithSupport(unsigned int NumberOfActiveSurfaces,
1105 bool NotUrgentLatencyHiding[],
1106 double ReadBandwidthLuma[],
1107 double ReadBandwidthChroma[],
1109 double meta_row_bandwidth[],
1110 double dpte_row_bandwidth[],
1111 unsigned int NumberOfDPP[],
1112 double UrgentBurstFactorLuma[],
1113 double UrgentBurstFactorChroma[],
1114 double UrgentBurstFactorCursor[]);
1116 void dml32_CalculatePrefetchBandwithSupport(unsigned int NumberOfActiveSurfaces,
1118 bool NotUrgentLatencyHiding[],
1119 double ReadBandwidthLuma[],
1120 double ReadBandwidthChroma[],
1121 double PrefetchBandwidthLuma[],
1122 double PrefetchBandwidthChroma[],
1124 double meta_row_bandwidth[],
1125 double dpte_row_bandwidth[],
1126 double cursor_bw_pre[],
1127 double prefetch_vmrow_bw[],
1128 unsigned int NumberOfDPP[],
1129 double UrgentBurstFactorLuma[],
1130 double UrgentBurstFactorChroma[],
1131 double UrgentBurstFactorCursor[],
1132 double UrgentBurstFactorLumaPre[],
1133 double UrgentBurstFactorChromaPre[],
1134 double UrgentBurstFactorCursorPre[],
1137 double *PrefetchBandwidth,
1138 double *FractionOfUrgentBandwidth,
1139 bool *PrefetchBandwidthSupport);
1141 double dml32_CalculateBandwidthAvailableForImmediateFlip(unsigned int NumberOfActiveSurfaces,
1143 double ReadBandwidthLuma[],
1144 double ReadBandwidthChroma[],
1145 double PrefetchBandwidthLuma[],
1146 double PrefetchBandwidthChroma[],
1148 double cursor_bw_pre[],
1149 unsigned int NumberOfDPP[],
1150 double UrgentBurstFactorLuma[],
1151 double UrgentBurstFactorChroma[],
1152 double UrgentBurstFactorCursor[],
1153 double UrgentBurstFactorLumaPre[],
1154 double UrgentBurstFactorChromaPre[],
1155 double UrgentBurstFactorCursorPre[]);
1157 void dml32_CalculateImmediateFlipBandwithSupport(unsigned int NumberOfActiveSurfaces,
1159 enum immediate_flip_requirement ImmediateFlipRequirement[],
1160 double final_flip_bw[],
1161 double ReadBandwidthLuma[],
1162 double ReadBandwidthChroma[],
1163 double PrefetchBandwidthLuma[],
1164 double PrefetchBandwidthChroma[],
1166 double meta_row_bandwidth[],
1167 double dpte_row_bandwidth[],
1168 double cursor_bw_pre[],
1169 double prefetch_vmrow_bw[],
1170 unsigned int NumberOfDPP[],
1171 double UrgentBurstFactorLuma[],
1172 double UrgentBurstFactorChroma[],
1173 double UrgentBurstFactorCursor[],
1174 double UrgentBurstFactorLumaPre[],
1175 double UrgentBurstFactorChromaPre[],
1176 double UrgentBurstFactorCursorPre[],
1179 double *TotalBandwidth,
1180 double *FractionOfUrgentBandwidth,
1181 bool *ImmediateFlipBandwidthSupport);