mbox series

[v4,00/15] Add CDM support for MSM writeback

Message ID 20231212205254.12422-1-quic_abhinavk@quicinc.com (mailing list archive)
Headers show
Series Add CDM support for MSM writeback | expand

Message

Abhinav Kumar Dec. 12, 2023, 8:52 p.m. UTC
Chroma Down Sampling (CDM) block is a hardware block in the DPU pipeline
which among other things has a CSC block that can convert RGB input
from the DPU to YUV data.

This block can be used with either HDMI, DP or writeback interface.

In this series, lets first add the support for CDM block to be used
with writeback and then follow-up with support for other interfaces such
as DP.

This was validated by adding support to pass custom output format to the
IGT's kms_writeback test-case, specifically only for the output dump
test-case [1].

The usage for this is:

./kms_writeback -d -f <name of the DRM YUV fmt from igt_fb>

So for NV12, this can be verified with the below command:

./kms_writeback -d -f NV12

[1] : https://patchwork.freedesktop.org/series/122125/

changes in v4:
	- change the debug message when drm_atomic_helper_check_wb_connector_state()
	  returns an error
	- used FIELD_PREP() for dpu_hw_cdm_setup_cdwn() operations
	- change to lowercase hex in dpu_hw_cdm_bind_pingpong_blk()
	- move disable assignment inside else in dpu_hw_cdm_bind_pingpong_blk()

changes in v3:
	- rebase on top of msm-next
	- drop the extra wrapper and export the CSC matrices directly
	- fixes in commit text as requested
	- fixes for kbot errors as reported
	- drop "enable" parameter from bind_pingpong_blk() as we can
	  just use PINGPONG_NONE for disable cases
	  - squash cdm changes in encoder cleanup to the change which allocates cdm
 
changes in v2:
	- rebased on top of current msm-next-lumag
	- fix commit text of some of the patches
	- move csc matrices to dpu_hw_util as they span across DPU
	- move cdm blk define to dpu_hw_catalog as its common across chipsets
	- remove bit magic in dpu_hw_cdm with relevant defines
	- use drmm_kzalloc instead of kzalloc/free
	- protect bind_pingpong_blk with core_rev check
	- drop setup_csc_data() and setup_cdwn() ops as they
	  are merged into enable()
	- protect bind_pingpong_blk with core_rev check
	- drop setup_csc_data() and setup_cdwn() ops as they
	  are merged into enable()
	- move needs_cdm to topology struct
	- call update_pending_flush_cdm even when bind_pingpong_blk
	  is not present
	- drop usage of setup_csc_data() and setup_cdwn() cdm ops
	  as they both have been merged into enable()
	- drop reduntant hw_cdm and hw_pp checks
	- drop fb related checks from dpu_encoder::atomic_mode_set()
	- introduce separate wb2_format arrays for rgb and yuv

Abhinav Kumar (15):
  drm/msm/dpu: add formats check for writeback encoder
  drm/msm/dpu: rename dpu_encoder_phys_wb_setup_cdp to match its
    functionality
  drm/msm/dpu: fix writeback programming for YUV cases
  drm/msm/dpu: move csc matrices to dpu_hw_util
  drm/msm/dpu: add cdm blocks to sc7280 dpu_hw_catalog
  drm/msm/dpu: add cdm blocks to sm8250 dpu_hw_catalog
  drm/msm/dpu: add dpu_hw_cdm abstraction for CDM block
  drm/msm/dpu: add cdm blocks to RM
  drm/msm/dpu: add support to allocate CDM from RM
  drm/msm/dpu: add CDM related logic to dpu_hw_ctl layer
  drm/msm/dpu: add an API to setup the CDM block for writeback
  drm/msm/dpu: plug-in the cdm related bits to writeback setup
  drm/msm/dpu: reserve cdm blocks for writeback in case of YUV output
  drm/msm/dpu: introduce separate wb2_format arrays for rgb and yuv
  drm/msm/dpu: add cdm blocks to dpu snapshot

 drivers/gpu/drm/msm/Makefile                  |   1 +
 .../msm/disp/dpu1/catalog/dpu_10_0_sm8650.h   |   4 +-
 .../msm/disp/dpu1/catalog/dpu_6_0_sm8250.h    |   5 +-
 .../msm/disp/dpu1/catalog/dpu_6_2_sc7180.h    |   4 +-
 .../msm/disp/dpu1/catalog/dpu_7_2_sc7280.h    |   5 +-
 .../msm/disp/dpu1/catalog/dpu_9_0_sm8550.h    |   4 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   |  37 +++
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h  |   6 +
 .../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c   | 114 +++++++-
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c    |  47 +++-
 .../gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h    |  13 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c    | 245 ++++++++++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.h    | 142 ++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c    |  33 +++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h    |  12 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_mdss.h   |   7 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_util.h   |  44 ++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_wb.c     |   3 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c       |   4 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h       |   1 +
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c     |  31 +--
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c        |  51 +++-
 drivers/gpu/drm/msm/disp/dpu1/dpu_rm.h        |   2 +
 drivers/gpu/drm/msm/msm_drv.h                 |   2 +
 24 files changed, 771 insertions(+), 46 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c
 create mode 100644 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.h

Comments

Dmitry Baryshkov Dec. 13, 2023, 12:37 a.m. UTC | #1
On Tue, 12 Dec 2023 12:52:38 -0800, Abhinav Kumar wrote:
> Chroma Down Sampling (CDM) block is a hardware block in the DPU pipeline
> which among other things has a CSC block that can convert RGB input
> from the DPU to YUV data.
> 
> This block can be used with either HDMI, DP or writeback interface.
> 
> In this series, lets first add the support for CDM block to be used
> with writeback and then follow-up with support for other interfaces such
> as DP.
> 
> [...]

Applied, thanks!

[01/15] drm/msm/dpu: add formats check for writeback encoder
        https://gitlab.freedesktop.org/lumag/msm/-/commit/100a72bdb03f
[02/15] drm/msm/dpu: rename dpu_encoder_phys_wb_setup_cdp to match its functionality
        https://gitlab.freedesktop.org/lumag/msm/-/commit/e1e59787d7c8
[03/15] drm/msm/dpu: fix writeback programming for YUV cases
        https://gitlab.freedesktop.org/lumag/msm/-/commit/545979247e5d
[04/15] drm/msm/dpu: move csc matrices to dpu_hw_util
        https://gitlab.freedesktop.org/lumag/msm/-/commit/636d1d4dfb24
[05/15] drm/msm/dpu: add cdm blocks to sc7280 dpu_hw_catalog
        https://gitlab.freedesktop.org/lumag/msm/-/commit/f8bc2bc3a673
[06/15] drm/msm/dpu: add cdm blocks to sm8250 dpu_hw_catalog
        https://gitlab.freedesktop.org/lumag/msm/-/commit/9b61ea803a9a
[07/15] drm/msm/dpu: add dpu_hw_cdm abstraction for CDM block
        https://gitlab.freedesktop.org/lumag/msm/-/commit/faa729ee2e48
[08/15] drm/msm/dpu: add cdm blocks to RM
        https://gitlab.freedesktop.org/lumag/msm/-/commit/059bffe7a88d
[09/15] drm/msm/dpu: add support to allocate CDM from RM
        https://gitlab.freedesktop.org/lumag/msm/-/commit/a324c046bb7d
[10/15] drm/msm/dpu: add CDM related logic to dpu_hw_ctl layer
        https://gitlab.freedesktop.org/lumag/msm/-/commit/d7a329684b77
[11/15] drm/msm/dpu: add an API to setup the CDM block for writeback
        https://gitlab.freedesktop.org/lumag/msm/-/commit/055376f936e8
[12/15] drm/msm/dpu: plug-in the cdm related bits to writeback setup
        https://gitlab.freedesktop.org/lumag/msm/-/commit/1364a52a9a77
[13/15] drm/msm/dpu: reserve cdm blocks for writeback in case of YUV output
        https://gitlab.freedesktop.org/lumag/msm/-/commit/8142ee18e902
[14/15] drm/msm/dpu: introduce separate wb2_format arrays for rgb and yuv
        https://gitlab.freedesktop.org/lumag/msm/-/commit/a074ca909811
[15/15] drm/msm/dpu: add cdm blocks to dpu snapshot
        https://gitlab.freedesktop.org/lumag/msm/-/commit/c86495429c4a

Best regards,