Skip to content

Commit

Permalink
drm/msm/dpu: consider vertical front porch in the prefill bw calculation
Browse files Browse the repository at this point in the history
In case of panels with low vertical back porch, the prefill bw
requirement will be high as we will have less time(vbp+pw) to
fetch and fill the hw latency buffers before start of first line
in active period.

For ex:
Say hw_latency_line_buffers = 24, and if blanking vbp+pw = 10
Here we need to fetch 24 lines of data in 10 line times.
This will increase the bw to the ratio of linebuffers to blanking.

DPU hw can also fetch data during vertical front porch provided
interface prefetch is enabled. Use vfp in the prefill calculation
as dpu driver enables prefetch if the blanking is not sufficient
to fill the latency lines.

Signed-off-by: Kalyan Thota <kalyan_t@codeaurora.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Rob Clark <robdclark@chromium.org>
  • Loading branch information
Kalyan Thota authored and Rob Clark committed Nov 29, 2020
1 parent 3d24712 commit 0c3d3cc
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane,
u64 plane_bw;
u32 hw_latency_lines;
u64 scale_factor;
int vbp, vpw;
int vbp, vpw, vfp;

pstate = to_dpu_plane_state(plane->state);
mode = &plane->state->crtc->mode;
Expand All @@ -174,6 +174,7 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane,
fps = drm_mode_vrefresh(mode);
vbp = mode->vtotal - mode->vsync_end;
vpw = mode->vsync_end - mode->vsync_start;
vfp = mode->vsync_start - mode->vdisplay;
hw_latency_lines = dpu_kms->catalog->perf.min_prefill_lines;
scale_factor = src_height > dst_height ?
mult_frac(src_height, 1, dst_height) : 1;
Expand All @@ -186,7 +187,13 @@ static void _dpu_plane_calc_bw(struct drm_plane *plane,
src_width * hw_latency_lines * fps * fmt->bpp *
scale_factor * mode->vtotal;

do_div(plane_prefill_bw, (vbp+vpw));
if ((vbp+vpw) > hw_latency_lines)
do_div(plane_prefill_bw, (vbp+vpw));
else if ((vbp+vpw+vfp) < hw_latency_lines)
do_div(plane_prefill_bw, (vbp+vpw+vfp));
else
do_div(plane_prefill_bw, hw_latency_lines);


pstate->plane_fetch_bw = max(plane_bw, plane_prefill_bw);
}
Expand Down

0 comments on commit 0c3d3cc

Please sign in to comment.