Skip to content

Commit 792d53f

Browse files
sandy-huangrkhuangtao
authored andcommitted
drm/rockchip: vop2: fix frame_bw calc error at YU08/YU10 format
Signed-off-by: Sandy Huang <[email protected]> Change-Id: Id7b0f9c5b99458b15f7a9de06c711454665a8794
1 parent dfa43c6 commit 792d53f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/gpu/drm/rockchip/rockchip_drm_vop2.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5540,7 +5540,8 @@ static size_t vop2_crtc_bandwidth(struct drm_crtc *crtc,
55405540
return -ENOMEM;
55415541

55425542
for_each_new_plane_in_state(state, plane, pstate, i) {
5543-
int act_w, act_h, cpp, afbc_fac;
5543+
int act_w, act_h, bpp, afbc_fac;
5544+
int fps = drm_mode_vrefresh(adjusted_mode);
55445545

55455546
if (!pstate || pstate->crtc != crtc || !pstate->fb)
55465547
continue;
@@ -5555,9 +5556,9 @@ static size_t vop2_crtc_bandwidth(struct drm_crtc *crtc,
55555556

55565557
act_w = drm_rect_width(&pstate->src) >> 16;
55575558
act_h = drm_rect_height(&pstate->src) >> 16;
5558-
cpp = pstate->fb->format->cpp[0];
5559+
bpp = rockchip_drm_get_bpp(pstate->fb->format);
55595560

5560-
vop_bw_info->frame_bw_mbyte += act_w * act_h / 1000 * cpp * drm_mode_vrefresh(adjusted_mode) / 1000;
5561+
vop_bw_info->frame_bw_mbyte += act_w * act_h / 1000 * bpp / 8 * fps / 1000;
55615562
}
55625563

55635564
sort(pbandwidth, cnt, sizeof(pbandwidth[0]), vop2_bandwidth_cmp, NULL);

0 commit comments

Comments
 (0)