mbox series

[v4,0/7] Managing live video input format for ZynqMP DPSUB

Message ID 20240416-dp-live-fmt-v4-0-c7f379b7168e@amd.com (mailing list archive)
Headers show
Series Managing live video input format for ZynqMP DPSUB | expand

Message

Klymenko, Anatoliy April 16, 2024, 8:31 p.m. UTC
Implement live video input format setting for ZynqMP DPSUB.

ZynqMP DPSUB can operate in 2 modes: DMA-based and live.

In the live mode, DPSUB receives a live video signal from FPGA-based CRTC.
DPSUB acts as a DRM encoder bridge in such a scenario. To properly tune
into the incoming video signal, DPSUB should be programmed with the proper
media bus format. This patch series addresses this task.

Patch 1/7: Set the DPSUB layer mode of operation prior to enabling the
layer. Allows to use layer operational mode before its enablement.

Patch 2/7: Update some IP register defines.

Patch 3/7: Factor out some code into a helper function.

Patch 4/7: Announce supported input media bus formats via
drm_bridge_funcs.atomic_get_input_bus_fmts callback.

Patch 5/7: Minimize usage of a global flag. Minor improvement.

Patch 6/7: Program DPSUB live video input format based on selected bus
config in the new atomic bridge state.

Patch 7/7: New optional CRTC atomic helper proposal that will allow to
negotiate video signal format between CRTC and connected encoder.
Incorporate this callback into the DRM bridge format negotiation process.
Save negotiated output format in drm_crtc_state. Reference usage of this
API is available here:
https://github.com/onotole/linux/tree/dpsub-live-in

To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: Maxime Ripard <mripard@kernel.org>
To: Thomas Zimmermann <tzimmermann@suse.de>
To: David Airlie <airlied@gmail.com>
To: Daniel Vetter <daniel@ffwll.ch>
To: Michal Simek <michal.simek@amd.com>
To: Andrzej Hajda <andrzej.hajda@intel.com>
To: Neil Armstrong <neil.armstrong@linaro.org>
To: Robert Foss <rfoss@kernel.org>
To: Jonas Karlman <jonas@kwiboo.se>
To: Jernej Skrabec <jernej.skrabec@gmail.com>
To: Rob Herring <robh+dt@kernel.org>
To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
To: Conor Dooley <conor+dt@kernel.org>
To: Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-kernel@vger.kernel.org
Cc: devicetree@vger.kernel.org
Cc: linux-media@vger.kernel.org
Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com>

Changes in v4:
- Replace controversial reference driver patches with the private
  repository link.
- Split display layer format manipulation functions into 2 separate cases
  for diferet layer modes.
- Address misc review comments (typos, comments, etc.)

Link to v3: https://lore.kernel.org/r/20240321-dp-live-fmt-v3-0-d5090d796b7e@amd.com

Changes in v3:
- Add connected live layer helper
- Include reference DRM format in zynqmp_disp_format for live layerss.
- Add default bus format list for non-live case.
- Explain removal of redundant checks in the commit message.
- Minor fixes and improvements from review comments.

Link to v2: https://lore.kernel.org/r/20240312-dp-live-fmt-v2-0-a9c35dc5c50d@amd.com

Changes in v2:
- Factor out register defines update into separate patch.
- Add some improvements minimizing ithe usage of a global flag.
- Reuse existing format setting API instead of introducing new versions.
- Add warning around NULL check on new bridge state within atomic enable
  callback.
- Add drm_helper_crtc_select_output_bus_format() that wraps
  drm_crtc_helper_funcs.select_output_bus_format().
- Update API comments per review recommendations.
- Address some minor review comments.
- Add reference CRTC driver that demonstrates the usage of the proposed
  drm_crtc_helper_funcs.select_output_bus_format() API.

- Link to v1: https://lore.kernel.org/r/20240226-dp-live-fmt-v1-0-b78c3f69c9d8@amd.com

---
Anatoliy Klymenko (7):
      drm: xlnx: zynqmp_dpsub: Set layer mode during creation
      drm: xlnx: zynqmp_dpsub: Update live format defines
      drm: xlnx: zynqmp_dpsub: Add connected live layer helper
      drm: xlnx: zynqmp_dpsub: Anounce supported input formats
      drm: xlnx: zynqmp_dpsub: Minimize usage of global flag
      drm: xlnx: zynqmp_dpsub: Set input live format
      drm/atomic-helper: Add select_output_bus_format callback

 drivers/gpu/drm/drm_bridge.c             |  14 +-
 drivers/gpu/drm/drm_crtc_helper.c        |  38 +++++
 drivers/gpu/drm/xlnx/zynqmp_disp.c       | 231 +++++++++++++++++++++++++++----
 drivers/gpu/drm/xlnx/zynqmp_disp.h       |  17 +--
 drivers/gpu/drm/xlnx/zynqmp_disp_regs.h  |   8 +-
 drivers/gpu/drm/xlnx/zynqmp_dp.c         |  81 ++++++++---
 drivers/gpu/drm/xlnx/zynqmp_kms.c        |   2 +-
 include/drm/drm_crtc.h                   |  11 ++
 include/drm/drm_crtc_helper.h            |   5 +
 include/drm/drm_modeset_helper_vtables.h |  30 ++++
 10 files changed, 372 insertions(+), 65 deletions(-)
---
base-commit: bfa4437fd3938ae2e186e7664b2db65bb8775670
change-id: 20240226-dp-live-fmt-6415773b5a68

Best regards,

Comments

Conor Dooley April 17, 2024, 3:17 p.m. UTC | #1
On Tue, Apr 16, 2024 at 01:31:35PM -0700, Anatoliy Klymenko wrote:
> Implement live video input format setting for ZynqMP DPSUB.

> To: Conor Dooley <conor+dt@kernel.org>

If there's nothing dt related here anymore, you can drop me :)
Tomi Valkeinen April 24, 2024, 2:54 p.m. UTC | #2
Hi,

On 16/04/2024 23:31, Anatoliy Klymenko wrote:
> Implement live video input format setting for ZynqMP DPSUB.
> 
> ZynqMP DPSUB can operate in 2 modes: DMA-based and live.
> 
> In the live mode, DPSUB receives a live video signal from FPGA-based CRTC.
> DPSUB acts as a DRM encoder bridge in such a scenario. To properly tune
> into the incoming video signal, DPSUB should be programmed with the proper
> media bus format. This patch series addresses this task.
> 
> Patch 1/7: Set the DPSUB layer mode of operation prior to enabling the
> layer. Allows to use layer operational mode before its enablement.
> 
> Patch 2/7: Update some IP register defines.
> 
> Patch 3/7: Factor out some code into a helper function.
> 
> Patch 4/7: Announce supported input media bus formats via
> drm_bridge_funcs.atomic_get_input_bus_fmts callback.
> 
> Patch 5/7: Minimize usage of a global flag. Minor improvement.
> 
> Patch 6/7: Program DPSUB live video input format based on selected bus
> config in the new atomic bridge state.
> 
> Patch 7/7: New optional CRTC atomic helper proposal that will allow to
> negotiate video signal format between CRTC and connected encoder.
> Incorporate this callback into the DRM bridge format negotiation process.
> Save negotiated output format in drm_crtc_state. Reference usage of this
> API is available here:
> https://github.com/onotole/linux/tree/dpsub-live-in

The patches up to and including patch 6 look ready to me. I'll pick them 
up to drm-misc.

  Tomi


> To: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> To: Maxime Ripard <mripard@kernel.org>
> To: Thomas Zimmermann <tzimmermann@suse.de>
> To: David Airlie <airlied@gmail.com>
> To: Daniel Vetter <daniel@ffwll.ch>
> To: Michal Simek <michal.simek@amd.com>
> To: Andrzej Hajda <andrzej.hajda@intel.com>
> To: Neil Armstrong <neil.armstrong@linaro.org>
> To: Robert Foss <rfoss@kernel.org>
> To: Jonas Karlman <jonas@kwiboo.se>
> To: Jernej Skrabec <jernej.skrabec@gmail.com>
> To: Rob Herring <robh+dt@kernel.org>
> To: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
> To: Conor Dooley <conor+dt@kernel.org>
> To: Mauro Carvalho Chehab <mchehab@kernel.org>
> Cc: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
> Cc: dri-devel@lists.freedesktop.org
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-kernel@vger.kernel.org
> Cc: devicetree@vger.kernel.org
> Cc: linux-media@vger.kernel.org
> Signed-off-by: Anatoliy Klymenko <anatoliy.klymenko@amd.com>
> 
> Changes in v4:
> - Replace controversial reference driver patches with the private
>    repository link.
> - Split display layer format manipulation functions into 2 separate cases
>    for diferet layer modes.
> - Address misc review comments (typos, comments, etc.)
> 
> Link to v3: https://lore.kernel.org/r/20240321-dp-live-fmt-v3-0-d5090d796b7e@amd.com
> 
> Changes in v3:
> - Add connected live layer helper
> - Include reference DRM format in zynqmp_disp_format for live layerss.
> - Add default bus format list for non-live case.
> - Explain removal of redundant checks in the commit message.
> - Minor fixes and improvements from review comments.
> 
> Link to v2: https://lore.kernel.org/r/20240312-dp-live-fmt-v2-0-a9c35dc5c50d@amd.com
> 
> Changes in v2:
> - Factor out register defines update into separate patch.
> - Add some improvements minimizing ithe usage of a global flag.
> - Reuse existing format setting API instead of introducing new versions.
> - Add warning around NULL check on new bridge state within atomic enable
>    callback.
> - Add drm_helper_crtc_select_output_bus_format() that wraps
>    drm_crtc_helper_funcs.select_output_bus_format().
> - Update API comments per review recommendations.
> - Address some minor review comments.
> - Add reference CRTC driver that demonstrates the usage of the proposed
>    drm_crtc_helper_funcs.select_output_bus_format() API.
> 
> - Link to v1: https://lore.kernel.org/r/20240226-dp-live-fmt-v1-0-b78c3f69c9d8@amd.com
> 
> ---
> Anatoliy Klymenko (7):
>        drm: xlnx: zynqmp_dpsub: Set layer mode during creation
>        drm: xlnx: zynqmp_dpsub: Update live format defines
>        drm: xlnx: zynqmp_dpsub: Add connected live layer helper
>        drm: xlnx: zynqmp_dpsub: Anounce supported input formats
>        drm: xlnx: zynqmp_dpsub: Minimize usage of global flag
>        drm: xlnx: zynqmp_dpsub: Set input live format
>        drm/atomic-helper: Add select_output_bus_format callback
> 
>   drivers/gpu/drm/drm_bridge.c             |  14 +-
>   drivers/gpu/drm/drm_crtc_helper.c        |  38 +++++
>   drivers/gpu/drm/xlnx/zynqmp_disp.c       | 231 +++++++++++++++++++++++++++----
>   drivers/gpu/drm/xlnx/zynqmp_disp.h       |  17 +--
>   drivers/gpu/drm/xlnx/zynqmp_disp_regs.h  |   8 +-
>   drivers/gpu/drm/xlnx/zynqmp_dp.c         |  81 ++++++++---
>   drivers/gpu/drm/xlnx/zynqmp_kms.c        |   2 +-
>   include/drm/drm_crtc.h                   |  11 ++
>   include/drm/drm_crtc_helper.h            |   5 +
>   include/drm/drm_modeset_helper_vtables.h |  30 ++++
>   10 files changed, 372 insertions(+), 65 deletions(-)
> ---
> base-commit: bfa4437fd3938ae2e186e7664b2db65bb8775670
> change-id: 20240226-dp-live-fmt-6415773b5a68
> 
> Best regards,