Skip to content

Commit 31f7148

Browse files
committed
drm/msm/dpu: move pstate->pipe initialization to dpu_plane_atomic_check
In preparation for virtualized planes support, move pstate->pipe initialization from dpu_plane_reset() to dpu_plane_atomic_check(). In case of virtual planes the plane's pipe will not be known up to the point of atomic_check() callback. Signed-off-by: Dmitry Baryshkov <[email protected]> Reviewed-by: Abhinav Kumar <[email protected]> Patchwork: https://patchwork.freedesktop.org/patch/621477/ Link: https://lore.kernel.org/r/[email protected]
1 parent 5002444 commit 31f7148

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

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

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -797,13 +797,22 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
797797
uint32_t max_linewidth;
798798
unsigned int rotation;
799799
uint32_t supported_rotations;
800-
const struct dpu_sspp_cfg *pipe_hw_caps = pstate->pipe.sspp->cap;
801-
const struct dpu_sspp_sub_blks *sblk = pstate->pipe.sspp->cap->sblk;
800+
const struct dpu_sspp_cfg *pipe_hw_caps;
801+
const struct dpu_sspp_sub_blks *sblk;
802802

803803
if (new_plane_state->crtc)
804804
crtc_state = drm_atomic_get_new_crtc_state(state,
805805
new_plane_state->crtc);
806806

807+
pipe->sspp = dpu_rm_get_sspp(&kms->rm, pdpu->pipe);
808+
r_pipe->sspp = NULL;
809+
810+
if (!pipe->sspp)
811+
return -EINVAL;
812+
813+
pipe_hw_caps = pipe->sspp->cap;
814+
sblk = pipe->sspp->cap->sblk;
815+
807816
min_scale = FRAC_16_16(1, sblk->maxupscale);
808817
ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state,
809818
min_scale,
@@ -820,7 +829,6 @@ static int dpu_plane_atomic_check(struct drm_plane *plane,
820829
pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
821830
r_pipe->multirect_index = DPU_SSPP_RECT_SOLO;
822831
r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE;
823-
r_pipe->sspp = NULL;
824832

825833
pstate->stage = DPU_STAGE_0 + pstate->base.normalized_zpos;
826834
if (pstate->stage >= pdpu->catalog->caps->max_mixer_blendstages) {
@@ -1286,7 +1294,6 @@ static void dpu_plane_reset(struct drm_plane *plane)
12861294
{
12871295
struct dpu_plane *pdpu;
12881296
struct dpu_plane_state *pstate;
1289-
struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane);
12901297

12911298
if (!plane) {
12921299
DPU_ERROR("invalid plane\n");
@@ -1308,16 +1315,6 @@ static void dpu_plane_reset(struct drm_plane *plane)
13081315
return;
13091316
}
13101317

1311-
/*
1312-
* Set the SSPP here until we have proper virtualized DPU planes.
1313-
* This is the place where the state is allocated, so fill it fully.
1314-
*/
1315-
pstate->pipe.sspp = dpu_rm_get_sspp(&dpu_kms->rm, pdpu->pipe);
1316-
pstate->pipe.multirect_index = DPU_SSPP_RECT_SOLO;
1317-
pstate->pipe.multirect_mode = DPU_SSPP_MULTIRECT_NONE;
1318-
1319-
pstate->r_pipe.sspp = NULL;
1320-
13211318
__drm_atomic_helper_plane_reset(plane, &pstate->base);
13221319
}
13231320

0 commit comments

Comments
 (0)