Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <dmitry.baryshkov@linaro.org>
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
Patchwork: https://patchwork.freedesktop.org/patch/621477/
Link: https://lore.kernel.org/r/20241025-dpu-virtual-wide-v6-2-0310fd519765@linaro.org

+11 -14
+11 -14
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
··· 797 797 uint32_t max_linewidth; 798 798 unsigned int rotation; 799 799 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; 802 802 803 803 if (new_plane_state->crtc) 804 804 crtc_state = drm_atomic_get_new_crtc_state(state, 805 805 new_plane_state->crtc); 806 + 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; 806 815 807 816 min_scale = FRAC_16_16(1, sblk->maxupscale); 808 817 ret = drm_atomic_helper_check_plane_state(new_plane_state, crtc_state, ··· 829 820 pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE; 830 821 r_pipe->multirect_index = DPU_SSPP_RECT_SOLO; 831 822 r_pipe->multirect_mode = DPU_SSPP_MULTIRECT_NONE; 832 - r_pipe->sspp = NULL; 833 823 834 824 pstate->stage = DPU_STAGE_0 + pstate->base.normalized_zpos; 835 825 if (pstate->stage >= pdpu->catalog->caps->max_mixer_blendstages) { ··· 1294 1286 { 1295 1287 struct dpu_plane *pdpu; 1296 1288 struct dpu_plane_state *pstate; 1297 - struct dpu_kms *dpu_kms = _dpu_plane_get_kms(plane); 1298 1289 1299 1290 if (!plane) { 1300 1291 DPU_ERROR("invalid plane\n"); ··· 1314 1307 DPU_ERROR_PLANE(pdpu, "failed to allocate state\n"); 1315 1308 return; 1316 1309 } 1317 - 1318 - /* 1319 - * Set the SSPP here until we have proper virtualized DPU planes. 1320 - * This is the place where the state is allocated, so fill it fully. 1321 - */ 1322 - pstate->pipe.sspp = dpu_rm_get_sspp(&dpu_kms->rm, pdpu->pipe); 1323 - pstate->pipe.multirect_index = DPU_SSPP_RECT_SOLO; 1324 - pstate->pipe.multirect_mode = DPU_SSPP_MULTIRECT_NONE; 1325 - 1326 - pstate->r_pipe.sspp = NULL; 1327 1310 1328 1311 __drm_atomic_helper_plane_reset(plane, &pstate->base); 1329 1312 }