mbox series

[v5,00/19] Add support for CDM over DP

Message ID 20240222194025.25329-1-quic_parellan@quicinc.com (mailing list archive)
Headers show
Series Add support for CDM over DP | expand

Message

Paloma Arellano Feb. 22, 2024, 7:39 p.m. UTC
The Chroma Down Sampling (CDM) block is a hardware component in the DPU
pipeline that includes a CSC block capable of converting RGB input from
the DPU to YUV data.

This block can be used with either HDMI, DP, or writeback interfaces.
This series adds support for the CDM block to be used with DP in
YUV420 mode format.

This series allows selection of the YUV420 format for monitors which support
certain resolutions only in YUV420 thus unblocking the validation of many
other resolutions which were previously filtered out if the connector did
not support YUV420.

This was validated using a DP connected monitor requiring the use of
YUV420 format.

This series is dependent on [1], [2], and [3]:
[1] https://patchwork.freedesktop.org/series/118831/
[2] https://patchwork.freedesktop.org/series/129395/
[3] https://patchwork.freedesktop.org/series/129864/

Changes in v5:
	- Slightly modify use of drm_dp_vsc_sdp_pack()
	- Remove dp_catalog NULL checks
	- Modify dp_utils_pack_sdp_header() to cleanly pack the header
	  buffer
	- Remove the dp_utils_pack_vsc_sdp() function and only call
	  drm_dp_vsc_sdp_pack() in dp_panel_setup_vsc_sdp_yuv_420()
	- To clearly show the relationship between the header buffer and
	  vsc_sdp struct, move dp_utils_pack_sdp_header() inside of
	  dp_catalog_panel_send_vsc_sdp()

Changes in v4:
	- Use dp_utils_pack_sdp_header() to pack the SDP header and
	  parity bytes into a buffer
	- Use this buffer when writing the VSC SDP data in
	  dp_catalog_panel_send_vsc_sdp() and write to all the
	  MMSS_DP_GENERIC0 registers
	- Clear up that DP_MAINLINK_CTRL_FLUSH_MODE register requires
	  the use of bits [24:23]
	- Modify certain macros to explicitly set their values in the
	  bits of DP_MAINLINK_CTRL_FLUSH_MODE_MASK
	- Remove hw_cdm check in dpu_encoder_needs_periph_flush() and
	  dpu_encoder_phys_vid_enable()

Changes in v3:
	- Change ordering of the header byte macros in dp_utils.h
	- Create a new struct, msm_dp_sdp_with_parity
 	- Utilize drm_dp_vsc_sdp_pack() from a new added dependency of
	  series [3] to pack the VSC SDP data into the new
	  msm_dp_sdp_with_parity struct instead of packing only for
	  YUV420
	- Modify dp_catalog_panel_send_vsc_sdp() so that it sends the VSC SDP data
	  using the new msm_dp_sdp_with_parity struct
	- Clear up that the DP_MAINLINK_FLUSH_MODE_SDE_PERIPH_UPDATE macro is setting
	  multiple bits and not just one
	- Move the connector's ycbcr_420_allowed parameter so it is no longer
	  dependent on if the dp_display is not eDP

Changes in v2:
	- Minor formatting changes throughout
	- Move 'fixes' patch to the top
	- Move VSC SDP support check API from dp_panel.c to drm_dp_helper.c
	- Create a separate patch for modifying the dimensions for CDM setup to be
	  non-WB specific
	- Remove a patch that modified the INTF_CONFIG2 register in favor of having
	  this series be dependent on [2]
	- Separate configuration ctrl programming from clock related programming into
	  two patches
	- Add a VSC SDP check in dp_bridge_mode_valid()
	- Move parity calculation functions to new files dp_utils.c and dp_utils.h
	- Remove dp_catalog_hw_revision() changes and utilize the original version of
	  the function when checking the DP hardware version
	- Create separate packing and programming functions for the VSC SDP
	- Make the packing header bytes function generic so it can be used with
	  dp_audio.c
	- Create two separate enable/disable VSC SDP functions instead of having one
	  with the ability to do both
	- Move timing engine programming to a separate patch from original encoder
	  programming patch
	- Move update_pending_flush_periph() code to be in the same patch as the
	  encoder programming
	- Create new API's to check if the dpu encoder needs a peripheral flush
	- Allow YUV420 modes for the DP connector when there's a CDM block available
	  instead of checking if VSC SDP is supported

Kuogee Hsieh (1):
  drm/msm/dpu: add support of new peripheral flush mechanism

Paloma Arellano (18):
  drm/msm/dpu: allow certain formats for CDM for DP
  drm/msm/dpu: add division of drm_display_mode's hskew parameter
  drm/msm/dpu: pass mode dimensions instead of fb size in CDM setup
  drm/msm/dpu: allow dpu_encoder_helper_phys_setup_cdm to work for DP
  drm/msm/dpu: move dpu_encoder_helper_phys_setup_cdm to dpu_encoder
  drm/msm/dp: rename wide_bus_en to wide_bus_supported
  drm/msm/dp: store mode YUV420 information to be used by rest of DP
  drm/msm/dp: check if VSC SDP is supported in DP programming
  drm/msm/dpu: move widebus logic to its own API
  drm/msm/dp: program config ctrl for YUV420 over DP
  drm/msm/dp: change clock related programming for YUV420 over DP
  drm/msm/dp: move parity calculation to dp_utils
  drm/msm/dp: add VSC SDP support for YUV420 over DP
  drm/msm/dp: enable SDP and SDE periph flush update
  drm/msm/dpu: modify encoder programming for CDM over DP
  drm/msm/dpu: modify timing engine programming for YUV420 over DP
  drm/msm/dpu: reserve CDM blocks for DP if mode is YUV420
  drm/msm/dp: allow YUV420 mode for DP connector when CDM available

 drivers/gpu/drm/msm/Makefile                  |   3 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c   | 164 +++++++++++++++---
 drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h   |   4 +
 .../gpu/drm/msm/disp/dpu1/dpu_encoder_phys.h  |  26 ++-
 .../drm/msm/disp/dpu1/dpu_encoder_phys_vid.c  |  30 +++-
 .../drm/msm/disp/dpu1/dpu_encoder_phys_wb.c   | 100 +----------
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_cdm.c    |   2 +-
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c    |  17 ++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.h    |  10 ++
 drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c       |   4 +-
 drivers/gpu/drm/msm/dp/dp_audio.c             | 101 ++---------
 drivers/gpu/drm/msm/dp/dp_catalog.c           | 115 +++++++++++-
 drivers/gpu/drm/msm/dp/dp_catalog.h           |   9 +-
 drivers/gpu/drm/msm/dp/dp_ctrl.c              |  17 +-
 drivers/gpu/drm/msm/dp/dp_display.c           |  82 ++++++---
 drivers/gpu/drm/msm/dp/dp_drm.c               |   6 +-
 drivers/gpu/drm/msm/dp/dp_drm.h               |   3 +-
 drivers/gpu/drm/msm/dp/dp_panel.c             |  53 ++++++
 drivers/gpu/drm/msm/dp/dp_panel.h             |   2 +
 drivers/gpu/drm/msm/dp/dp_reg.h               |   9 +
 drivers/gpu/drm/msm/dp/dp_utils.c             |  98 +++++++++++
 drivers/gpu/drm/msm/dp/dp_utils.h             |  36 ++++
 drivers/gpu/drm/msm/msm_drv.h                 |  22 ++-
 23 files changed, 672 insertions(+), 241 deletions(-)
 create mode 100644 drivers/gpu/drm/msm/dp/dp_utils.c
 create mode 100644 drivers/gpu/drm/msm/dp/dp_utils.h

Comments

Dmitry Baryshkov March 5, 2024, 12:28 a.m. UTC | #1
On Thu, 22 Feb 2024 11:39:45 -0800, Paloma Arellano wrote:
> The Chroma Down Sampling (CDM) block is a hardware component in the DPU
> pipeline that includes a CSC block capable of converting RGB input from
> the DPU to YUV data.
> 
> This block can be used with either HDMI, DP, or writeback interfaces.
> This series adds support for the CDM block to be used with DP in
> YUV420 mode format.
> 
> [...]

Applied, thanks!

[01/19] drm/msm/dpu: allow certain formats for CDM for DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/32b6ff95b912
[02/19] drm/msm/dpu: add division of drm_display_mode's hskew parameter
        https://gitlab.freedesktop.org/lumag/msm/-/commit/551ee0f21099
[03/19] drm/msm/dpu: pass mode dimensions instead of fb size in CDM setup
        https://gitlab.freedesktop.org/lumag/msm/-/commit/d6e547c091d8
[04/19] drm/msm/dpu: allow dpu_encoder_helper_phys_setup_cdm to work for DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/7cde7ce5be3e
[05/19] drm/msm/dpu: move dpu_encoder_helper_phys_setup_cdm to dpu_encoder
        https://gitlab.freedesktop.org/lumag/msm/-/commit/0ab07bb96826
[06/19] drm/msm/dp: rename wide_bus_en to wide_bus_supported
        https://gitlab.freedesktop.org/lumag/msm/-/commit/3ed77f333bb0
[07/19] drm/msm/dp: store mode YUV420 information to be used by rest of DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/5b30d1cbd4fb
[08/19] drm/msm/dp: check if VSC SDP is supported in DP programming
        https://gitlab.freedesktop.org/lumag/msm/-/commit/ab2f8603e22e
[09/19] drm/msm/dpu: move widebus logic to its own API
        https://gitlab.freedesktop.org/lumag/msm/-/commit/1cfc64a6ea55
[10/19] drm/msm/dp: program config ctrl for YUV420 over DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/683d374582e3
[11/19] drm/msm/dp: change clock related programming for YUV420 over DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/6db6e5606576
[12/19] drm/msm/dp: move parity calculation to dp_utils
        https://gitlab.freedesktop.org/lumag/msm/-/commit/09b27a482a18
[13/19] drm/msm/dp: add VSC SDP support for YUV420 over DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/55fb8ffc1802
[14/19] drm/msm/dpu: add support of new peripheral flush mechanism
        https://gitlab.freedesktop.org/lumag/msm/-/commit/64f7b81f0358
[15/19] drm/msm/dp: enable SDP and SDE periph flush update
        https://gitlab.freedesktop.org/lumag/msm/-/commit/21497a463347
[16/19] drm/msm/dpu: modify encoder programming for CDM over DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/b40c8377d792
[17/19] drm/msm/dpu: modify timing engine programming for YUV420 over DP
        https://gitlab.freedesktop.org/lumag/msm/-/commit/57d6ca4c1917
[18/19] drm/msm/dpu: reserve CDM blocks for DP if mode is YUV420
        https://gitlab.freedesktop.org/lumag/msm/-/commit/984809d85007
[19/19] drm/msm/dp: allow YUV420 mode for DP connector when CDM available
        https://gitlab.freedesktop.org/lumag/msm/-/commit/ee2fcc0f514b

Best regards,