Skip to content

Commit 759bcfe

Browse files
committed
drm/msm/dpu: drop dpu_format_populate_layout from dpu_plane_sspp_atomic_update
The dpu_plane_prepare_fb() already calls dpu_format_populate_layout(). Store the generated layout in the plane state and drop this call from dpu_plane_sspp_update(). Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Tested-by: Abhinav Kumar <quic_abhinavk@quicinc.com> # sc7280 Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/612240/ Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-5-617e1ecc4b7a@linaro.org
1 parent a269919 commit 759bcfe

2 files changed

Lines changed: 7 additions & 15 deletions

File tree

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

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -648,7 +648,6 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
648648
struct drm_framebuffer *fb = new_state->fb;
649649
struct dpu_plane *pdpu = to_dpu_plane(plane);
650650
struct dpu_plane_state *pstate = to_dpu_plane_state(new_state);
651-
struct dpu_hw_fmt_layout layout;
652651
struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
653652
int ret;
654653

@@ -678,7 +677,8 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
678677

679678
/* validate framebuffer layout before commit */
680679
ret = dpu_format_populate_layout(pstate->aspace,
681-
new_state->fb, &layout);
680+
new_state->fb,
681+
&pstate->layout);
682682
if (ret) {
683683
DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret);
684684
if (pstate->aspace)
@@ -1115,17 +1115,6 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
11151115
msm_framebuffer_format(fb);
11161116
struct dpu_sw_pipe_cfg *pipe_cfg = &pstate->pipe_cfg;
11171117
struct dpu_sw_pipe_cfg *r_pipe_cfg = &pstate->r_pipe_cfg;
1118-
struct dpu_kms *kms = _dpu_plane_get_kms(&pdpu->base);
1119-
struct msm_gem_address_space *aspace = kms->base.aspace;
1120-
struct dpu_hw_fmt_layout layout;
1121-
bool layout_valid = false;
1122-
int ret;
1123-
1124-
ret = dpu_format_populate_layout(aspace, fb, &layout);
1125-
if (ret)
1126-
DPU_ERROR_PLANE(pdpu, "failed to get format layout, %d\n", ret);
1127-
else
1128-
layout_valid = true;
11291118

11301119
pstate->pending = true;
11311120

@@ -1140,12 +1129,12 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
11401129

11411130
dpu_plane_sspp_update_pipe(plane, pipe, pipe_cfg, fmt,
11421131
drm_mode_vrefresh(&crtc->mode),
1143-
layout_valid ? &layout : NULL);
1132+
&pstate->layout);
11441133

11451134
if (r_pipe->sspp) {
11461135
dpu_plane_sspp_update_pipe(plane, r_pipe, r_pipe_cfg, fmt,
11471136
drm_mode_vrefresh(&crtc->mode),
1148-
layout_valid ? &layout : NULL);
1137+
&pstate->layout);
11491138
}
11501139

11511140
if (pstate->needs_qos_remap)

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
* @plane_clk: calculated clk per plane
3232
* @needs_dirtyfb: whether attached CRTC needs pixel data explicitly flushed
3333
* @rotation: simplified drm rotation hint
34+
* @layout: framebuffer memory layout
3435
*/
3536
struct dpu_plane_state {
3637
struct drm_plane_state base;
@@ -48,6 +49,8 @@ struct dpu_plane_state {
4849

4950
bool needs_dirtyfb;
5051
unsigned int rotation;
52+
53+
struct dpu_hw_fmt_layout layout;
5154
};
5255

5356
#define to_dpu_plane_state(x) \

0 commit comments

Comments
 (0)