drm/msm/dpu: add support for virtual planes
Only several SSPP blocks support such features as YUV output or scaling, thus different DRM planes have different features. Properly utilizing all planes requires the attention of the compositor, who should prefer simpler planes to YUV-supporting ones. Otherwise it is very easy to end up in a situation when all featureful planes are already allocated for simple windows, leaving no spare plane for YUV playback. To solve this problem make all planes virtual. Each plane is registered as if it supports all possible features, but then at the runtime during the atomic_check phase the driver selects backing SSPP block for each plane. As the planes are attached to the CRTC and not the encoder, the SSPP blocks are also allocated per CRTC ID (all other resources are currently allocated per encoder ID). This also matches the hardware requirement, where both rectangles of a single SSPP can only be used with the LM pair. Note, this does not provide support for using two different SSPP blocks for a single plane or using two rectangles of an SSPP to drive two planes. Each plane still gets its own SSPP and can utilize either a solo rectangle or both multirect rectangles depending on the resolution. Note #2: By default support for virtual planes is turned off and the driver still uses old code path with preallocated SSPP block for each plane. To enable virtual planes, pass 'msm.dpu_use_virtual_planes=1' kernel parameter. Reviewed-by:Abhinav Kumar <quic_abhinavk@quicinc.com> Signed-off-by:
Dmitry Baryshkov <dmitry.baryshkov@linaro.org> Patchwork: https://patchwork.freedesktop.org/patch/629022/ Link: https://lore.kernel.org/r/20241215-dpu-virtual-wide-v8-1-65221f213ce1@linaro.org
Showing
- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c 50 additions, 0 deletionsdrivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c 8 additions, 2 deletionsdrivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h 4 additions, 0 deletionsdrivers/gpu/drm/msm/disp/dpu1/dpu_kms.h
- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c 219 additions, 30 deletionsdrivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
- drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h 13 additions, 0 deletionsdrivers/gpu/drm/msm/disp/dpu1/dpu_plane.h
- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c 82 additions, 0 deletionsdrivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
- drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h 14 additions, 0 deletionsdrivers/gpu/drm/msm/disp/dpu1/dpu_rm.h
Loading