1 /*
2  * Copyright 2022 Advanced Micro Devices, Inc.
3  *
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:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
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.
21  *
22  * Authors: AMD
23  *
24  */
25 
26 #ifndef __DML_DCN32_DISPLAY_MODE_VBA_UTIL_32_H__
27 #define __DML_DCN32_DISPLAY_MODE_VBA_UTIL_32_H__
28 
29 #include "../display_mode_enums.h"
30 #include "os_types.h"
31 #include "../dc_features.h"
32 #include "../display_mode_structs.h"
33 #include "dml/display_mode_vba.h"
34 
35 unsigned int dml32_dscceComputeDelay(
36 		unsigned int bpc,
37 		double BPP,
38 		unsigned int sliceWidth,
39 		unsigned int numSlices,
40 		enum output_format_class pixelFormat,
41 		enum output_encoder_class Output);
42 
43 unsigned int dml32_dscComputeDelay(enum output_format_class pixelFormat, enum output_encoder_class Output);
44 
45 bool IsVertical(enum dm_rotation_angle Scan);
46 
47 void dml32_CalculateBytePerPixelAndBlockSizes(
48 		enum source_format_class SourcePixelFormat,
49 		enum dm_swizzle_mode SurfaceTiling,
50 
51 		/*Output*/
52 		unsigned int *BytePerPixelY,
53 		unsigned int *BytePerPixelC,
54 		double           *BytePerPixelDETY,
55 		double           *BytePerPixelDETC,
56 		unsigned int *BlockHeight256BytesY,
57 		unsigned int *BlockHeight256BytesC,
58 		unsigned int *BlockWidth256BytesY,
59 		unsigned int *BlockWidth256BytesC,
60 		unsigned int *MacroTileHeightY,
61 		unsigned int *MacroTileHeightC,
62 		unsigned int *MacroTileWidthY,
63 		unsigned int *MacroTileWidthC);
64 
65 void dml32_CalculateSinglePipeDPPCLKAndSCLThroughput(
66 		double HRatio,
67 		double HRatioChroma,
68 		double VRatio,
69 		double VRatioChroma,
70 		double MaxDCHUBToPSCLThroughput,
71 		double MaxPSCLToLBThroughput,
72 		double PixelClock,
73 		enum source_format_class SourcePixelFormat,
74 		unsigned int HTaps,
75 		unsigned int HTapsChroma,
76 		unsigned int VTaps,
77 		unsigned int VTapsChroma,
78 
79 		/* output */
80 		double *PSCL_THROUGHPUT,
81 		double *PSCL_THROUGHPUT_CHROMA,
82 		double *DPPCLKUsingSingleDPP);
83 
84 void dml32_CalculateSwathAndDETConfiguration(
85 		struct dml32_CalculateSwathAndDETConfiguration *st_vars,
86 		unsigned int DETSizeOverride[],
87 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
88 		unsigned int ConfigReturnBufferSizeInKByte,
89 		unsigned int MaxTotalDETInKByte,
90 		unsigned int MinCompressedBufferSizeInKByte,
91 		double ForceSingleDPP,
92 		unsigned int NumberOfActiveSurfaces,
93 		unsigned int nomDETInKByte,
94 		enum unbounded_requesting_policy UseUnboundedRequestingFinal,
95 		bool DisableUnboundRequestIfCompBufReservedSpaceNeedAdjustment,
96 		unsigned int PixelChunkSizeKBytes,
97 		unsigned int ROBSizeKBytes,
98 		unsigned int CompressedBufferSegmentSizeInkByteFinal,
99 		enum output_encoder_class Output[],
100 		double ReadBandwidthLuma[],
101 		double ReadBandwidthChroma[],
102 		double MaximumSwathWidthLuma[],
103 		double MaximumSwathWidthChroma[],
104 		enum dm_rotation_angle SourceRotation[],
105 		bool ViewportStationary[],
106 		enum source_format_class SourcePixelFormat[],
107 		enum dm_swizzle_mode SurfaceTiling[],
108 		unsigned int ViewportWidth[],
109 		unsigned int ViewportHeight[],
110 		unsigned int ViewportXStart[],
111 		unsigned int ViewportYStart[],
112 		unsigned int ViewportXStartC[],
113 		unsigned int ViewportYStartC[],
114 		unsigned int SurfaceWidthY[],
115 		unsigned int SurfaceWidthC[],
116 		unsigned int SurfaceHeightY[],
117 		unsigned int SurfaceHeightC[],
118 		unsigned int Read256BytesBlockHeightY[],
119 		unsigned int Read256BytesBlockHeightC[],
120 		unsigned int Read256BytesBlockWidthY[],
121 		unsigned int Read256BytesBlockWidthC[],
122 		enum odm_combine_mode ODMMode[],
123 		unsigned int BlendingAndTiming[],
124 		unsigned int BytePerPixY[],
125 		unsigned int BytePerPixC[],
126 		double BytePerPixDETY[],
127 		double BytePerPixDETC[],
128 		unsigned int HActive[],
129 		double HRatio[],
130 		double HRatioChroma[],
131 		unsigned int DPPPerSurface[],
132 
133 		/* Output */
134 		unsigned int swath_width_luma_ub[],
135 		unsigned int swath_width_chroma_ub[],
136 		double SwathWidth[],
137 		double SwathWidthChroma[],
138 		unsigned int SwathHeightY[],
139 		unsigned int SwathHeightC[],
140 		unsigned int DETBufferSizeInKByte[],
141 		unsigned int DETBufferSizeY[],
142 		unsigned int DETBufferSizeC[],
143 		bool *UnboundedRequestEnabled,
144 		unsigned int *CompressedBufferSizeInkByte,
145 		unsigned int *CompBufReservedSpaceKBytes,
146 		bool *CompBufReservedSpaceNeedAdjustment,
147 		bool ViewportSizeSupportPerSurface[],
148 		bool *ViewportSizeSupport);
149 
150 void dml32_CalculateSwathWidth(
151 		bool ForceSingleDPP,
152 		unsigned int NumberOfActiveSurfaces,
153 		enum source_format_class SourcePixelFormat[],
154 		enum dm_rotation_angle SourceScan[],
155 		bool ViewportStationary[],
156 		unsigned int ViewportWidth[],
157 		unsigned int ViewportHeight[],
158 		unsigned int ViewportXStart[],
159 		unsigned int ViewportYStart[],
160 		unsigned int ViewportXStartC[],
161 		unsigned int ViewportYStartC[],
162 		unsigned int SurfaceWidthY[],
163 		unsigned int SurfaceWidthC[],
164 		unsigned int SurfaceHeightY[],
165 		unsigned int SurfaceHeightC[],
166 		enum odm_combine_mode ODMMode[],
167 		unsigned int BytePerPixY[],
168 		unsigned int BytePerPixC[],
169 		unsigned int Read256BytesBlockHeightY[],
170 		unsigned int Read256BytesBlockHeightC[],
171 		unsigned int Read256BytesBlockWidthY[],
172 		unsigned int Read256BytesBlockWidthC[],
173 		unsigned int BlendingAndTiming[],
174 		unsigned int HActive[],
175 		double HRatio[],
176 		unsigned int DPPPerSurface[],
177 
178 		/* Output */
179 		double SwathWidthdoubleDPPY[],
180 		double SwathWidthdoubleDPPC[],
181 		double SwathWidthY[], // per-pipe
182 		double SwathWidthC[], // per-pipe
183 		unsigned int MaximumSwathHeightY[],
184 		unsigned int MaximumSwathHeightC[],
185 		unsigned int swath_width_luma_ub[], // per-pipe
186 		unsigned int swath_width_chroma_ub[]);
187 
188 bool dml32_UnboundedRequest(enum unbounded_requesting_policy UseUnboundedRequestingFinal,
189 		unsigned int TotalNumberOfActiveDPP,
190 		bool NoChroma,
191 		enum output_encoder_class Output,
192 		enum dm_swizzle_mode SurfaceTiling,
193 		bool CompBufReservedSpaceNeedAdjustment,
194 		bool DisableUnboundRequestIfCompBufReservedSpaceNeedAdjustment);
195 
196 void dml32_CalculateDETBufferSize(
197 		unsigned int DETSizeOverride[],
198 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
199 		bool ForceSingleDPP,
200 		unsigned int NumberOfActiveSurfaces,
201 		bool UnboundedRequestEnabled,
202 		unsigned int nomDETInKByte,
203 		unsigned int MaxTotalDETInKByte,
204 		unsigned int ConfigReturnBufferSizeInKByte,
205 		unsigned int MinCompressedBufferSizeInKByte,
206 		unsigned int CompressedBufferSegmentSizeInkByteFinal,
207 		enum source_format_class SourcePixelFormat[],
208 		double ReadBandwidthLuma[],
209 		double ReadBandwidthChroma[],
210 		unsigned int RoundedUpMaxSwathSizeBytesY[],
211 		unsigned int RoundedUpMaxSwathSizeBytesC[],
212 		unsigned int DPPPerSurface[],
213 		/* Output */
214 		unsigned int DETBufferSizeInKByte[],
215 		unsigned int *CompressedBufferSizeInkByte);
216 
217 void dml32_CalculateODMMode(
218 		unsigned int MaximumPixelsPerLinePerDSCUnit,
219 		unsigned int HActive,
220 		enum output_encoder_class Output,
221 		enum odm_combine_policy ODMUse,
222 		double StateDispclk,
223 		double MaxDispclk,
224 		bool DSCEnable,
225 		unsigned int TotalNumberOfActiveDPP,
226 		unsigned int MaxNumDPP,
227 		double PixelClock,
228 		double DISPCLKDPPCLKDSCCLKDownSpreading,
229 		double DISPCLKRampingMargin,
230 		double DISPCLKDPPCLKVCOSpeed,
231 
232 		/* Output */
233 		bool *TotalAvailablePipesSupport,
234 		unsigned int *NumberOfDPP,
235 		enum odm_combine_mode *ODMMode,
236 		double *RequiredDISPCLKPerSurface);
237 
238 double dml32_CalculateRequiredDispclk(
239 		enum odm_combine_mode ODMMode,
240 		double PixelClock,
241 		double DISPCLKDPPCLKDSCCLKDownSpreading,
242 		double DISPCLKRampingMargin,
243 		double DISPCLKDPPCLKVCOSpeed,
244 		double MaxDispclk);
245 
246 double dml32_RoundToDFSGranularity(double Clock, bool round_up, double VCOSpeed);
247 
248 void dml32_CalculateOutputLink(
249 		double PHYCLKPerState,
250 		double PHYCLKD18PerState,
251 		double PHYCLKD32PerState,
252 		double Downspreading,
253 		bool IsMainSurfaceUsingTheIndicatedTiming,
254 		enum output_encoder_class Output,
255 		enum output_format_class OutputFormat,
256 		unsigned int HTotal,
257 		unsigned int HActive,
258 		double PixelClockBackEnd,
259 		double ForcedOutputLinkBPP,
260 		unsigned int DSCInputBitPerComponent,
261 		unsigned int NumberOfDSCSlices,
262 		double AudioSampleRate,
263 		unsigned int AudioSampleLayout,
264 		enum odm_combine_mode ODMModeNoDSC,
265 		enum odm_combine_mode ODMModeDSC,
266 		bool DSCEnable,
267 		unsigned int OutputLinkDPLanes,
268 		enum dm_output_link_dp_rate OutputLinkDPRate,
269 
270 		/* Output */
271 		bool *RequiresDSC,
272 		double *RequiresFEC,
273 		double  *OutBpp,
274 		enum dm_output_type *OutputType,
275 		enum dm_output_rate *OutputRate,
276 		unsigned int *RequiredSlots);
277 
278 void dml32_CalculateDPPCLK(
279 		unsigned int NumberOfActiveSurfaces,
280 		double DISPCLKDPPCLKDSCCLKDownSpreading,
281 		double DISPCLKDPPCLKVCOSpeed,
282 		double DPPCLKUsingSingleDPP[],
283 		unsigned int DPPPerSurface[],
284 
285 		/* output */
286 		double *GlobalDPPCLK,
287 		double Dppclk[]);
288 
289 double dml32_TruncToValidBPP(
290 		double LinkBitRate,
291 		unsigned int Lanes,
292 		unsigned int HTotal,
293 		unsigned int HActive,
294 		double PixelClock,
295 		double DesiredBPP,
296 		bool DSCEnable,
297 		enum output_encoder_class Output,
298 		enum output_format_class Format,
299 		unsigned int DSCInputBitPerComponent,
300 		unsigned int DSCSlices,
301 		unsigned int AudioRate,
302 		unsigned int AudioLayout,
303 		enum odm_combine_mode ODMModeNoDSC,
304 		enum odm_combine_mode ODMModeDSC,
305 		/* Output */
306 		unsigned int *RequiredSlots);
307 
308 double dml32_RequiredDTBCLK(
309 		bool              DSCEnable,
310 		double               PixelClock,
311 		enum output_format_class  OutputFormat,
312 		double               OutputBpp,
313 		unsigned int              DSCSlices,
314 		unsigned int                 HTotal,
315 		unsigned int                 HActive,
316 		unsigned int              AudioRate,
317 		unsigned int              AudioLayout);
318 
319 unsigned int dml32_DSCDelayRequirement(bool DSCEnabled,
320 		enum odm_combine_mode ODMMode,
321 		unsigned int DSCInputBitPerComponent,
322 		double OutputBpp,
323 		unsigned int HActive,
324 		unsigned int HTotal,
325 		unsigned int NumberOfDSCSlices,
326 		enum output_format_class  OutputFormat,
327 		enum output_encoder_class Output,
328 		double PixelClock,
329 		double PixelClockBackEnd);
330 
331 void dml32_CalculateSurfaceSizeInMall(
332 		unsigned int NumberOfActiveSurfaces,
333 		unsigned int MALLAllocatedForDCN,
334 		enum dm_use_mall_for_static_screen_mode UseMALLForStaticScreen[],
335 		bool DCCEnable[],
336 		bool ViewportStationary[],
337 		unsigned int ViewportXStartY[],
338 		unsigned int ViewportYStartY[],
339 		unsigned int ViewportXStartC[],
340 		unsigned int ViewportYStartC[],
341 		unsigned int ViewportWidthY[],
342 		unsigned int ViewportHeightY[],
343 		unsigned int BytesPerPixelY[],
344 		unsigned int ViewportWidthC[],
345 		unsigned int ViewportHeightC[],
346 		unsigned int BytesPerPixelC[],
347 		unsigned int SurfaceWidthY[],
348 		unsigned int SurfaceWidthC[],
349 		unsigned int SurfaceHeightY[],
350 		unsigned int SurfaceHeightC[],
351 		unsigned int Read256BytesBlockWidthY[],
352 		unsigned int Read256BytesBlockWidthC[],
353 		unsigned int Read256BytesBlockHeightY[],
354 		unsigned int Read256BytesBlockHeightC[],
355 		unsigned int ReadBlockWidthY[],
356 		unsigned int ReadBlockWidthC[],
357 		unsigned int ReadBlockHeightY[],
358 		unsigned int ReadBlockHeightC[],
359 
360 		/* Output */
361 		unsigned int    SurfaceSizeInMALL[],
362 		bool *ExceededMALLSize);
363 
364 void dml32_CalculateVMRowAndSwath(
365 		struct dml32_CalculateVMRowAndSwath *st_vars,
366 		unsigned int NumberOfActiveSurfaces,
367 		DmlPipe myPipe[],
368 		unsigned int SurfaceSizeInMALL[],
369 		unsigned int PTEBufferSizeInRequestsLuma,
370 		unsigned int PTEBufferSizeInRequestsChroma,
371 		unsigned int DCCMetaBufferSizeBytes,
372 		enum dm_use_mall_for_static_screen_mode UseMALLForStaticScreen[],
373 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
374 		unsigned int MALLAllocatedForDCN,
375 		double SwathWidthY[],
376 		double SwathWidthC[],
377 		bool GPUVMEnable,
378 		bool HostVMEnable,
379 		unsigned int HostVMMaxNonCachedPageTableLevels,
380 		unsigned int GPUVMMaxPageTableLevels,
381 		unsigned int GPUVMMinPageSizeKBytes[],
382 		unsigned int HostVMMinPageSize,
383 
384 		/* Output */
385 		bool PTEBufferSizeNotExceeded[],
386 		bool DCCMetaBufferSizeNotExceeded[],
387 		unsigned int dpte_row_width_luma_ub[],
388 		unsigned int dpte_row_width_chroma_ub[],
389 		unsigned int dpte_row_height_luma[],
390 		unsigned int dpte_row_height_chroma[],
391 		unsigned int dpte_row_height_linear_luma[],     // VBA_DELTA
392 		unsigned int dpte_row_height_linear_chroma[],   // VBA_DELTA
393 		unsigned int meta_req_width[],
394 		unsigned int meta_req_width_chroma[],
395 		unsigned int meta_req_height[],
396 		unsigned int meta_req_height_chroma[],
397 		unsigned int meta_row_width[],
398 		unsigned int meta_row_width_chroma[],
399 		unsigned int meta_row_height[],
400 		unsigned int meta_row_height_chroma[],
401 		unsigned int vm_group_bytes[],
402 		unsigned int dpte_group_bytes[],
403 		unsigned int PixelPTEReqWidthY[],
404 		unsigned int PixelPTEReqHeightY[],
405 		unsigned int PTERequestSizeY[],
406 		unsigned int PixelPTEReqWidthC[],
407 		unsigned int PixelPTEReqHeightC[],
408 		unsigned int PTERequestSizeC[],
409 		unsigned int dpde0_bytes_per_frame_ub_l[],
410 		unsigned int meta_pte_bytes_per_frame_ub_l[],
411 		unsigned int dpde0_bytes_per_frame_ub_c[],
412 		unsigned int meta_pte_bytes_per_frame_ub_c[],
413 		double PrefetchSourceLinesY[],
414 		double PrefetchSourceLinesC[],
415 		double VInitPreFillY[],
416 		double VInitPreFillC[],
417 		unsigned int MaxNumSwathY[],
418 		unsigned int MaxNumSwathC[],
419 		double meta_row_bw[],
420 		double dpte_row_bw[],
421 		double PixelPTEBytesPerRow[],
422 		double PDEAndMetaPTEBytesFrame[],
423 		double MetaRowByte[],
424 		bool use_one_row_for_frame[],
425 		bool use_one_row_for_frame_flip[],
426 		bool UsesMALLForStaticScreen[],
427 		bool PTE_BUFFER_MODE[],
428 		unsigned int BIGK_FRAGMENT_SIZE[]);
429 
430 unsigned int dml32_CalculateVMAndRowBytes(
431 		bool ViewportStationary,
432 		bool DCCEnable,
433 		unsigned int NumberOfDPPs,
434 		unsigned int BlockHeight256Bytes,
435 		unsigned int BlockWidth256Bytes,
436 		enum source_format_class SourcePixelFormat,
437 		unsigned int SurfaceTiling,
438 		unsigned int BytePerPixel,
439 		enum dm_rotation_angle SourceScan,
440 		double SwathWidth,
441 		unsigned int ViewportHeight,
442 		unsigned int    ViewportXStart,
443 		unsigned int    ViewportYStart,
444 		bool GPUVMEnable,
445 		bool HostVMEnable,
446 		unsigned int HostVMMaxNonCachedPageTableLevels,
447 		unsigned int GPUVMMaxPageTableLevels,
448 		unsigned int GPUVMMinPageSizeKBytes,
449 		unsigned int HostVMMinPageSize,
450 		unsigned int PTEBufferSizeInRequests,
451 		unsigned int Pitch,
452 		unsigned int DCCMetaPitch,
453 		unsigned int MacroTileWidth,
454 		unsigned int MacroTileHeight,
455 
456 		/* Output */
457 		unsigned int *MetaRowByte,
458 		unsigned int *PixelPTEBytesPerRow,
459 		unsigned int    *dpte_row_width_ub,
460 		unsigned int *dpte_row_height,
461 		unsigned int *dpte_row_height_linear,
462 		unsigned int    *PixelPTEBytesPerRow_one_row_per_frame,
463 		unsigned int    *dpte_row_width_ub_one_row_per_frame,
464 		unsigned int    *dpte_row_height_one_row_per_frame,
465 		unsigned int *MetaRequestWidth,
466 		unsigned int *MetaRequestHeight,
467 		unsigned int *meta_row_width,
468 		unsigned int *meta_row_height,
469 		unsigned int *PixelPTEReqWidth,
470 		unsigned int *PixelPTEReqHeight,
471 		unsigned int *PTERequestSize,
472 		unsigned int    *DPDE0BytesFrame,
473 		unsigned int    *MetaPTEBytesFrame);
474 
475 double dml32_CalculatePrefetchSourceLines(
476 		double VRatio,
477 		unsigned int VTaps,
478 		bool Interlace,
479 		bool ProgressiveToInterlaceUnitInOPP,
480 		unsigned int SwathHeight,
481 		enum dm_rotation_angle SourceRotation,
482 		bool ViewportStationary,
483 		double SwathWidth,
484 		unsigned int ViewportHeight,
485 		unsigned int ViewportXStart,
486 		unsigned int ViewportYStart,
487 
488 		/* Output */
489 		double *VInitPreFill,
490 		unsigned int *MaxNumSwath);
491 
492 void dml32_CalculateMALLUseForStaticScreen(
493 		unsigned int NumberOfActiveSurfaces,
494 		unsigned int MALLAllocatedForDCNFinal,
495 		enum dm_use_mall_for_static_screen_mode *UseMALLForStaticScreen,
496 		unsigned int SurfaceSizeInMALL[],
497 		bool one_row_per_frame_fits_in_buffer[],
498 
499 		/* output */
500 		bool UsesMALLForStaticScreen[]);
501 
502 void dml32_CalculateRowBandwidth(
503 		bool GPUVMEnable,
504 		enum source_format_class SourcePixelFormat,
505 		double VRatio,
506 		double VRatioChroma,
507 		bool DCCEnable,
508 		double LineTime,
509 		unsigned int MetaRowByteLuma,
510 		unsigned int MetaRowByteChroma,
511 		unsigned int meta_row_height_luma,
512 		unsigned int meta_row_height_chroma,
513 		unsigned int PixelPTEBytesPerRowLuma,
514 		unsigned int PixelPTEBytesPerRowChroma,
515 		unsigned int dpte_row_height_luma,
516 		unsigned int dpte_row_height_chroma,
517 		/* Output */
518 		double *meta_row_bw,
519 		double *dpte_row_bw);
520 
521 double dml32_CalculateUrgentLatency(
522 		double UrgentLatencyPixelDataOnly,
523 		double UrgentLatencyPixelMixedWithVMData,
524 		double UrgentLatencyVMDataOnly,
525 		bool   DoUrgentLatencyAdjustment,
526 		double UrgentLatencyAdjustmentFabricClockComponent,
527 		double UrgentLatencyAdjustmentFabricClockReference,
528 		double FabricClock);
529 
530 void dml32_CalculateUrgentBurstFactor(
531 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange,
532 		unsigned int    swath_width_luma_ub,
533 		unsigned int    swath_width_chroma_ub,
534 		unsigned int SwathHeightY,
535 		unsigned int SwathHeightC,
536 		double  LineTime,
537 		double  UrgentLatency,
538 		double  CursorBufferSize,
539 		unsigned int CursorWidth,
540 		unsigned int CursorBPP,
541 		double  VRatio,
542 		double  VRatioC,
543 		double  BytePerPixelInDETY,
544 		double  BytePerPixelInDETC,
545 		unsigned int    DETBufferSizeY,
546 		unsigned int    DETBufferSizeC,
547 		/* Output */
548 		double *UrgentBurstFactorCursor,
549 		double *UrgentBurstFactorLuma,
550 		double *UrgentBurstFactorChroma,
551 		bool   *NotEnoughUrgentLatencyHiding);
552 
553 void dml32_CalculateDCFCLKDeepSleep(
554 		unsigned int NumberOfActiveSurfaces,
555 		unsigned int BytePerPixelY[],
556 		unsigned int BytePerPixelC[],
557 		double VRatio[],
558 		double VRatioChroma[],
559 		double SwathWidthY[],
560 		double SwathWidthC[],
561 		unsigned int DPPPerSurface[],
562 		double HRatio[],
563 		double HRatioChroma[],
564 		double PixelClock[],
565 		double PSCL_THROUGHPUT[],
566 		double PSCL_THROUGHPUT_CHROMA[],
567 		double Dppclk[],
568 		double ReadBandwidthLuma[],
569 		double ReadBandwidthChroma[],
570 		unsigned int ReturnBusWidth,
571 
572 		/* Output */
573 		double *DCFClkDeepSleep);
574 
575 double dml32_CalculateWriteBackDelay(
576 		enum source_format_class WritebackPixelFormat,
577 		double WritebackHRatio,
578 		double WritebackVRatio,
579 		unsigned int WritebackVTaps,
580 		unsigned int         WritebackDestinationWidth,
581 		unsigned int         WritebackDestinationHeight,
582 		unsigned int         WritebackSourceHeight,
583 		unsigned int HTotal);
584 
585 void dml32_UseMinimumDCFCLK(
586 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
587 		bool DRRDisplay[],
588 		bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
589 		unsigned int MaxInterDCNTileRepeaters,
590 		unsigned int MaxPrefetchMode,
591 		double DRAMClockChangeLatencyFinal,
592 		double FCLKChangeLatency,
593 		double SREnterPlusExitTime,
594 		unsigned int ReturnBusWidth,
595 		unsigned int RoundTripPingLatencyCycles,
596 		unsigned int ReorderingBytes,
597 		unsigned int PixelChunkSizeInKByte,
598 		unsigned int MetaChunkSize,
599 		bool GPUVMEnable,
600 		unsigned int GPUVMMaxPageTableLevels,
601 		bool HostVMEnable,
602 		unsigned int NumberOfActiveSurfaces,
603 		double HostVMMinPageSize,
604 		unsigned int HostVMMaxNonCachedPageTableLevels,
605 		bool DynamicMetadataVMEnabled,
606 		bool ImmediateFlipRequirement,
607 		bool ProgressiveToInterlaceUnitInOPP,
608 		double MaxAveragePercentOfIdealSDPPortBWDisplayCanUseInNormalSystemOperation,
609 		double PercentOfIdealSDPPortBWReceivedAfterUrgLatency,
610 		unsigned int VTotal[],
611 		unsigned int VActive[],
612 		unsigned int DynamicMetadataTransmittedBytes[],
613 		unsigned int DynamicMetadataLinesBeforeActiveRequired[],
614 		bool Interlace[],
615 		double RequiredDPPCLKPerSurface[][2][DC__NUM_DPP__MAX],
616 		double RequiredDISPCLK[][2],
617 		double UrgLatency[],
618 		unsigned int NoOfDPP[][2][DC__NUM_DPP__MAX],
619 		double ProjectedDCFClkDeepSleep[][2],
620 		double MaximumVStartup[][2][DC__NUM_DPP__MAX],
621 		unsigned int TotalNumberOfActiveDPP[][2],
622 		unsigned int TotalNumberOfDCCActiveDPP[][2],
623 		unsigned int dpte_group_bytes[],
624 		double PrefetchLinesY[][2][DC__NUM_DPP__MAX],
625 		double PrefetchLinesC[][2][DC__NUM_DPP__MAX],
626 		unsigned int swath_width_luma_ub_all_states[][2][DC__NUM_DPP__MAX],
627 		unsigned int swath_width_chroma_ub_all_states[][2][DC__NUM_DPP__MAX],
628 		unsigned int BytePerPixelY[],
629 		unsigned int BytePerPixelC[],
630 		unsigned int HTotal[],
631 		double PixelClock[],
632 		double PDEAndMetaPTEBytesPerFrame[][2][DC__NUM_DPP__MAX],
633 		double DPTEBytesPerRow[][2][DC__NUM_DPP__MAX],
634 		double MetaRowBytes[][2][DC__NUM_DPP__MAX],
635 		bool DynamicMetadataEnable[],
636 		double ReadBandwidthLuma[],
637 		double ReadBandwidthChroma[],
638 		double DCFCLKPerState[],
639 		/* Output */
640 		double DCFCLKState[][2]);
641 
642 unsigned int dml32_CalculateExtraLatencyBytes(unsigned int ReorderingBytes,
643 		unsigned int TotalNumberOfActiveDPP,
644 		unsigned int PixelChunkSizeInKByte,
645 		unsigned int TotalNumberOfDCCActiveDPP,
646 		unsigned int MetaChunkSize,
647 		bool GPUVMEnable,
648 		bool HostVMEnable,
649 		unsigned int NumberOfActiveSurfaces,
650 		unsigned int NumberOfDPP[],
651 		unsigned int dpte_group_bytes[],
652 		double HostVMInefficiencyFactor,
653 		double HostVMMinPageSize,
654 		unsigned int HostVMMaxNonCachedPageTableLevels);
655 
656 void dml32_CalculateVUpdateAndDynamicMetadataParameters(
657 		unsigned int MaxInterDCNTileRepeaters,
658 		double Dppclk,
659 		double Dispclk,
660 		double DCFClkDeepSleep,
661 		double PixelClock,
662 		unsigned int HTotal,
663 		unsigned int VBlank,
664 		unsigned int DynamicMetadataTransmittedBytes,
665 		unsigned int DynamicMetadataLinesBeforeActiveRequired,
666 		unsigned int InterlaceEnable,
667 		bool ProgressiveToInterlaceUnitInOPP,
668 		double *TSetup,
669 		double *Tdmbf,
670 		double *Tdmec,
671 		double *Tdmsks,
672 		unsigned int *VUpdateOffsetPix,
673 		double *VUpdateWidthPix,
674 		double *VReadyOffsetPix);
675 
676 double dml32_CalculateTWait(
677 		unsigned int PrefetchMode,
678 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange,
679 		bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
680 		bool DRRDisplay,
681 		double DRAMClockChangeLatency,
682 		double FCLKChangeLatency,
683 		double UrgentLatency,
684 		double SREnterPlusExitTime);
685 
686 double dml32_get_return_bw_mbps(const soc_bounding_box_st *soc,
687 		const int VoltageLevel,
688 		const bool HostVMEnable,
689 		const double DCFCLK,
690 		const double FabricClock,
691 		const double DRAMSpeed);
692 
693 double dml32_get_return_bw_mbps_vm_only(const soc_bounding_box_st *soc,
694 		const int VoltageLevel,
695 		const double DCFCLK,
696 		const double FabricClock,
697 		const double DRAMSpeed);
698 
699 double dml32_CalculateExtraLatency(
700 		unsigned int RoundTripPingLatencyCycles,
701 		unsigned int ReorderingBytes,
702 		double DCFCLK,
703 		unsigned int TotalNumberOfActiveDPP,
704 		unsigned int PixelChunkSizeInKByte,
705 		unsigned int TotalNumberOfDCCActiveDPP,
706 		unsigned int MetaChunkSize,
707 		double ReturnBW,
708 		bool GPUVMEnable,
709 		bool HostVMEnable,
710 		unsigned int NumberOfActiveSurfaces,
711 		unsigned int NumberOfDPP[],
712 		unsigned int dpte_group_bytes[],
713 		double HostVMInefficiencyFactor,
714 		double HostVMMinPageSize,
715 		unsigned int HostVMMaxNonCachedPageTableLevels);
716 
717 bool dml32_CalculatePrefetchSchedule(
718 		double HostVMInefficiencyFactor,
719 		DmlPipe *myPipe,
720 		unsigned int DSCDelay,
721 		double DPPCLKDelaySubtotalPlusCNVCFormater,
722 		double DPPCLKDelaySCL,
723 		double DPPCLKDelaySCLLBOnly,
724 		double DPPCLKDelayCNVCCursor,
725 		double DISPCLKDelaySubtotal,
726 		unsigned int DPP_RECOUT_WIDTH,
727 		enum output_format_class OutputFormat,
728 		unsigned int MaxInterDCNTileRepeaters,
729 		unsigned int VStartup,
730 		unsigned int MaxVStartup,
731 		unsigned int GPUVMPageTableLevels,
732 		bool GPUVMEnable,
733 		bool HostVMEnable,
734 		unsigned int HostVMMaxNonCachedPageTableLevels,
735 		double HostVMMinPageSize,
736 		bool DynamicMetadataEnable,
737 		bool DynamicMetadataVMEnabled,
738 		int DynamicMetadataLinesBeforeActiveRequired,
739 		unsigned int DynamicMetadataTransmittedBytes,
740 		double UrgentLatency,
741 		double UrgentExtraLatency,
742 		double TCalc,
743 		unsigned int PDEAndMetaPTEBytesFrame,
744 		unsigned int MetaRowByte,
745 		unsigned int PixelPTEBytesPerRow,
746 		double PrefetchSourceLinesY,
747 		unsigned int SwathWidthY,
748 		unsigned int VInitPreFillY,
749 		unsigned int MaxNumSwathY,
750 		double PrefetchSourceLinesC,
751 		unsigned int SwathWidthC,
752 		unsigned int VInitPreFillC,
753 		unsigned int MaxNumSwathC,
754 		unsigned int swath_width_luma_ub,
755 		unsigned int swath_width_chroma_ub,
756 		unsigned int SwathHeightY,
757 		unsigned int SwathHeightC,
758 		double TWait,
759 		/* Output */
760 		double   *DSTXAfterScaler,
761 		double   *DSTYAfterScaler,
762 		double *DestinationLinesForPrefetch,
763 		double *PrefetchBandwidth,
764 		double *DestinationLinesToRequestVMInVBlank,
765 		double *DestinationLinesToRequestRowInVBlank,
766 		double *VRatioPrefetchY,
767 		double *VRatioPrefetchC,
768 		double *RequiredPrefetchPixDataBWLuma,
769 		double *RequiredPrefetchPixDataBWChroma,
770 		bool   *NotEnoughTimeForDynamicMetadata,
771 		double *Tno_bw,
772 		double *prefetch_vmrow_bw,
773 		double *Tdmdl_vm,
774 		double *Tdmdl,
775 		double *TSetup,
776 		unsigned int   *VUpdateOffsetPix,
777 		double   *VUpdateWidthPix,
778 		double   *VReadyOffsetPix);
779 
780 void dml32_CalculateFlipSchedule(
781 		double HostVMInefficiencyFactor,
782 		double UrgentExtraLatency,
783 		double UrgentLatency,
784 		unsigned int GPUVMMaxPageTableLevels,
785 		bool HostVMEnable,
786 		unsigned int HostVMMaxNonCachedPageTableLevels,
787 		bool GPUVMEnable,
788 		double HostVMMinPageSize,
789 		double PDEAndMetaPTEBytesPerFrame,
790 		double MetaRowBytes,
791 		double DPTEBytesPerRow,
792 		double BandwidthAvailableForImmediateFlip,
793 		unsigned int TotImmediateFlipBytes,
794 		enum source_format_class SourcePixelFormat,
795 		double LineTime,
796 		double VRatio,
797 		double VRatioChroma,
798 		double Tno_bw,
799 		bool DCCEnable,
800 		unsigned int dpte_row_height,
801 		unsigned int meta_row_height,
802 		unsigned int dpte_row_height_chroma,
803 		unsigned int meta_row_height_chroma,
804 		bool    use_one_row_for_frame_flip,
805 
806 		/* Output */
807 		double *DestinationLinesToRequestVMInImmediateFlip,
808 		double *DestinationLinesToRequestRowInImmediateFlip,
809 		double *final_flip_bw,
810 		bool *ImmediateFlipSupportedForPipe);
811 
812 void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
813 		struct dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport *st_vars,
814 		bool USRRetrainingRequiredFinal,
815 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
816 		unsigned int PrefetchMode,
817 		unsigned int NumberOfActiveSurfaces,
818 		unsigned int MaxLineBufferLines,
819 		unsigned int LineBufferSize,
820 		unsigned int WritebackInterfaceBufferSize,
821 		double DCFCLK,
822 		double ReturnBW,
823 		bool SynchronizeTimingsFinal,
824 		bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
825 		bool DRRDisplay[],
826 		unsigned int dpte_group_bytes[],
827 		unsigned int meta_row_height[],
828 		unsigned int meta_row_height_chroma[],
829 		SOCParametersList mmSOCParameters,
830 		unsigned int WritebackChunkSize,
831 		double SOCCLK,
832 		double DCFClkDeepSleep,
833 		unsigned int DETBufferSizeY[],
834 		unsigned int DETBufferSizeC[],
835 		unsigned int SwathHeightY[],
836 		unsigned int SwathHeightC[],
837 		unsigned int LBBitPerPixel[],
838 		double SwathWidthY[],
839 		double SwathWidthC[],
840 		double HRatio[],
841 		double HRatioChroma[],
842 		unsigned int VTaps[],
843 		unsigned int VTapsChroma[],
844 		double VRatio[],
845 		double VRatioChroma[],
846 		unsigned int HTotal[],
847 		unsigned int VTotal[],
848 		unsigned int VActive[],
849 		double PixelClock[],
850 		unsigned int BlendingAndTiming[],
851 		unsigned int DPPPerSurface[],
852 		double BytePerPixelDETY[],
853 		double BytePerPixelDETC[],
854 		double DSTXAfterScaler[],
855 		double DSTYAfterScaler[],
856 		bool WritebackEnable[],
857 		enum source_format_class WritebackPixelFormat[],
858 		double WritebackDestinationWidth[],
859 		double WritebackDestinationHeight[],
860 		double WritebackSourceHeight[],
861 		bool UnboundedRequestEnabled,
862 		unsigned int CompressedBufferSizeInkByte,
863 
864 		/* Output */
865 		Watermarks *Watermark,
866 		enum clock_change_support *DRAMClockChangeSupport,
867 		double MaxActiveDRAMClockChangeLatencySupported[],
868 		unsigned int SubViewportLinesNeededInMALL[],
869 		enum dm_fclock_change_support *FCLKChangeSupport,
870 		double *MinActiveFCLKChangeLatencySupported,
871 		bool *USRRetrainingSupport,
872 		double ActiveDRAMClockChangeLatencyMargin[]);
873 
874 double dml32_CalculateWriteBackDISPCLK(
875 		enum source_format_class WritebackPixelFormat,
876 		double PixelClock,
877 		double WritebackHRatio,
878 		double WritebackVRatio,
879 		unsigned int WritebackHTaps,
880 		unsigned int WritebackVTaps,
881 		unsigned int   WritebackSourceWidth,
882 		unsigned int   WritebackDestinationWidth,
883 		unsigned int HTotal,
884 		unsigned int WritebackLineBufferSize,
885 		double DISPCLKDPPCLKVCOSpeed);
886 
887 void dml32_CalculateMinAndMaxPrefetchMode(
888 		enum dm_prefetch_modes   AllowForPStateChangeOrStutterInVBlankFinal,
889 		unsigned int             *MinPrefetchMode,
890 		unsigned int             *MaxPrefetchMode);
891 
892 void dml32_CalculatePixelDeliveryTimes(
893 		unsigned int             NumberOfActiveSurfaces,
894 		double              VRatio[],
895 		double              VRatioChroma[],
896 		double              VRatioPrefetchY[],
897 		double              VRatioPrefetchC[],
898 		unsigned int             swath_width_luma_ub[],
899 		unsigned int             swath_width_chroma_ub[],
900 		unsigned int             DPPPerSurface[],
901 		double              HRatio[],
902 		double              HRatioChroma[],
903 		double              PixelClock[],
904 		double              PSCL_THROUGHPUT[],
905 		double              PSCL_THROUGHPUT_CHROMA[],
906 		double              Dppclk[],
907 		unsigned int             BytePerPixelC[],
908 		enum dm_rotation_angle   SourceRotation[],
909 		unsigned int             NumberOfCursors[],
910 		unsigned int             CursorWidth[][DC__NUM_CURSOR__MAX],
911 		unsigned int             CursorBPP[][DC__NUM_CURSOR__MAX],
912 		unsigned int             BlockWidth256BytesY[],
913 		unsigned int             BlockHeight256BytesY[],
914 		unsigned int             BlockWidth256BytesC[],
915 		unsigned int             BlockHeight256BytesC[],
916 
917 		/* Output */
918 		double              DisplayPipeLineDeliveryTimeLuma[],
919 		double              DisplayPipeLineDeliveryTimeChroma[],
920 		double              DisplayPipeLineDeliveryTimeLumaPrefetch[],
921 		double              DisplayPipeLineDeliveryTimeChromaPrefetch[],
922 		double              DisplayPipeRequestDeliveryTimeLuma[],
923 		double              DisplayPipeRequestDeliveryTimeChroma[],
924 		double              DisplayPipeRequestDeliveryTimeLumaPrefetch[],
925 		double              DisplayPipeRequestDeliveryTimeChromaPrefetch[],
926 		double              CursorRequestDeliveryTime[],
927 		double              CursorRequestDeliveryTimePrefetch[]);
928 
929 void dml32_CalculateMetaAndPTETimes(
930 		bool use_one_row_for_frame[],
931 		unsigned int NumberOfActiveSurfaces,
932 		bool GPUVMEnable,
933 		unsigned int MetaChunkSize,
934 		unsigned int MinMetaChunkSizeBytes,
935 		unsigned int    HTotal[],
936 		double  VRatio[],
937 		double  VRatioChroma[],
938 		double  DestinationLinesToRequestRowInVBlank[],
939 		double  DestinationLinesToRequestRowInImmediateFlip[],
940 		bool DCCEnable[],
941 		double  PixelClock[],
942 		unsigned int BytePerPixelY[],
943 		unsigned int BytePerPixelC[],
944 		enum dm_rotation_angle SourceRotation[],
945 		unsigned int dpte_row_height[],
946 		unsigned int dpte_row_height_chroma[],
947 		unsigned int meta_row_width[],
948 		unsigned int meta_row_width_chroma[],
949 		unsigned int meta_row_height[],
950 		unsigned int meta_row_height_chroma[],
951 		unsigned int meta_req_width[],
952 		unsigned int meta_req_width_chroma[],
953 		unsigned int meta_req_height[],
954 		unsigned int meta_req_height_chroma[],
955 		unsigned int dpte_group_bytes[],
956 		unsigned int    PTERequestSizeY[],
957 		unsigned int    PTERequestSizeC[],
958 		unsigned int    PixelPTEReqWidthY[],
959 		unsigned int    PixelPTEReqHeightY[],
960 		unsigned int    PixelPTEReqWidthC[],
961 		unsigned int    PixelPTEReqHeightC[],
962 		unsigned int    dpte_row_width_luma_ub[],
963 		unsigned int    dpte_row_width_chroma_ub[],
964 
965 		/* Output */
966 		double DST_Y_PER_PTE_ROW_NOM_L[],
967 		double DST_Y_PER_PTE_ROW_NOM_C[],
968 		double DST_Y_PER_META_ROW_NOM_L[],
969 		double DST_Y_PER_META_ROW_NOM_C[],
970 		double TimePerMetaChunkNominal[],
971 		double TimePerChromaMetaChunkNominal[],
972 		double TimePerMetaChunkVBlank[],
973 		double TimePerChromaMetaChunkVBlank[],
974 		double TimePerMetaChunkFlip[],
975 		double TimePerChromaMetaChunkFlip[],
976 		double time_per_pte_group_nom_luma[],
977 		double time_per_pte_group_vblank_luma[],
978 		double time_per_pte_group_flip_luma[],
979 		double time_per_pte_group_nom_chroma[],
980 		double time_per_pte_group_vblank_chroma[],
981 		double time_per_pte_group_flip_chroma[]);
982 
983 void dml32_CalculateVMGroupAndRequestTimes(
984 		unsigned int     NumberOfActiveSurfaces,
985 		bool     GPUVMEnable,
986 		unsigned int     GPUVMMaxPageTableLevels,
987 		unsigned int     HTotal[],
988 		unsigned int     BytePerPixelC[],
989 		double      DestinationLinesToRequestVMInVBlank[],
990 		double      DestinationLinesToRequestVMInImmediateFlip[],
991 		bool     DCCEnable[],
992 		double      PixelClock[],
993 		unsigned int        dpte_row_width_luma_ub[],
994 		unsigned int        dpte_row_width_chroma_ub[],
995 		unsigned int     vm_group_bytes[],
996 		unsigned int     dpde0_bytes_per_frame_ub_l[],
997 		unsigned int     dpde0_bytes_per_frame_ub_c[],
998 		unsigned int        meta_pte_bytes_per_frame_ub_l[],
999 		unsigned int        meta_pte_bytes_per_frame_ub_c[],
1000 
1001 		/* Output */
1002 		double      TimePerVMGroupVBlank[],
1003 		double      TimePerVMGroupFlip[],
1004 		double      TimePerVMRequestVBlank[],
1005 		double      TimePerVMRequestFlip[]);
1006 
1007 void dml32_CalculateDCCConfiguration(
1008 		bool             DCCEnabled,
1009 		bool             DCCProgrammingAssumesScanDirectionUnknown,
1010 		enum source_format_class SourcePixelFormat,
1011 		unsigned int             SurfaceWidthLuma,
1012 		unsigned int             SurfaceWidthChroma,
1013 		unsigned int             SurfaceHeightLuma,
1014 		unsigned int             SurfaceHeightChroma,
1015 		unsigned int                nomDETInKByte,
1016 		unsigned int             RequestHeight256ByteLuma,
1017 		unsigned int             RequestHeight256ByteChroma,
1018 		enum dm_swizzle_mode     TilingFormat,
1019 		unsigned int             BytePerPixelY,
1020 		unsigned int             BytePerPixelC,
1021 		double              BytePerPixelDETY,
1022 		double              BytePerPixelDETC,
1023 		enum dm_rotation_angle   SourceRotation,
1024 		/* Output */
1025 		unsigned int        *MaxUncompressedBlockLuma,
1026 		unsigned int        *MaxUncompressedBlockChroma,
1027 		unsigned int        *MaxCompressedBlockLuma,
1028 		unsigned int        *MaxCompressedBlockChroma,
1029 		unsigned int        *IndependentBlockLuma,
1030 		unsigned int        *IndependentBlockChroma);
1031 
1032 void dml32_CalculateStutterEfficiency(
1033 		unsigned int      CompressedBufferSizeInkByte,
1034 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
1035 		bool   UnboundedRequestEnabled,
1036 		unsigned int      MetaFIFOSizeInKEntries,
1037 		unsigned int      ZeroSizeBufferEntries,
1038 		unsigned int      PixelChunkSizeInKByte,
1039 		unsigned int   NumberOfActiveSurfaces,
1040 		unsigned int      ROBBufferSizeInKByte,
1041 		double    TotalDataReadBandwidth,
1042 		double    DCFCLK,
1043 		double    ReturnBW,
1044 		unsigned int      CompbufReservedSpace64B,
1045 		unsigned int      CompbufReservedSpaceZs,
1046 		double    SRExitTime,
1047 		double    SRExitZ8Time,
1048 		bool   SynchronizeTimingsFinal,
1049 		unsigned int   BlendingAndTiming[],
1050 		double    StutterEnterPlusExitWatermark,
1051 		double    Z8StutterEnterPlusExitWatermark,
1052 		bool   ProgressiveToInterlaceUnitInOPP,
1053 		bool   Interlace[],
1054 		double    MinTTUVBlank[],
1055 		unsigned int   DPPPerSurface[],
1056 		unsigned int      DETBufferSizeY[],
1057 		unsigned int   BytePerPixelY[],
1058 		double    BytePerPixelDETY[],
1059 		double      SwathWidthY[],
1060 		unsigned int   SwathHeightY[],
1061 		unsigned int   SwathHeightC[],
1062 		double    NetDCCRateLuma[],
1063 		double    NetDCCRateChroma[],
1064 		double    DCCFractionOfZeroSizeRequestsLuma[],
1065 		double    DCCFractionOfZeroSizeRequestsChroma[],
1066 		unsigned int      HTotal[],
1067 		unsigned int      VTotal[],
1068 		double    PixelClock[],
1069 		double    VRatio[],
1070 		enum dm_rotation_angle SourceRotation[],
1071 		unsigned int   BlockHeight256BytesY[],
1072 		unsigned int   BlockWidth256BytesY[],
1073 		unsigned int   BlockHeight256BytesC[],
1074 		unsigned int   BlockWidth256BytesC[],
1075 		unsigned int   DCCYMaxUncompressedBlock[],
1076 		unsigned int   DCCCMaxUncompressedBlock[],
1077 		unsigned int      VActive[],
1078 		bool   DCCEnable[],
1079 		bool   WritebackEnable[],
1080 		double    ReadBandwidthSurfaceLuma[],
1081 		double    ReadBandwidthSurfaceChroma[],
1082 		double    meta_row_bw[],
1083 		double    dpte_row_bw[],
1084 
1085 		/* Output */
1086 		double   *StutterEfficiencyNotIncludingVBlank,
1087 		double   *StutterEfficiency,
1088 		unsigned int     *NumberOfStutterBurstsPerFrame,
1089 		double   *Z8StutterEfficiencyNotIncludingVBlank,
1090 		double   *Z8StutterEfficiency,
1091 		unsigned int     *Z8NumberOfStutterBurstsPerFrame,
1092 		double   *StutterPeriod,
1093 		bool  *DCHUBBUB_ARB_CSTATE_MAX_CAP_MODE);
1094 
1095 void dml32_CalculateMaxDETAndMinCompressedBufferSize(
1096 		unsigned int    ConfigReturnBufferSizeInKByte,
1097 		unsigned int    ROBBufferSizeInKByte,
1098 		unsigned int MaxNumDPP,
1099 		bool nomDETInKByteOverrideEnable, // VBA_DELTA, allow DV to override default DET size
1100 		unsigned int nomDETInKByteOverrideValue,  // VBA_DELTA
1101 
1102 		/* Output */
1103 		unsigned int *MaxTotalDETInKByte,
1104 		unsigned int *nomDETInKByte,
1105 		unsigned int *MinCompressedBufferSizeInKByte);
1106 
1107 bool dml32_CalculateVActiveBandwithSupport(unsigned int NumberOfActiveSurfaces,
1108 		double ReturnBW,
1109 		bool NotUrgentLatencyHiding[],
1110 		double ReadBandwidthLuma[],
1111 		double ReadBandwidthChroma[],
1112 		double cursor_bw[],
1113 		double meta_row_bandwidth[],
1114 		double dpte_row_bandwidth[],
1115 		unsigned int NumberOfDPP[],
1116 		double UrgentBurstFactorLuma[],
1117 		double UrgentBurstFactorChroma[],
1118 		double UrgentBurstFactorCursor[]);
1119 
1120 void dml32_CalculatePrefetchBandwithSupport(unsigned int NumberOfActiveSurfaces,
1121 		double ReturnBW,
1122 		bool NotUrgentLatencyHiding[],
1123 		double ReadBandwidthLuma[],
1124 		double ReadBandwidthChroma[],
1125 		double PrefetchBandwidthLuma[],
1126 		double PrefetchBandwidthChroma[],
1127 		double cursor_bw[],
1128 		double meta_row_bandwidth[],
1129 		double dpte_row_bandwidth[],
1130 		double cursor_bw_pre[],
1131 		double prefetch_vmrow_bw[],
1132 		unsigned int NumberOfDPP[],
1133 		double UrgentBurstFactorLuma[],
1134 		double UrgentBurstFactorChroma[],
1135 		double UrgentBurstFactorCursor[],
1136 		double UrgentBurstFactorLumaPre[],
1137 		double UrgentBurstFactorChromaPre[],
1138 		double UrgentBurstFactorCursorPre[],
1139 
1140 		/* output */
1141 		double  *PrefetchBandwidth,
1142 		double  *FractionOfUrgentBandwidth,
1143 		bool *PrefetchBandwidthSupport);
1144 
1145 double dml32_CalculateBandwidthAvailableForImmediateFlip(unsigned int NumberOfActiveSurfaces,
1146 		double ReturnBW,
1147 		double ReadBandwidthLuma[],
1148 		double ReadBandwidthChroma[],
1149 		double PrefetchBandwidthLuma[],
1150 		double PrefetchBandwidthChroma[],
1151 		double cursor_bw[],
1152 		double cursor_bw_pre[],
1153 		unsigned int NumberOfDPP[],
1154 		double UrgentBurstFactorLuma[],
1155 		double UrgentBurstFactorChroma[],
1156 		double UrgentBurstFactorCursor[],
1157 		double UrgentBurstFactorLumaPre[],
1158 		double UrgentBurstFactorChromaPre[],
1159 		double UrgentBurstFactorCursorPre[]);
1160 
1161 void dml32_CalculateImmediateFlipBandwithSupport(unsigned int NumberOfActiveSurfaces,
1162 		double ReturnBW,
1163 		enum immediate_flip_requirement ImmediateFlipRequirement[],
1164 		double final_flip_bw[],
1165 		double ReadBandwidthLuma[],
1166 		double ReadBandwidthChroma[],
1167 		double PrefetchBandwidthLuma[],
1168 		double PrefetchBandwidthChroma[],
1169 		double cursor_bw[],
1170 		double meta_row_bandwidth[],
1171 		double dpte_row_bandwidth[],
1172 		double cursor_bw_pre[],
1173 		double prefetch_vmrow_bw[],
1174 		unsigned int NumberOfDPP[],
1175 		double UrgentBurstFactorLuma[],
1176 		double UrgentBurstFactorChroma[],
1177 		double UrgentBurstFactorCursor[],
1178 		double UrgentBurstFactorLumaPre[],
1179 		double UrgentBurstFactorChromaPre[],
1180 		double UrgentBurstFactorCursorPre[],
1181 
1182 		/* output */
1183 		double  *TotalBandwidth,
1184 		double  *FractionOfUrgentBandwidth,
1185 		bool *ImmediateFlipBandwidthSupport);
1186 
1187 #endif
1188