mbox series

[RFC,00/19] drm: Add support for bus-format negotiation

Message ID 20190808151150.16336-1-boris.brezillon@collabora.com (mailing list archive)
Headers show
Series drm: Add support for bus-format negotiation | expand

Message

Boris Brezillon Aug. 8, 2019, 3:11 p.m. UTC
Hello,

This patch series aims at adding support for runtime bus-format
negotiation between all elements of the
'encoder -> bridges -> connector/display' section of the pipeline.

In order to support that, we need drm bridges to fully take part in the
atomic state validation process, which requires addition of a
drm_bridge_state + a new drm_bridge_funcs.atomic_check() hook (patches
10 - 12).
Once those basic building blocks are in place, we can add new helpers
to facilitate bus-format negotiation between element of the encoder
chain (patches 13 - 14).

Patches 1 to 9 are preparatory patches for patches 10 - 14. Patch 1 is
needed to allow inclusion of drm_atomic.h from drm_bridge.h, which we
need to make drm_bridge/drm_bridge_state inherit from
drm_private_obj/drm_private_obj_state.
Patches 2 to 9 are about transitioning the bridge chain to a
double-linked list, which is needed to allow bridge elements to
negotiate with the next and prev element in the pipeline.
Most of those patches can be applied independently of the rest of the
series, especially patches 2 - 7 which I think fix some misuses of the
drm_bridge API.

To finish, patches 15 - 17 demonstrate how bus-format negotiation can
be done, and patches 18 - 19 were needed for the use case I used to test
whole solution.

As you've noticed, this is an RFC, so any kind of feedback is welcome
(apart from checkpatch reports :P).

Thanks,

Boris

Boris Brezillon (19):
  drm: Stop including drm_bridge.h from drm_crtc.h
  drm: Support custom encoder/bridge enable/disable sequences officially
  drm/vc4: Get rid of the dsi->bridge field
  drm/exynos: Get rid of exynos_dsi->out_bridge
  drm/exynos: Don't reset bridge->next
  drm/bridge: Create drm_bridge_chain_xx() wrappers
  drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder
  drm/bridge: Introduce drm_bridge_chain_get_{first,last,next}_bridge()
  drm/bridge: Make the bridge chain a double-linked list
  drm/bridge: Add a drm_bridge_state object
  drm/bridge: Patch atomic hooks to take a drm_bridge_state
  drm/bridge: Add an ->atomic_check() hook
  drm/bridge: Add the drm_bridge_chain_get_prev_bridge() helper
  drm/bridge: Add the necessary bits to support bus format negotiation
  drm/imx: pd: Use bus format/flags provided by the bridge when
    available
  drm/bridge: lvds-encoder: Add a way to support custom ->atomic_check()
    implem
  drm/bridge: lvds-encoder: Implement bus format negotiation for
    sn75lvds83
  drm/panel: simple: Add support for Toshiba LTA089AC29000 panel
  ARM: dts: imx: imx51-zii-rdu1: Fix the display pipeline definition

 .../display/panel/toshiba,lt089ac29000.txt    |   5 +-
 arch/arm/boot/dts/imx51-zii-rdu1.dts          |  24 +-
 drivers/gpu/drm/arc/arcpgu_hdmi.c             |   1 +
 drivers/gpu/drm/bridge/analogix-anx78xx.c     |   1 +
 .../drm/bridge/analogix/analogix_dp_core.c    |  13 +-
 drivers/gpu/drm/bridge/dumb-vga-dac.c         |   1 +
 drivers/gpu/drm/bridge/lvds-encoder.c         |  75 ++
 .../bridge/megachips-stdpxxxx-ge-b850v3-fw.c  |   1 +
 drivers/gpu/drm/bridge/nxp-ptn3460.c          |   1 +
 drivers/gpu/drm/bridge/panel.c                |   1 +
 drivers/gpu/drm/bridge/parade-ps8622.c        |   1 +
 drivers/gpu/drm/bridge/sii902x.c              |   1 +
 drivers/gpu/drm/bridge/sii9234.c              |   1 +
 drivers/gpu/drm/bridge/sil-sii8620.c          |   1 +
 drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |   1 +
 drivers/gpu/drm/bridge/tc358764.c             |   1 +
 drivers/gpu/drm/bridge/tc358767.c             |   1 +
 drivers/gpu/drm/bridge/ti-sn65dsi86.c         |   1 +
 drivers/gpu/drm/bridge/ti-tfp410.c            |   1 +
 drivers/gpu/drm/drm_atomic.c                  |  40 +
 drivers/gpu/drm/drm_atomic_helper.c           |  46 +-
 drivers/gpu/drm/drm_bridge.c                  | 794 ++++++++++++++----
 drivers/gpu/drm/drm_crtc_helper.c             |  46 +-
 drivers/gpu/drm/drm_encoder.c                 |  16 +-
 drivers/gpu/drm/drm_probe_helper.c            |   3 +-
 drivers/gpu/drm/drm_simple_kms_helper.c       |   1 +
 drivers/gpu/drm/exynos/exynos_dp.c            |   2 +-
 drivers/gpu/drm/exynos/exynos_drm_dsi.c       |  18 +-
 drivers/gpu/drm/exynos/exynos_drm_mic.c       |   1 +
 drivers/gpu/drm/exynos/exynos_hdmi.c          |   1 +
 drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c     |   1 +
 drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c  |   1 +
 drivers/gpu/drm/i2c/tda998x_drv.c             |   1 +
 drivers/gpu/drm/imx/imx-ldb.c                 |   1 +
 drivers/gpu/drm/imx/parallel-display.c        |  29 +-
 drivers/gpu/drm/ingenic/ingenic-drm.c         |   1 +
 drivers/gpu/drm/mediatek/mtk_dpi.c            |   1 +
 drivers/gpu/drm/mediatek/mtk_dsi.c            |   1 +
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |   7 +-
 drivers/gpu/drm/msm/dsi/dsi.h                 |   1 +
 drivers/gpu/drm/msm/edp/edp.c                 |   4 +-
 drivers/gpu/drm/msm/edp/edp.h                 |   1 +
 drivers/gpu/drm/msm/edp/edp_bridge.c          |   2 +-
 drivers/gpu/drm/msm/hdmi/hdmi.c               |   4 +-
 drivers/gpu/drm/msm/hdmi/hdmi.h               |   2 +
 drivers/gpu/drm/omapdrm/dss/output.c          |   1 +
 drivers/gpu/drm/omapdrm/omap_drv.c            |   8 +-
 drivers/gpu/drm/omapdrm/omap_encoder.c        |   4 +-
 drivers/gpu/drm/panel/panel-simple.c          |  36 +
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c        |  10 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c     |   1 +
 drivers/gpu/drm/rockchip/rockchip_lvds.c      |   1 +
 drivers/gpu/drm/rockchip/rockchip_rgb.c       |   1 +
 drivers/gpu/drm/sti/sti_dvo.c                 |   1 +
 drivers/gpu/drm/sti/sti_hda.c                 |   1 +
 drivers/gpu/drm/sti/sti_hdmi.c                |   1 +
 drivers/gpu/drm/sun4i/sun4i_lvds.c            |   1 +
 drivers/gpu/drm/sun4i/sun4i_rgb.c             |   1 +
 drivers/gpu/drm/sun4i/sun4i_tcon.c            |   1 +
 drivers/gpu/drm/tilcdc/tilcdc_external.c      |   1 +
 drivers/gpu/drm/vc4/vc4_dsi.c                 |  38 +-
 include/drm/drm_atomic.h                      |   3 +
 include/drm/drm_bridge.h                      | 252 +++++-
 include/drm/drm_crtc.h                        |   1 -
 include/drm/drm_encoder.h                     |  19 +-
 65 files changed, 1242 insertions(+), 297 deletions(-)

Comments

Neil Armstrong Aug. 9, 2019, 6:58 a.m. UTC | #1
Hi Boris,

On 08/08/2019 17:11, Boris Brezillon wrote:
> Hello,
> 
> This patch series aims at adding support for runtime bus-format
> negotiation between all elements of the
> 'encoder -> bridges -> connector/display' section of the pipeline.

It was one of the big subject of the dw-hdmi support of 10/12/16bit and
YUV420 output, and the bridge states was plannes, and I'm happy you did it !

I'll ASAP to try implementing the dw-hdmi YUV420 and YUV444 output support with
this patchset, but overall with my limited knowledge, it looks globally sane !

Neil

> 
> In order to support that, we need drm bridges to fully take part in the
> atomic state validation process, which requires addition of a
> drm_bridge_state + a new drm_bridge_funcs.atomic_check() hook (patches
> 10 - 12).
> Once those basic building blocks are in place, we can add new helpers
> to facilitate bus-format negotiation between element of the encoder
> chain (patches 13 - 14).
> 
> Patches 1 to 9 are preparatory patches for patches 10 - 14. Patch 1 is
> needed to allow inclusion of drm_atomic.h from drm_bridge.h, which we
> need to make drm_bridge/drm_bridge_state inherit from
> drm_private_obj/drm_private_obj_state.
> Patches 2 to 9 are about transitioning the bridge chain to a
> double-linked list, which is needed to allow bridge elements to
> negotiate with the next and prev element in the pipeline.
> Most of those patches can be applied independently of the rest of the
> series, especially patches 2 - 7 which I think fix some misuses of the
> drm_bridge API.
> 
> To finish, patches 15 - 17 demonstrate how bus-format negotiation can
> be done, and patches 18 - 19 were needed for the use case I used to test
> whole solution.
> 
> As you've noticed, this is an RFC, so any kind of feedback is welcome
> (apart from checkpatch reports :P).
> 
> Thanks,
> 
> Boris
> 
> Boris Brezillon (19):
>   drm: Stop including drm_bridge.h from drm_crtc.h
>   drm: Support custom encoder/bridge enable/disable sequences officially
>   drm/vc4: Get rid of the dsi->bridge field
>   drm/exynos: Get rid of exynos_dsi->out_bridge
>   drm/exynos: Don't reset bridge->next
>   drm/bridge: Create drm_bridge_chain_xx() wrappers
>   drm/msm: Use drm_attach_bridge() to attach a bridge to an encoder
>   drm/bridge: Introduce drm_bridge_chain_get_{first,last,next}_bridge()
>   drm/bridge: Make the bridge chain a double-linked list
>   drm/bridge: Add a drm_bridge_state object
>   drm/bridge: Patch atomic hooks to take a drm_bridge_state
>   drm/bridge: Add an ->atomic_check() hook
>   drm/bridge: Add the drm_bridge_chain_get_prev_bridge() helper
>   drm/bridge: Add the necessary bits to support bus format negotiation
>   drm/imx: pd: Use bus format/flags provided by the bridge when
>     available
>   drm/bridge: lvds-encoder: Add a way to support custom ->atomic_check()
>     implem
>   drm/bridge: lvds-encoder: Implement bus format negotiation for
>     sn75lvds83
>   drm/panel: simple: Add support for Toshiba LTA089AC29000 panel
>   ARM: dts: imx: imx51-zii-rdu1: Fix the display pipeline definition
> 
>  .../display/panel/toshiba,lt089ac29000.txt    |   5 +-
>  arch/arm/boot/dts/imx51-zii-rdu1.dts          |  24 +-
>  drivers/gpu/drm/arc/arcpgu_hdmi.c             |   1 +
>  drivers/gpu/drm/bridge/analogix-anx78xx.c     |   1 +
>  .../drm/bridge/analogix/analogix_dp_core.c    |  13 +-
>  drivers/gpu/drm/bridge/dumb-vga-dac.c         |   1 +
>  drivers/gpu/drm/bridge/lvds-encoder.c         |  75 ++
>  .../bridge/megachips-stdpxxxx-ge-b850v3-fw.c  |   1 +
>  drivers/gpu/drm/bridge/nxp-ptn3460.c          |   1 +
>  drivers/gpu/drm/bridge/panel.c                |   1 +
>  drivers/gpu/drm/bridge/parade-ps8622.c        |   1 +
>  drivers/gpu/drm/bridge/sii902x.c              |   1 +
>  drivers/gpu/drm/bridge/sii9234.c              |   1 +
>  drivers/gpu/drm/bridge/sil-sii8620.c          |   1 +
>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c     |   1 +
>  drivers/gpu/drm/bridge/tc358764.c             |   1 +
>  drivers/gpu/drm/bridge/tc358767.c             |   1 +
>  drivers/gpu/drm/bridge/ti-sn65dsi86.c         |   1 +
>  drivers/gpu/drm/bridge/ti-tfp410.c            |   1 +
>  drivers/gpu/drm/drm_atomic.c                  |  40 +
>  drivers/gpu/drm/drm_atomic_helper.c           |  46 +-
>  drivers/gpu/drm/drm_bridge.c                  | 794 ++++++++++++++----
>  drivers/gpu/drm/drm_crtc_helper.c             |  46 +-
>  drivers/gpu/drm/drm_encoder.c                 |  16 +-
>  drivers/gpu/drm/drm_probe_helper.c            |   3 +-
>  drivers/gpu/drm/drm_simple_kms_helper.c       |   1 +
>  drivers/gpu/drm/exynos/exynos_dp.c            |   2 +-
>  drivers/gpu/drm/exynos/exynos_drm_dsi.c       |  18 +-
>  drivers/gpu/drm/exynos/exynos_drm_mic.c       |   1 +
>  drivers/gpu/drm/exynos/exynos_hdmi.c          |   1 +
>  drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_rgb.c     |   1 +
>  drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c  |   1 +
>  drivers/gpu/drm/i2c/tda998x_drv.c             |   1 +
>  drivers/gpu/drm/imx/imx-ldb.c                 |   1 +
>  drivers/gpu/drm/imx/parallel-display.c        |  29 +-
>  drivers/gpu/drm/ingenic/ingenic-drm.c         |   1 +
>  drivers/gpu/drm/mediatek/mtk_dpi.c            |   1 +
>  drivers/gpu/drm/mediatek/mtk_dsi.c            |   1 +
>  drivers/gpu/drm/mediatek/mtk_hdmi.c           |   7 +-
>  drivers/gpu/drm/msm/dsi/dsi.h                 |   1 +
>  drivers/gpu/drm/msm/edp/edp.c                 |   4 +-
>  drivers/gpu/drm/msm/edp/edp.h                 |   1 +
>  drivers/gpu/drm/msm/edp/edp_bridge.c          |   2 +-
>  drivers/gpu/drm/msm/hdmi/hdmi.c               |   4 +-
>  drivers/gpu/drm/msm/hdmi/hdmi.h               |   2 +
>  drivers/gpu/drm/omapdrm/dss/output.c          |   1 +
>  drivers/gpu/drm/omapdrm/omap_drv.c            |   8 +-
>  drivers/gpu/drm/omapdrm/omap_encoder.c        |   4 +-
>  drivers/gpu/drm/panel/panel-simple.c          |  36 +
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.c        |  10 +-
>  drivers/gpu/drm/rcar-du/rcar_du_encoder.c     |   1 +
>  drivers/gpu/drm/rockchip/rockchip_lvds.c      |   1 +
>  drivers/gpu/drm/rockchip/rockchip_rgb.c       |   1 +
>  drivers/gpu/drm/sti/sti_dvo.c                 |   1 +
>  drivers/gpu/drm/sti/sti_hda.c                 |   1 +
>  drivers/gpu/drm/sti/sti_hdmi.c                |   1 +
>  drivers/gpu/drm/sun4i/sun4i_lvds.c            |   1 +
>  drivers/gpu/drm/sun4i/sun4i_rgb.c             |   1 +
>  drivers/gpu/drm/sun4i/sun4i_tcon.c            |   1 +
>  drivers/gpu/drm/tilcdc/tilcdc_external.c      |   1 +
>  drivers/gpu/drm/vc4/vc4_dsi.c                 |  38 +-
>  include/drm/drm_atomic.h                      |   3 +
>  include/drm/drm_bridge.h                      | 252 +++++-
>  include/drm/drm_crtc.h                        |   1 -
>  include/drm/drm_encoder.h                     |  19 +-
>  65 files changed, 1242 insertions(+), 297 deletions(-)
>