Skip to content

Commit dc0def6

Browse files
committed
drm/msm/dpu: move layout setup population out of dpu_plane_prepare_fb()
Move the call to dpu_format_populate_plane_sizes() to the atomic_check step, so that any issues with the FB layout can be reported as early as possible. At the same time move the call to dpu_format_populate_addrs() to dpu_plane_sspp_atomic_update(). This way the all layout management is performed only for the visible planes: the .prepare_fb callback is called for not visible planes too, so keeping dpu_format_populate_addrs in dpu_plane_prepare_fb() will require dpu_format_populate_plane_sizes() to be called for !visible planes too. Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/612251/ Link: https://lore.kernel.org/r/20240903-dpu-mode-config-width-v6-12-617e1ecc4b7a@linaro.org
1 parent 4f3ec1e commit dc0def6

1 file changed

Lines changed: 11 additions & 15 deletions

File tree

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

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -675,19 +675,6 @@ static int dpu_plane_prepare_fb(struct drm_plane *plane,
675675
}
676676
}
677677

678-
ret = dpu_format_populate_plane_sizes(new_state->fb, &pstate->layout);
679-
if (ret) {
680-
DPU_ERROR_PLANE(pdpu, "failed to get format plane sizes, %d\n", ret);
681-
if (pstate->aspace)
682-
msm_framebuffer_cleanup(new_state->fb, pstate->aspace,
683-
pstate->needs_dirtyfb);
684-
return ret;
685-
}
686-
687-
dpu_format_populate_addrs(pstate->aspace,
688-
new_state->fb,
689-
&pstate->layout);
690-
691678
return 0;
692679
}
693680

@@ -863,6 +850,12 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
863850
return -E2BIG;
864851
}
865852

853+
ret = dpu_format_populate_plane_sizes(new_plane_state->fb, &pstate->layout);
854+
if (ret) {
855+
DPU_ERROR_PLANE(pdpu, "failed to get format plane sizes, %d\n", ret);
856+
return ret;
857+
}
858+
866859
fmt = msm_framebuffer_format(new_plane_state->fb);
867860

868861
max_linewidth = pdpu->catalog->caps->max_linewidth;
@@ -1102,7 +1095,8 @@ static void dpu_plane_sspp_update_pipe(struct drm_plane *plane,
11021095
_dpu_plane_set_qos_remap(plane, pipe);
11031096
}
11041097

1105-
static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
1098+
static void dpu_plane_sspp_atomic_update(struct drm_plane *plane,
1099+
struct drm_plane_state *new_state)
11061100
{
11071101
struct dpu_plane *pdpu = to_dpu_plane(plane);
11081102
struct drm_plane_state *state = plane->state;
@@ -1123,6 +1117,8 @@ static void dpu_plane_sspp_atomic_update(struct drm_plane *plane)
11231117
pstate->needs_qos_remap |= (is_rt_pipe != pdpu->is_rt_pipe);
11241118
pdpu->is_rt_pipe = is_rt_pipe;
11251119

1120+
dpu_format_populate_addrs(pstate->aspace, new_state->fb, &pstate->layout);
1121+
11261122
DPU_DEBUG_PLANE(pdpu, "FB[%u] " DRM_RECT_FP_FMT "->crtc%u " DRM_RECT_FMT
11271123
", %p4cc ubwc %d\n", fb->base.id, DRM_RECT_FP_ARG(&state->src),
11281124
crtc->base.id, DRM_RECT_ARG(&state->dst),
@@ -1187,7 +1183,7 @@ static void dpu_plane_atomic_update(struct drm_plane *plane,
11871183
if (!new_state->visible) {
11881184
_dpu_plane_atomic_disable(plane);
11891185
} else {
1190-
dpu_plane_sspp_atomic_update(plane);
1186+
dpu_plane_sspp_atomic_update(plane, new_state);
11911187
}
11921188
}
11931189

0 commit comments

Comments
 (0)