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