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 		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_encoder_class Output,
220 		enum odm_combine_policy ODMUse,
221 		double StateDispclk,
222 		double MaxDispclk,
223 		bool DSCEnable,
224 		unsigned int TotalNumberOfActiveDPP,
225 		unsigned int MaxNumDPP,
226 		double PixelClock,
227 		double DISPCLKDPPCLKDSCCLKDownSpreading,
228 		double DISPCLKRampingMargin,
229 		double DISPCLKDPPCLKVCOSpeed,
230 		unsigned int NumberOfDSCSlices,
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 		unsigned int NumberOfActiveSurfaces,
366 		DmlPipe myPipe[],
367 		unsigned int SurfaceSizeInMALL[],
368 		unsigned int PTEBufferSizeInRequestsLuma,
369 		unsigned int PTEBufferSizeInRequestsChroma,
370 		unsigned int DCCMetaBufferSizeBytes,
371 		enum dm_use_mall_for_static_screen_mode UseMALLForStaticScreen[],
372 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
373 		unsigned int MALLAllocatedForDCN,
374 		double SwathWidthY[],
375 		double SwathWidthC[],
376 		bool GPUVMEnable,
377 		bool HostVMEnable,
378 		unsigned int HostVMMaxNonCachedPageTableLevels,
379 		unsigned int GPUVMMaxPageTableLevels,
380 		unsigned int GPUVMMinPageSizeKBytes[],
381 		unsigned int HostVMMinPageSize,
382 
383 		/* Output */
384 		bool PTEBufferSizeNotExceeded[],
385 		bool DCCMetaBufferSizeNotExceeded[],
386 		unsigned int dpte_row_width_luma_ub[],
387 		unsigned int dpte_row_width_chroma_ub[],
388 		unsigned int dpte_row_height_luma[],
389 		unsigned int dpte_row_height_chroma[],
390 		unsigned int dpte_row_height_linear_luma[],     // VBA_DELTA
391 		unsigned int dpte_row_height_linear_chroma[],   // VBA_DELTA
392 		unsigned int meta_req_width[],
393 		unsigned int meta_req_width_chroma[],
394 		unsigned int meta_req_height[],
395 		unsigned int meta_req_height_chroma[],
396 		unsigned int meta_row_width[],
397 		unsigned int meta_row_width_chroma[],
398 		unsigned int meta_row_height[],
399 		unsigned int meta_row_height_chroma[],
400 		unsigned int vm_group_bytes[],
401 		unsigned int dpte_group_bytes[],
402 		unsigned int PixelPTEReqWidthY[],
403 		unsigned int PixelPTEReqHeightY[],
404 		unsigned int PTERequestSizeY[],
405 		unsigned int PixelPTEReqWidthC[],
406 		unsigned int PixelPTEReqHeightC[],
407 		unsigned int PTERequestSizeC[],
408 		unsigned int dpde0_bytes_per_frame_ub_l[],
409 		unsigned int meta_pte_bytes_per_frame_ub_l[],
410 		unsigned int dpde0_bytes_per_frame_ub_c[],
411 		unsigned int meta_pte_bytes_per_frame_ub_c[],
412 		double PrefetchSourceLinesY[],
413 		double PrefetchSourceLinesC[],
414 		double VInitPreFillY[],
415 		double VInitPreFillC[],
416 		unsigned int MaxNumSwathY[],
417 		unsigned int MaxNumSwathC[],
418 		double meta_row_bw[],
419 		double dpte_row_bw[],
420 		double PixelPTEBytesPerRow[],
421 		double PDEAndMetaPTEBytesFrame[],
422 		double MetaRowByte[],
423 		bool use_one_row_for_frame[],
424 		bool use_one_row_for_frame_flip[],
425 		bool UsesMALLForStaticScreen[],
426 		bool PTE_BUFFER_MODE[],
427 		unsigned int BIGK_FRAGMENT_SIZE[]);
428 
429 unsigned int dml32_CalculateVMAndRowBytes(
430 		bool ViewportStationary,
431 		bool DCCEnable,
432 		unsigned int NumberOfDPPs,
433 		unsigned int BlockHeight256Bytes,
434 		unsigned int BlockWidth256Bytes,
435 		enum source_format_class SourcePixelFormat,
436 		unsigned int SurfaceTiling,
437 		unsigned int BytePerPixel,
438 		enum dm_rotation_angle SourceScan,
439 		double SwathWidth,
440 		unsigned int ViewportHeight,
441 		unsigned int    ViewportXStart,
442 		unsigned int    ViewportYStart,
443 		bool GPUVMEnable,
444 		bool HostVMEnable,
445 		unsigned int HostVMMaxNonCachedPageTableLevels,
446 		unsigned int GPUVMMaxPageTableLevels,
447 		unsigned int GPUVMMinPageSizeKBytes,
448 		unsigned int HostVMMinPageSize,
449 		unsigned int PTEBufferSizeInRequests,
450 		unsigned int Pitch,
451 		unsigned int DCCMetaPitch,
452 		unsigned int MacroTileWidth,
453 		unsigned int MacroTileHeight,
454 
455 		/* Output */
456 		unsigned int *MetaRowByte,
457 		unsigned int *PixelPTEBytesPerRow,
458 		unsigned int    *dpte_row_width_ub,
459 		unsigned int *dpte_row_height,
460 		unsigned int *dpte_row_height_linear,
461 		unsigned int    *PixelPTEBytesPerRow_one_row_per_frame,
462 		unsigned int    *dpte_row_width_ub_one_row_per_frame,
463 		unsigned int    *dpte_row_height_one_row_per_frame,
464 		unsigned int *MetaRequestWidth,
465 		unsigned int *MetaRequestHeight,
466 		unsigned int *meta_row_width,
467 		unsigned int *meta_row_height,
468 		unsigned int *PixelPTEReqWidth,
469 		unsigned int *PixelPTEReqHeight,
470 		unsigned int *PTERequestSize,
471 		unsigned int    *DPDE0BytesFrame,
472 		unsigned int    *MetaPTEBytesFrame);
473 
474 double dml32_CalculatePrefetchSourceLines(
475 		double VRatio,
476 		unsigned int VTaps,
477 		bool Interlace,
478 		bool ProgressiveToInterlaceUnitInOPP,
479 		unsigned int SwathHeight,
480 		enum dm_rotation_angle SourceRotation,
481 		bool ViewportStationary,
482 		double SwathWidth,
483 		unsigned int ViewportHeight,
484 		unsigned int ViewportXStart,
485 		unsigned int ViewportYStart,
486 
487 		/* Output */
488 		double *VInitPreFill,
489 		unsigned int *MaxNumSwath);
490 
491 void dml32_CalculateMALLUseForStaticScreen(
492 		unsigned int NumberOfActiveSurfaces,
493 		unsigned int MALLAllocatedForDCNFinal,
494 		enum dm_use_mall_for_static_screen_mode *UseMALLForStaticScreen,
495 		unsigned int SurfaceSizeInMALL[],
496 		bool one_row_per_frame_fits_in_buffer[],
497 
498 		/* output */
499 		bool UsesMALLForStaticScreen[]);
500 
501 void dml32_CalculateRowBandwidth(
502 		bool GPUVMEnable,
503 		enum source_format_class SourcePixelFormat,
504 		double VRatio,
505 		double VRatioChroma,
506 		bool DCCEnable,
507 		double LineTime,
508 		unsigned int MetaRowByteLuma,
509 		unsigned int MetaRowByteChroma,
510 		unsigned int meta_row_height_luma,
511 		unsigned int meta_row_height_chroma,
512 		unsigned int PixelPTEBytesPerRowLuma,
513 		unsigned int PixelPTEBytesPerRowChroma,
514 		unsigned int dpte_row_height_luma,
515 		unsigned int dpte_row_height_chroma,
516 		/* Output */
517 		double *meta_row_bw,
518 		double *dpte_row_bw);
519 
520 double dml32_CalculateUrgentLatency(
521 		double UrgentLatencyPixelDataOnly,
522 		double UrgentLatencyPixelMixedWithVMData,
523 		double UrgentLatencyVMDataOnly,
524 		bool   DoUrgentLatencyAdjustment,
525 		double UrgentLatencyAdjustmentFabricClockComponent,
526 		double UrgentLatencyAdjustmentFabricClockReference,
527 		double FabricClock);
528 
529 void dml32_CalculateUrgentBurstFactor(
530 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange,
531 		unsigned int    swath_width_luma_ub,
532 		unsigned int    swath_width_chroma_ub,
533 		unsigned int SwathHeightY,
534 		unsigned int SwathHeightC,
535 		double  LineTime,
536 		double  UrgentLatency,
537 		double  CursorBufferSize,
538 		unsigned int CursorWidth,
539 		unsigned int CursorBPP,
540 		double  VRatio,
541 		double  VRatioC,
542 		double  BytePerPixelInDETY,
543 		double  BytePerPixelInDETC,
544 		unsigned int    DETBufferSizeY,
545 		unsigned int    DETBufferSizeC,
546 		/* Output */
547 		double *UrgentBurstFactorCursor,
548 		double *UrgentBurstFactorLuma,
549 		double *UrgentBurstFactorChroma,
550 		bool   *NotEnoughUrgentLatencyHiding);
551 
552 void dml32_CalculateDCFCLKDeepSleep(
553 		unsigned int NumberOfActiveSurfaces,
554 		unsigned int BytePerPixelY[],
555 		unsigned int BytePerPixelC[],
556 		double VRatio[],
557 		double VRatioChroma[],
558 		double SwathWidthY[],
559 		double SwathWidthC[],
560 		unsigned int DPPPerSurface[],
561 		double HRatio[],
562 		double HRatioChroma[],
563 		double PixelClock[],
564 		double PSCL_THROUGHPUT[],
565 		double PSCL_THROUGHPUT_CHROMA[],
566 		double Dppclk[],
567 		double ReadBandwidthLuma[],
568 		double ReadBandwidthChroma[],
569 		unsigned int ReturnBusWidth,
570 
571 		/* Output */
572 		double *DCFClkDeepSleep);
573 
574 double dml32_CalculateWriteBackDelay(
575 		enum source_format_class WritebackPixelFormat,
576 		double WritebackHRatio,
577 		double WritebackVRatio,
578 		unsigned int WritebackVTaps,
579 		unsigned int         WritebackDestinationWidth,
580 		unsigned int         WritebackDestinationHeight,
581 		unsigned int         WritebackSourceHeight,
582 		unsigned int HTotal);
583 
584 void dml32_UseMinimumDCFCLK(
585 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
586 		bool DRRDisplay[],
587 		bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
588 		unsigned int MaxInterDCNTileRepeaters,
589 		unsigned int MaxPrefetchMode,
590 		double DRAMClockChangeLatencyFinal,
591 		double FCLKChangeLatency,
592 		double SREnterPlusExitTime,
593 		unsigned int ReturnBusWidth,
594 		unsigned int RoundTripPingLatencyCycles,
595 		unsigned int ReorderingBytes,
596 		unsigned int PixelChunkSizeInKByte,
597 		unsigned int MetaChunkSize,
598 		bool GPUVMEnable,
599 		unsigned int GPUVMMaxPageTableLevels,
600 		bool HostVMEnable,
601 		unsigned int NumberOfActiveSurfaces,
602 		double HostVMMinPageSize,
603 		unsigned int HostVMMaxNonCachedPageTableLevels,
604 		bool DynamicMetadataVMEnabled,
605 		bool ImmediateFlipRequirement,
606 		bool ProgressiveToInterlaceUnitInOPP,
607 		double MaxAveragePercentOfIdealSDPPortBWDisplayCanUseInNormalSystemOperation,
608 		double PercentOfIdealSDPPortBWReceivedAfterUrgLatency,
609 		unsigned int VTotal[],
610 		unsigned int VActive[],
611 		unsigned int DynamicMetadataTransmittedBytes[],
612 		unsigned int DynamicMetadataLinesBeforeActiveRequired[],
613 		bool Interlace[],
614 		double RequiredDPPCLKPerSurface[][2][DC__NUM_DPP__MAX],
615 		double RequiredDISPCLK[][2],
616 		double UrgLatency[],
617 		unsigned int NoOfDPP[][2][DC__NUM_DPP__MAX],
618 		double ProjectedDCFClkDeepSleep[][2],
619 		double MaximumVStartup[][2][DC__NUM_DPP__MAX],
620 		unsigned int TotalNumberOfActiveDPP[][2],
621 		unsigned int TotalNumberOfDCCActiveDPP[][2],
622 		unsigned int dpte_group_bytes[],
623 		double PrefetchLinesY[][2][DC__NUM_DPP__MAX],
624 		double PrefetchLinesC[][2][DC__NUM_DPP__MAX],
625 		unsigned int swath_width_luma_ub_all_states[][2][DC__NUM_DPP__MAX],
626 		unsigned int swath_width_chroma_ub_all_states[][2][DC__NUM_DPP__MAX],
627 		unsigned int BytePerPixelY[],
628 		unsigned int BytePerPixelC[],
629 		unsigned int HTotal[],
630 		double PixelClock[],
631 		double PDEAndMetaPTEBytesPerFrame[][2][DC__NUM_DPP__MAX],
632 		double DPTEBytesPerRow[][2][DC__NUM_DPP__MAX],
633 		double MetaRowBytes[][2][DC__NUM_DPP__MAX],
634 		bool DynamicMetadataEnable[],
635 		double ReadBandwidthLuma[],
636 		double ReadBandwidthChroma[],
637 		double DCFCLKPerState[],
638 		/* Output */
639 		double DCFCLKState[][2]);
640 
641 unsigned int dml32_CalculateExtraLatencyBytes(unsigned int ReorderingBytes,
642 		unsigned int TotalNumberOfActiveDPP,
643 		unsigned int PixelChunkSizeInKByte,
644 		unsigned int TotalNumberOfDCCActiveDPP,
645 		unsigned int MetaChunkSize,
646 		bool GPUVMEnable,
647 		bool HostVMEnable,
648 		unsigned int NumberOfActiveSurfaces,
649 		unsigned int NumberOfDPP[],
650 		unsigned int dpte_group_bytes[],
651 		double HostVMInefficiencyFactor,
652 		double HostVMMinPageSize,
653 		unsigned int HostVMMaxNonCachedPageTableLevels);
654 
655 void dml32_CalculateVUpdateAndDynamicMetadataParameters(
656 		unsigned int MaxInterDCNTileRepeaters,
657 		double Dppclk,
658 		double Dispclk,
659 		double DCFClkDeepSleep,
660 		double PixelClock,
661 		unsigned int HTotal,
662 		unsigned int VBlank,
663 		unsigned int DynamicMetadataTransmittedBytes,
664 		unsigned int DynamicMetadataLinesBeforeActiveRequired,
665 		unsigned int InterlaceEnable,
666 		bool ProgressiveToInterlaceUnitInOPP,
667 		double *TSetup,
668 		double *Tdmbf,
669 		double *Tdmec,
670 		double *Tdmsks,
671 		unsigned int *VUpdateOffsetPix,
672 		double *VUpdateWidthPix,
673 		double *VReadyOffsetPix);
674 
675 double dml32_CalculateTWait(
676 		unsigned int PrefetchMode,
677 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange,
678 		bool SynchronizeDRRDisplaysForUCLKPStateChangeFinal,
679 		bool DRRDisplay,
680 		double DRAMClockChangeLatency,
681 		double FCLKChangeLatency,
682 		double UrgentLatency,
683 		double SREnterPlusExitTime);
684 
685 double dml32_get_return_bw_mbps(const soc_bounding_box_st *soc,
686 		const int VoltageLevel,
687 		const bool HostVMEnable,
688 		const double DCFCLK,
689 		const double FabricClock,
690 		const double DRAMSpeed);
691 
692 double dml32_get_return_bw_mbps_vm_only(const soc_bounding_box_st *soc,
693 		const int VoltageLevel,
694 		const double DCFCLK,
695 		const double FabricClock,
696 		const double DRAMSpeed);
697 
698 double dml32_CalculateExtraLatency(
699 		unsigned int RoundTripPingLatencyCycles,
700 		unsigned int ReorderingBytes,
701 		double DCFCLK,
702 		unsigned int TotalNumberOfActiveDPP,
703 		unsigned int PixelChunkSizeInKByte,
704 		unsigned int TotalNumberOfDCCActiveDPP,
705 		unsigned int MetaChunkSize,
706 		double ReturnBW,
707 		bool GPUVMEnable,
708 		bool HostVMEnable,
709 		unsigned int NumberOfActiveSurfaces,
710 		unsigned int NumberOfDPP[],
711 		unsigned int dpte_group_bytes[],
712 		double HostVMInefficiencyFactor,
713 		double HostVMMinPageSize,
714 		unsigned int HostVMMaxNonCachedPageTableLevels);
715 
716 bool dml32_CalculatePrefetchSchedule(
717 		struct vba_vars_st *v,
718 		unsigned int k,
719 		double HostVMInefficiencyFactor,
720 		DmlPipe *myPipe,
721 		unsigned int DSCDelay,
722 		unsigned int DPP_RECOUT_WIDTH,
723 		unsigned int VStartup,
724 		unsigned int MaxVStartup,
725 		double UrgentLatency,
726 		double UrgentExtraLatency,
727 		double TCalc,
728 		unsigned int PDEAndMetaPTEBytesFrame,
729 		unsigned int MetaRowByte,
730 		unsigned int PixelPTEBytesPerRow,
731 		double PrefetchSourceLinesY,
732 		unsigned int SwathWidthY,
733 		unsigned int VInitPreFillY,
734 		unsigned int MaxNumSwathY,
735 		double PrefetchSourceLinesC,
736 		unsigned int SwathWidthC,
737 		unsigned int VInitPreFillC,
738 		unsigned int MaxNumSwathC,
739 		unsigned int swath_width_luma_ub,
740 		unsigned int swath_width_chroma_ub,
741 		unsigned int SwathHeightY,
742 		unsigned int SwathHeightC,
743 		double TWait,
744 		/* Output */
745 		double   *DSTXAfterScaler,
746 		double   *DSTYAfterScaler,
747 		double *DestinationLinesForPrefetch,
748 		double *PrefetchBandwidth,
749 		double *DestinationLinesToRequestVMInVBlank,
750 		double *DestinationLinesToRequestRowInVBlank,
751 		double *VRatioPrefetchY,
752 		double *VRatioPrefetchC,
753 		double *RequiredPrefetchPixDataBWLuma,
754 		double *RequiredPrefetchPixDataBWChroma,
755 		bool   *NotEnoughTimeForDynamicMetadata,
756 		double *Tno_bw,
757 		double *prefetch_vmrow_bw,
758 		double *Tdmdl_vm,
759 		double *Tdmdl,
760 		double *TSetup,
761 		unsigned int   *VUpdateOffsetPix,
762 		double   *VUpdateWidthPix,
763 		double   *VReadyOffsetPix);
764 
765 void dml32_CalculateFlipSchedule(
766 		double HostVMInefficiencyFactor,
767 		double UrgentExtraLatency,
768 		double UrgentLatency,
769 		unsigned int GPUVMMaxPageTableLevels,
770 		bool HostVMEnable,
771 		unsigned int HostVMMaxNonCachedPageTableLevels,
772 		bool GPUVMEnable,
773 		double HostVMMinPageSize,
774 		double PDEAndMetaPTEBytesPerFrame,
775 		double MetaRowBytes,
776 		double DPTEBytesPerRow,
777 		double BandwidthAvailableForImmediateFlip,
778 		unsigned int TotImmediateFlipBytes,
779 		enum source_format_class SourcePixelFormat,
780 		double LineTime,
781 		double VRatio,
782 		double VRatioChroma,
783 		double Tno_bw,
784 		bool DCCEnable,
785 		unsigned int dpte_row_height,
786 		unsigned int meta_row_height,
787 		unsigned int dpte_row_height_chroma,
788 		unsigned int meta_row_height_chroma,
789 		bool    use_one_row_for_frame_flip,
790 
791 		/* Output */
792 		double *DestinationLinesToRequestVMInImmediateFlip,
793 		double *DestinationLinesToRequestRowInImmediateFlip,
794 		double *final_flip_bw,
795 		bool *ImmediateFlipSupportedForPipe);
796 
797 void dml32_CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport(
798 		struct vba_vars_st *v,
799 		unsigned int PrefetchMode,
800 		double DCFCLK,
801 		double ReturnBW,
802 		SOCParametersList mmSOCParameters,
803 		double SOCCLK,
804 		double DCFClkDeepSleep,
805 		unsigned int DETBufferSizeY[],
806 		unsigned int DETBufferSizeC[],
807 		unsigned int SwathHeightY[],
808 		unsigned int SwathHeightC[],
809 		double SwathWidthY[],
810 		double SwathWidthC[],
811 		unsigned int DPPPerSurface[],
812 		double BytePerPixelDETY[],
813 		double BytePerPixelDETC[],
814 		double DSTXAfterScaler[],
815 		double DSTYAfterScaler[],
816 		bool UnboundedRequestEnabled,
817 		unsigned int CompressedBufferSizeInkByte,
818 
819 		/* Output */
820 		enum clock_change_support *DRAMClockChangeSupport,
821 		double MaxActiveDRAMClockChangeLatencySupported[],
822 		unsigned int SubViewportLinesNeededInMALL[],
823 		enum dm_fclock_change_support *FCLKChangeSupport,
824 		double *MinActiveFCLKChangeLatencySupported,
825 		bool *USRRetrainingSupport,
826 		double ActiveDRAMClockChangeLatencyMargin[]);
827 
828 double dml32_CalculateWriteBackDISPCLK(
829 		enum source_format_class WritebackPixelFormat,
830 		double PixelClock,
831 		double WritebackHRatio,
832 		double WritebackVRatio,
833 		unsigned int WritebackHTaps,
834 		unsigned int WritebackVTaps,
835 		unsigned int   WritebackSourceWidth,
836 		unsigned int   WritebackDestinationWidth,
837 		unsigned int HTotal,
838 		unsigned int WritebackLineBufferSize,
839 		double DISPCLKDPPCLKVCOSpeed);
840 
841 void dml32_CalculateMinAndMaxPrefetchMode(
842 		enum dm_prefetch_modes   AllowForPStateChangeOrStutterInVBlankFinal,
843 		unsigned int             *MinPrefetchMode,
844 		unsigned int             *MaxPrefetchMode);
845 
846 void dml32_CalculatePixelDeliveryTimes(
847 		unsigned int             NumberOfActiveSurfaces,
848 		double              VRatio[],
849 		double              VRatioChroma[],
850 		double              VRatioPrefetchY[],
851 		double              VRatioPrefetchC[],
852 		unsigned int             swath_width_luma_ub[],
853 		unsigned int             swath_width_chroma_ub[],
854 		unsigned int             DPPPerSurface[],
855 		double              HRatio[],
856 		double              HRatioChroma[],
857 		double              PixelClock[],
858 		double              PSCL_THROUGHPUT[],
859 		double              PSCL_THROUGHPUT_CHROMA[],
860 		double              Dppclk[],
861 		unsigned int             BytePerPixelC[],
862 		enum dm_rotation_angle   SourceRotation[],
863 		unsigned int             NumberOfCursors[],
864 		unsigned int             CursorWidth[][DC__NUM_CURSOR__MAX],
865 		unsigned int             CursorBPP[][DC__NUM_CURSOR__MAX],
866 		unsigned int             BlockWidth256BytesY[],
867 		unsigned int             BlockHeight256BytesY[],
868 		unsigned int             BlockWidth256BytesC[],
869 		unsigned int             BlockHeight256BytesC[],
870 
871 		/* Output */
872 		double              DisplayPipeLineDeliveryTimeLuma[],
873 		double              DisplayPipeLineDeliveryTimeChroma[],
874 		double              DisplayPipeLineDeliveryTimeLumaPrefetch[],
875 		double              DisplayPipeLineDeliveryTimeChromaPrefetch[],
876 		double              DisplayPipeRequestDeliveryTimeLuma[],
877 		double              DisplayPipeRequestDeliveryTimeChroma[],
878 		double              DisplayPipeRequestDeliveryTimeLumaPrefetch[],
879 		double              DisplayPipeRequestDeliveryTimeChromaPrefetch[],
880 		double              CursorRequestDeliveryTime[],
881 		double              CursorRequestDeliveryTimePrefetch[]);
882 
883 void dml32_CalculateMetaAndPTETimes(
884 		bool use_one_row_for_frame[],
885 		unsigned int NumberOfActiveSurfaces,
886 		bool GPUVMEnable,
887 		unsigned int MetaChunkSize,
888 		unsigned int MinMetaChunkSizeBytes,
889 		unsigned int    HTotal[],
890 		double  VRatio[],
891 		double  VRatioChroma[],
892 		double  DestinationLinesToRequestRowInVBlank[],
893 		double  DestinationLinesToRequestRowInImmediateFlip[],
894 		bool DCCEnable[],
895 		double  PixelClock[],
896 		unsigned int BytePerPixelY[],
897 		unsigned int BytePerPixelC[],
898 		enum dm_rotation_angle SourceRotation[],
899 		unsigned int dpte_row_height[],
900 		unsigned int dpte_row_height_chroma[],
901 		unsigned int meta_row_width[],
902 		unsigned int meta_row_width_chroma[],
903 		unsigned int meta_row_height[],
904 		unsigned int meta_row_height_chroma[],
905 		unsigned int meta_req_width[],
906 		unsigned int meta_req_width_chroma[],
907 		unsigned int meta_req_height[],
908 		unsigned int meta_req_height_chroma[],
909 		unsigned int dpte_group_bytes[],
910 		unsigned int    PTERequestSizeY[],
911 		unsigned int    PTERequestSizeC[],
912 		unsigned int    PixelPTEReqWidthY[],
913 		unsigned int    PixelPTEReqHeightY[],
914 		unsigned int    PixelPTEReqWidthC[],
915 		unsigned int    PixelPTEReqHeightC[],
916 		unsigned int    dpte_row_width_luma_ub[],
917 		unsigned int    dpte_row_width_chroma_ub[],
918 
919 		/* Output */
920 		double DST_Y_PER_PTE_ROW_NOM_L[],
921 		double DST_Y_PER_PTE_ROW_NOM_C[],
922 		double DST_Y_PER_META_ROW_NOM_L[],
923 		double DST_Y_PER_META_ROW_NOM_C[],
924 		double TimePerMetaChunkNominal[],
925 		double TimePerChromaMetaChunkNominal[],
926 		double TimePerMetaChunkVBlank[],
927 		double TimePerChromaMetaChunkVBlank[],
928 		double TimePerMetaChunkFlip[],
929 		double TimePerChromaMetaChunkFlip[],
930 		double time_per_pte_group_nom_luma[],
931 		double time_per_pte_group_vblank_luma[],
932 		double time_per_pte_group_flip_luma[],
933 		double time_per_pte_group_nom_chroma[],
934 		double time_per_pte_group_vblank_chroma[],
935 		double time_per_pte_group_flip_chroma[]);
936 
937 void dml32_CalculateVMGroupAndRequestTimes(
938 		unsigned int     NumberOfActiveSurfaces,
939 		bool     GPUVMEnable,
940 		unsigned int     GPUVMMaxPageTableLevels,
941 		unsigned int     HTotal[],
942 		unsigned int     BytePerPixelC[],
943 		double      DestinationLinesToRequestVMInVBlank[],
944 		double      DestinationLinesToRequestVMInImmediateFlip[],
945 		bool     DCCEnable[],
946 		double      PixelClock[],
947 		unsigned int        dpte_row_width_luma_ub[],
948 		unsigned int        dpte_row_width_chroma_ub[],
949 		unsigned int     vm_group_bytes[],
950 		unsigned int     dpde0_bytes_per_frame_ub_l[],
951 		unsigned int     dpde0_bytes_per_frame_ub_c[],
952 		unsigned int        meta_pte_bytes_per_frame_ub_l[],
953 		unsigned int        meta_pte_bytes_per_frame_ub_c[],
954 
955 		/* Output */
956 		double      TimePerVMGroupVBlank[],
957 		double      TimePerVMGroupFlip[],
958 		double      TimePerVMRequestVBlank[],
959 		double      TimePerVMRequestFlip[]);
960 
961 void dml32_CalculateDCCConfiguration(
962 		bool             DCCEnabled,
963 		bool             DCCProgrammingAssumesScanDirectionUnknown,
964 		enum source_format_class SourcePixelFormat,
965 		unsigned int             SurfaceWidthLuma,
966 		unsigned int             SurfaceWidthChroma,
967 		unsigned int             SurfaceHeightLuma,
968 		unsigned int             SurfaceHeightChroma,
969 		unsigned int                nomDETInKByte,
970 		unsigned int             RequestHeight256ByteLuma,
971 		unsigned int             RequestHeight256ByteChroma,
972 		enum dm_swizzle_mode     TilingFormat,
973 		unsigned int             BytePerPixelY,
974 		unsigned int             BytePerPixelC,
975 		double              BytePerPixelDETY,
976 		double              BytePerPixelDETC,
977 		enum dm_rotation_angle   SourceRotation,
978 		/* Output */
979 		unsigned int        *MaxUncompressedBlockLuma,
980 		unsigned int        *MaxUncompressedBlockChroma,
981 		unsigned int        *MaxCompressedBlockLuma,
982 		unsigned int        *MaxCompressedBlockChroma,
983 		unsigned int        *IndependentBlockLuma,
984 		unsigned int        *IndependentBlockChroma);
985 
986 void dml32_CalculateStutterEfficiency(
987 		unsigned int      CompressedBufferSizeInkByte,
988 		enum dm_use_mall_for_pstate_change_mode UseMALLForPStateChange[],
989 		bool   UnboundedRequestEnabled,
990 		unsigned int      MetaFIFOSizeInKEntries,
991 		unsigned int      ZeroSizeBufferEntries,
992 		unsigned int      PixelChunkSizeInKByte,
993 		unsigned int   NumberOfActiveSurfaces,
994 		unsigned int      ROBBufferSizeInKByte,
995 		double    TotalDataReadBandwidth,
996 		double    DCFCLK,
997 		double    ReturnBW,
998 		unsigned int      CompbufReservedSpace64B,
999 		unsigned int      CompbufReservedSpaceZs,
1000 		double    SRExitTime,
1001 		double    SRExitZ8Time,
1002 		bool   SynchronizeTimingsFinal,
1003 		unsigned int   BlendingAndTiming[],
1004 		double    StutterEnterPlusExitWatermark,
1005 		double    Z8StutterEnterPlusExitWatermark,
1006 		bool   ProgressiveToInterlaceUnitInOPP,
1007 		bool   Interlace[],
1008 		double    MinTTUVBlank[],
1009 		unsigned int   DPPPerSurface[],
1010 		unsigned int      DETBufferSizeY[],
1011 		unsigned int   BytePerPixelY[],
1012 		double    BytePerPixelDETY[],
1013 		double      SwathWidthY[],
1014 		unsigned int   SwathHeightY[],
1015 		unsigned int   SwathHeightC[],
1016 		double    NetDCCRateLuma[],
1017 		double    NetDCCRateChroma[],
1018 		double    DCCFractionOfZeroSizeRequestsLuma[],
1019 		double    DCCFractionOfZeroSizeRequestsChroma[],
1020 		unsigned int      HTotal[],
1021 		unsigned int      VTotal[],
1022 		double    PixelClock[],
1023 		double    VRatio[],
1024 		enum dm_rotation_angle SourceRotation[],
1025 		unsigned int   BlockHeight256BytesY[],
1026 		unsigned int   BlockWidth256BytesY[],
1027 		unsigned int   BlockHeight256BytesC[],
1028 		unsigned int   BlockWidth256BytesC[],
1029 		unsigned int   DCCYMaxUncompressedBlock[],
1030 		unsigned int   DCCCMaxUncompressedBlock[],
1031 		unsigned int      VActive[],
1032 		bool   DCCEnable[],
1033 		bool   WritebackEnable[],
1034 		double    ReadBandwidthSurfaceLuma[],
1035 		double    ReadBandwidthSurfaceChroma[],
1036 		double    meta_row_bw[],
1037 		double    dpte_row_bw[],
1038 
1039 		/* Output */
1040 		double   *StutterEfficiencyNotIncludingVBlank,
1041 		double   *StutterEfficiency,
1042 		unsigned int     *NumberOfStutterBurstsPerFrame,
1043 		double   *Z8StutterEfficiencyNotIncludingVBlank,
1044 		double   *Z8StutterEfficiency,
1045 		unsigned int     *Z8NumberOfStutterBurstsPerFrame,
1046 		double   *StutterPeriod,
1047 		bool  *DCHUBBUB_ARB_CSTATE_MAX_CAP_MODE);
1048 
1049 void dml32_CalculateMaxDETAndMinCompressedBufferSize(
1050 		unsigned int    ConfigReturnBufferSizeInKByte,
1051 		unsigned int    ROBBufferSizeInKByte,
1052 		unsigned int MaxNumDPP,
1053 		bool nomDETInKByteOverrideEnable, // VBA_DELTA, allow DV to override default DET size
1054 		unsigned int nomDETInKByteOverrideValue,  // VBA_DELTA
1055 
1056 		/* Output */
1057 		unsigned int *MaxTotalDETInKByte,
1058 		unsigned int *nomDETInKByte,
1059 		unsigned int *MinCompressedBufferSizeInKByte);
1060 
1061 bool dml32_CalculateVActiveBandwithSupport(unsigned int NumberOfActiveSurfaces,
1062 		double ReturnBW,
1063 		bool NotUrgentLatencyHiding[],
1064 		double ReadBandwidthLuma[],
1065 		double ReadBandwidthChroma[],
1066 		double cursor_bw[],
1067 		double meta_row_bandwidth[],
1068 		double dpte_row_bandwidth[],
1069 		unsigned int NumberOfDPP[],
1070 		double UrgentBurstFactorLuma[],
1071 		double UrgentBurstFactorChroma[],
1072 		double UrgentBurstFactorCursor[]);
1073 
1074 void dml32_CalculatePrefetchBandwithSupport(unsigned int NumberOfActiveSurfaces,
1075 		double ReturnBW,
1076 		bool NotUrgentLatencyHiding[],
1077 		double ReadBandwidthLuma[],
1078 		double ReadBandwidthChroma[],
1079 		double PrefetchBandwidthLuma[],
1080 		double PrefetchBandwidthChroma[],
1081 		double cursor_bw[],
1082 		double meta_row_bandwidth[],
1083 		double dpte_row_bandwidth[],
1084 		double cursor_bw_pre[],
1085 		double prefetch_vmrow_bw[],
1086 		unsigned int NumberOfDPP[],
1087 		double UrgentBurstFactorLuma[],
1088 		double UrgentBurstFactorChroma[],
1089 		double UrgentBurstFactorCursor[],
1090 		double UrgentBurstFactorLumaPre[],
1091 		double UrgentBurstFactorChromaPre[],
1092 		double UrgentBurstFactorCursorPre[],
1093 
1094 		/* output */
1095 		double  *PrefetchBandwidth,
1096 		double  *FractionOfUrgentBandwidth,
1097 		bool *PrefetchBandwidthSupport);
1098 
1099 double dml32_CalculateBandwidthAvailableForImmediateFlip(unsigned int NumberOfActiveSurfaces,
1100 		double ReturnBW,
1101 		double ReadBandwidthLuma[],
1102 		double ReadBandwidthChroma[],
1103 		double PrefetchBandwidthLuma[],
1104 		double PrefetchBandwidthChroma[],
1105 		double cursor_bw[],
1106 		double cursor_bw_pre[],
1107 		unsigned int NumberOfDPP[],
1108 		double UrgentBurstFactorLuma[],
1109 		double UrgentBurstFactorChroma[],
1110 		double UrgentBurstFactorCursor[],
1111 		double UrgentBurstFactorLumaPre[],
1112 		double UrgentBurstFactorChromaPre[],
1113 		double UrgentBurstFactorCursorPre[]);
1114 
1115 void dml32_CalculateImmediateFlipBandwithSupport(unsigned int NumberOfActiveSurfaces,
1116 		double ReturnBW,
1117 		enum immediate_flip_requirement ImmediateFlipRequirement[],
1118 		double final_flip_bw[],
1119 		double ReadBandwidthLuma[],
1120 		double ReadBandwidthChroma[],
1121 		double PrefetchBandwidthLuma[],
1122 		double PrefetchBandwidthChroma[],
1123 		double cursor_bw[],
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[],
1135 
1136 		/* output */
1137 		double  *TotalBandwidth,
1138 		double  *FractionOfUrgentBandwidth,
1139 		bool *ImmediateFlipBandwidthSupport);
1140 
1141 #endif
1142