mbox series

[v2,00/22] drm/msm/dpu: switch dpu_plane to be virtual

Message ID 20210705012115.4179824-1-dmitry.baryshkov@linaro.org
Headers show
Series drm/msm/dpu: switch dpu_plane to be virtual | expand

Message

Dmitry Baryshkov July 5, 2021, 1:20 a.m. UTC
As discussed on IRC, change dpu_plane implementation to be virtual:
register unified planes and select backing SSPP block at runtime.

Use msm.dpu_use_virtual_planes=1 to enable usage of virtual planes
rather than statically allocated SSPPs at the plane registration.

Patches 1-9 move state variables from struct dpu_plane onto the stack
allocation. State should not be a part of struct dpu_plane anyway.

Patches 10-18 make additional changes to plane code, reworking check,
debugfs, dropping old multirec support, which results in patch 19 adding
support for virtual planes per se.

Patches 20-22 demonstrate my main goal behind reworking dpu_plane
support. They change dpu_plane to automatically use one of SSPP block
features - multirec, an ability to display two unscaled RGB rectangles
using single SSPP block. This allows us to double the amount of created
planes. If the user tries to enable more planes than actually supported
by the underlying SSPP blocks, atomic_check code would return an error.

As you can see, this patchset is not atomic, so different patches can go
separately.

Changes since v1:
 - Add multirec implementation
 - Added msm.dpu_use_virtual_planes kernel parameter instead of using
   compile time switch
 - Changed code to always reallocate SSPPs in the CRTC atomic check to
   let the kernel pick up the best multirec config. This can be
   optimized later.
 - Rework RM SSPP API to always receive plane id
 - Removed scaler_cfg, pixel_ext and cdp_cfg from struct dpu_plane_state
 - Made _dpu_scaler_setup() call sspp's setup_scaler and setup_pe
 - Removed dpu_csc_cfg from dpu_plane

The following changes since commit e88bbc91849b2bf57683119c339e52916d34433f:

  Revert "drm/msm/mdp5: provide dynamic bandwidth management" (2021-06-23 14:06:20 -0700)

are available in the Git repository at:

  https://git.linaro.org/people/dmitry.baryshkov/kernel.git dpu-multirec-2

for you to fetch changes up to 19f6afd40097d4c826e56b8f4a8cbd807f7b61f6:

  drm/msm/dpu: add multirect support (2021-07-05 04:04:50 +0300)

----------------------------------------------------------------
Dmitry Baryshkov (22):
      drm/msm/dpu: move LUT levels out of QOS config
      drm/msm/dpu: remove pipe_qos_cfg from struct dpu_plane
      drm/msm/dpu: drop pipe_name from struct dpu_plane
      drm/msm/dpu: remove stage_cfg from struct dpu_crtc
      drm/msm/dpu: rip out master planes support
      drm/msm/dpu: move dpu_hw_pipe_cfg out of struct dpu_plane
      drm/msm/dpu: drop scaler config from plane state
      drm/msm/dpu: drop dpu_csc_cfg from dpu_plane
      drm/msm/dpu: remove dpu_hw_pipe_cdp_cfg from dpu_plane
      drm/msm/dpu: don't cache pipe->cap->features in dpu_plane
      drm/msm/dpu: don't cache pipe->cap->sblk in dpu_plane
      drm/msm/dpu: rip out debugfs support from dpu_plane
      drm/msm/dpu: drop src_split and multirect check from dpu_crtc_atomic_check
      drm/msm/dpu: add list of supported formats to the DPU caps
      drm/msm/dpu: simplify DPU_SSPP features checks
      drm/msm/dpu: do not limit the zpos property
      drm/msm/dpu: add support for SSPP allocation to RM
      drm/msm/dpu: move pipe_hw to dpu_plane_state
      drm/msm/dpu: add support for virtualized planes
      drm/msm/dpu: fix smart dma support
      drm/msm/dpu: fix CDP setup to account for multirect index
      drm/msm/dpu: add multirect support

 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       | 261 +++-----
 drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h       |   2 -
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  20 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |  20 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c    |  41 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h    |  52 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c    |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h    |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        | 234 ++++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h        |  70 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      | 851 +++++++++++--------------
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h      |  75 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c         |  81 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h         |   6 +
 14 files changed, 793 insertions(+), 924 deletions(-)

Comments

Abhinav Kumar Sept. 30, 2021, 2:19 a.m. UTC | #1
Hi Dmitry

On 2021-07-04 18:20, Dmitry Baryshkov wrote:
> As discussed on IRC, change dpu_plane implementation to be virtual:

> register unified planes and select backing SSPP block at runtime.

> 

> Use msm.dpu_use_virtual_planes=1 to enable usage of virtual planes

> rather than statically allocated SSPPs at the plane registration.

> 

> Patches 1-9 move state variables from struct dpu_plane onto the stack

> allocation. State should not be a part of struct dpu_plane anyway.

> 

> Patches 10-18 make additional changes to plane code, reworking check,

> debugfs, dropping old multirec support, which results in patch 19 

> adding

> support for virtual planes per se.

> 

> Patches 20-22 demonstrate my main goal behind reworking dpu_plane

> support. They change dpu_plane to automatically use one of SSPP block

> features - multirec, an ability to display two unscaled RGB rectangles

> using single SSPP block. This allows us to double the amount of created

> planes. If the user tries to enable more planes than actually supported

> by the underlying SSPP blocks, atomic_check code would return an error.

> 

> As you can see, this patchset is not atomic, so different patches can 

> go

> separately.


I am half way through this series and have finished checking patches 
1-12
I am okay with patches 1-4, 6-12. Its a reasonable cleanup to make the 
dpu_plane struct lighter.
I need a little more time with the rest as I am comparing the downstream 
solution against yours.

As you mentioned, this patchset is not atomic, hence can you break it up 
like
-> cleanup of dpu_plane struct in one series
-> removal of current multirect and current src split which will include 
patch 5 as well

So that the first series can go through and it gives us a little more 
time to check the second
series.

Thanks

Abhinav

> 

> Changes since v1:

>  - Add multirec implementation

>  - Added msm.dpu_use_virtual_planes kernel parameter instead of using

>    compile time switch

>  - Changed code to always reallocate SSPPs in the CRTC atomic check to

>    let the kernel pick up the best multirec config. This can be

>    optimized later.

>  - Rework RM SSPP API to always receive plane id

>  - Removed scaler_cfg, pixel_ext and cdp_cfg from struct 

> dpu_plane_state

>  - Made _dpu_scaler_setup() call sspp's setup_scaler and setup_pe

>  - Removed dpu_csc_cfg from dpu_plane

> 

> The following changes since commit 

> e88bbc91849b2bf57683119c339e52916d34433f:

> 

>   Revert "drm/msm/mdp5: provide dynamic bandwidth management"

> (2021-06-23 14:06:20 -0700)

> 

> are available in the Git repository at:

> 

>   https://git.linaro.org/people/dmitry.baryshkov/kernel.git 

> dpu-multirec-2

> 

> for you to fetch changes up to 

> 19f6afd40097d4c826e56b8f4a8cbd807f7b61f6:

> 

>   drm/msm/dpu: add multirect support (2021-07-05 04:04:50 +0300)

> 

> ----------------------------------------------------------------

> Dmitry Baryshkov (22):

>       drm/msm/dpu: move LUT levels out of QOS config

>       drm/msm/dpu: remove pipe_qos_cfg from struct dpu_plane

>       drm/msm/dpu: drop pipe_name from struct dpu_plane

>       drm/msm/dpu: remove stage_cfg from struct dpu_crtc

>       drm/msm/dpu: rip out master planes support

>       drm/msm/dpu: move dpu_hw_pipe_cfg out of struct dpu_plane

>       drm/msm/dpu: drop scaler config from plane state

>       drm/msm/dpu: drop dpu_csc_cfg from dpu_plane

>       drm/msm/dpu: remove dpu_hw_pipe_cdp_cfg from dpu_plane

>       drm/msm/dpu: don't cache pipe->cap->features in dpu_plane

>       drm/msm/dpu: don't cache pipe->cap->sblk in dpu_plane

>       drm/msm/dpu: rip out debugfs support from dpu_plane

>       drm/msm/dpu: drop src_split and multirect check from 

> dpu_crtc_atomic_check

>       drm/msm/dpu: add list of supported formats to the DPU caps

>       drm/msm/dpu: simplify DPU_SSPP features checks

>       drm/msm/dpu: do not limit the zpos property

>       drm/msm/dpu: add support for SSPP allocation to RM

>       drm/msm/dpu: move pipe_hw to dpu_plane_state

>       drm/msm/dpu: add support for virtualized planes

>       drm/msm/dpu: fix smart dma support

>       drm/msm/dpu: fix CDP setup to account for multirect index

>       drm/msm/dpu: add multirect support

> 

>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c       | 261 +++-----

>  drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.h       |   2 -

>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  20 +-

>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h |  20 +-

>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.c    |  41 +-

>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_sspp.h    |  52 +-

>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.c    |   2 +-

>  drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h    |   2 +-

>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c        | 234 ++++---

>  drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h        |  70 +-

>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      | 851 

> +++++++++++--------------

>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.h      |  75 +--

>  drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c         |  81 +++

>  drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h         |   6 +

>  14 files changed, 793 insertions(+), 924 deletions(-)

> 

> _______________________________________________

> Freedreno mailing list

> Freedreno@lists.freedesktop.org

> https://lists.freedesktop.org/mailman/listinfo/freedreno