forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-04 1543e317f1da31b75942316931e8f491a8920811
kernel/drivers/gpu/drm/amd/display/dc/dml/dml1_display_rq_dlg_calc.c
....@@ -243,7 +243,7 @@
243243 rq_regs->rq_regs_l.swath_height = dml_log2(rq_param.dlg.rq_l.swath_height);
244244 rq_regs->rq_regs_c.swath_height = dml_log2(rq_param.dlg.rq_c.swath_height);
245245
246
- /* FIXME: take the max between luma, chroma chunk size?
246
+ /* TODO: take the max between luma, chroma chunk size?
247247 * okay for now, as we are setting chunk_bytes to 8kb anyways
248248 */
249249 if (rq_param.sizing.rq_l.chunk_bytes >= 32 * 1024) { /*32kb */
....@@ -344,13 +344,31 @@
344344 if (surf_linear) {
345345 log2_swath_height_l = 0;
346346 log2_swath_height_c = 0;
347
- } else if (!surf_vert) {
348
- log2_swath_height_l = dml_log2(rq_param->misc.rq_l.blk256_height) - req128_l;
349
- log2_swath_height_c = dml_log2(rq_param->misc.rq_c.blk256_height) - req128_c;
350347 } else {
351
- log2_swath_height_l = dml_log2(rq_param->misc.rq_l.blk256_width) - req128_l;
352
- log2_swath_height_c = dml_log2(rq_param->misc.rq_c.blk256_width) - req128_c;
348
+ unsigned int swath_height_l;
349
+ unsigned int swath_height_c;
350
+
351
+ if (!surf_vert) {
352
+ swath_height_l = rq_param->misc.rq_l.blk256_height;
353
+ swath_height_c = rq_param->misc.rq_c.blk256_height;
354
+ } else {
355
+ swath_height_l = rq_param->misc.rq_l.blk256_width;
356
+ swath_height_c = rq_param->misc.rq_c.blk256_width;
357
+ }
358
+
359
+ if (swath_height_l > 0)
360
+ log2_swath_height_l = dml_log2(swath_height_l);
361
+
362
+ if (req128_l && log2_swath_height_l > 0)
363
+ log2_swath_height_l -= 1;
364
+
365
+ if (swath_height_c > 0)
366
+ log2_swath_height_c = dml_log2(swath_height_c);
367
+
368
+ if (req128_c && log2_swath_height_c > 0)
369
+ log2_swath_height_c -= 1;
353370 }
371
+
354372 rq_param->dlg.rq_l.swath_height = 1 << log2_swath_height_l;
355373 rq_param->dlg.rq_c.swath_height = 1 << log2_swath_height_c;
356374
....@@ -459,7 +477,7 @@
459477 /* dpte */
460478 /* ------ */
461479 log2_vmpg_bytes = dml_log2(mode_lib->soc.vmm_page_size_bytes);
462
- dpte_buf_in_pte_reqs = mode_lib->ip.dpte_buffer_size_in_pte_reqs;
480
+ dpte_buf_in_pte_reqs = mode_lib->ip.dpte_buffer_size_in_pte_reqs_luma;
463481
464482 log2_vmpg_height = 0;
465483 log2_vmpg_width = 0;
....@@ -602,7 +620,7 @@
602620 unsigned int log2_dpte_group_length;
603621 unsigned int func_meta_row_height, func_dpte_row_height;
604622
605
- /* FIXME check if ppe apply for both luma and chroma in 422 case */
623
+ /* TODO check if ppe apply for both luma and chroma in 422 case */
606624 if (is_chroma) {
607625 vp_width = pipe_src_param.viewport_width_c / ppe;
608626 vp_height = pipe_src_param.viewport_height_c;
....@@ -776,7 +794,7 @@
776794 /* dpte */
777795 /* ------ */
778796 log2_vmpg_bytes = dml_log2(mode_lib->soc.vmm_page_size_bytes);
779
- dpte_buf_in_pte_reqs = mode_lib->ip.dpte_buffer_size_in_pte_reqs;
797
+ dpte_buf_in_pte_reqs = mode_lib->ip.dpte_buffer_size_in_pte_reqs_luma;
780798
781799 log2_vmpg_height = 0;
782800 log2_vmpg_width = 0;
....@@ -881,7 +899,7 @@
881899 /* the dpte_group_bytes is reduced for the specific case of vertical
882900 * access of a tile surface that has dpte request of 8x1 ptes.
883901 */
884
- if (!surf_linear & (log2_dpte_req_height_ptes == 0) & surf_vert) /*reduced, in this case, will have page fault within a group */
902
+ if (!surf_linear && (log2_dpte_req_height_ptes == 0) && surf_vert) /*reduced, in this case, will have page fault within a group */
885903 rq_sizing_param->dpte_group_bytes = 512;
886904 else
887905 /*full size */
....@@ -1141,7 +1159,7 @@
11411159 ASSERT(disp_dlg_regs->refcyc_h_blank_end < (unsigned int) dml_pow(2, 13));
11421160 disp_dlg_regs->dlg_vblank_end = interlaced ? (vblank_end / 2) : vblank_end; /* 15 bits */
11431161
1144
- prefetch_xy_calc_in_dcfclk = 24.0; /* FIXME: ip_param */
1162
+ prefetch_xy_calc_in_dcfclk = 24.0; /* TODO: ip_param */
11451163 min_dcfclk_mhz = dlg_sys_param.deepsleep_dcfclk_mhz;
11461164 t_calc_us = prefetch_xy_calc_in_dcfclk / min_dcfclk_mhz;
11471165 min_ttu_vblank = dlg_sys_param.t_urg_wm_us;
....@@ -1182,7 +1200,7 @@
11821200 dcc_en = e2e_pipe_param.pipe.src.dcc;
11831201 dual_plane = is_dual_plane(
11841202 (enum source_format_class) e2e_pipe_param.pipe.src.source_format);
1185
- mode_422 = 0; /* FIXME */
1203
+ mode_422 = 0; /* TODO */
11861204 access_dir = (e2e_pipe_param.pipe.src.source_scan == dm_vert); /* vp access direction: horizontal or vertical accessed */
11871205 bytes_per_element_l = get_bytes_per_element(
11881206 (enum source_format_class) e2e_pipe_param.pipe.src.source_format,
....@@ -1837,7 +1855,7 @@
18371855 cur0_width_ub = dml_ceil((double) cur0_src_width / (double) cur0_req_width, 1)
18381856 * (double) cur0_req_width;
18391857 cur0_req_per_width = cur0_width_ub / (double) cur0_req_width;
1840
- hactive_cur0 = (double) cur0_src_width / hratios_cur0; /* FIXME: oswin to think about what to do for cursor */
1858
+ hactive_cur0 = (double) cur0_src_width / hratios_cur0; /* TODO: oswin to think about what to do for cursor */
18411859
18421860 if (vratio_pre_l <= 1.0) {
18431861 refcyc_per_req_delivery_pre_cur0 = hactive_cur0 * ref_freq_to_pix_freq