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