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