Skip to content

Commit d3a785e

Browse files
lumagAbhinav Kumar
authored andcommitted
drm/msm/dpu: take plane rotation into account for wide planes
Take into account the plane rotation and flipping when calculating src positions for the wide plane parts. This is not an issue yet, because rotation is only supported for the UBWC planes and wide UBWC planes are rejected anyway because in parallel multirect case only the half of the usual width is supported for tiled formats. However it's better to fix this now rather than stumbling upon it later. Fixes: 80e8ae3 ("drm/msm/dpu: add support for wide planes") Reviewed-by: Abhinav Kumar <[email protected]> Signed-off-by: Dmitry Baryshkov <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/601059/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Abhinav Kumar <[email protected]>
1 parent cb18195 commit d3a785e

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -866,6 +866,10 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
866866

867867
max_linewidth = pdpu->catalog->caps->max_linewidth;
868868

869+
drm_rect_rotate(&pipe_cfg->src_rect,
870+
new_plane_state->fb->width, new_plane_state->fb->height,
871+
new_plane_state->rotation);
872+
869873
if ((drm_rect_width(&pipe_cfg->src_rect) > max_linewidth) ||
870874
_dpu_plane_calc_clk(&crtc_state->adjusted_mode, pipe_cfg) > max_mdp_clk_rate) {
871875
/*
@@ -915,6 +919,14 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
915919
r_pipe_cfg->dst_rect.x1 = pipe_cfg->dst_rect.x2;
916920
}
917921

922+
drm_rect_rotate_inv(&pipe_cfg->src_rect,
923+
new_plane_state->fb->width, new_plane_state->fb->height,
924+
new_plane_state->rotation);
925+
if (r_pipe->sspp)
926+
drm_rect_rotate_inv(&r_pipe_cfg->src_rect,
927+
new_plane_state->fb->width, new_plane_state->fb->height,
928+
new_plane_state->rotation);
929+
918930
ret = dpu_plane_atomic_check_pipe(pdpu, pipe, pipe_cfg, fmt, &crtc_state->adjusted_mode);
919931
if (ret)
920932
return ret;

0 commit comments

Comments
 (0)