mbox series

[v4,00/11] drm: Add support for bus-format negotiation

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

Message

Boris Brezillon Dec. 3, 2019, 2:15 p.m. UTC
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 adding a
drm_bridge_state and a new drm_bridge_funcs.atomic_check() hook.
Once those basic building blocks are in place, we can add new hooks to
allow bus format negotiation (those are called just before
->atomic_check()). The bus format selection is done at runtime by
testing all possible combinations across the whole bridge chain until
one is reported to work.

No Major changes in this v4. I think I addressed all comments I got
from Neil and Laurent (thanks for the detailed reviews BTW). Note that
this version only contains core changes. Once those changes are merged
I'll send the imx/panel/lvds-codec specific bits.

A more detailed changelog is provided in each patch.

This patch series is also available here [1].

Thanks,

Boris

[1]https://github.com/bbrezillon/linux-0day/commits/drm-bridge-busfmt-v4

Boris Brezillon (11):
  drm/bridge: Rename bridge helpers targeting a bridge chain
  drm/bridge: Introduce drm_bridge_get_next_bridge()
  drm: Stop accessing encoder->bridge directly
  drm/bridge: Make the bridge chain a double-linked list
  drm/bridge: Add the drm_for_each_bridge_in_chain() helper
  drm/bridge: Add the drm_bridge_get_prev_bridge() helper
  drm/bridge: Clarify the atomic enable/disable hooks semantics
  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 necessary bits to support bus format negotiation

 .../drm/bridge/analogix/analogix_dp_core.c    |  41 +-
 drivers/gpu/drm/drm_atomic.c                  |  39 +
 drivers/gpu/drm/drm_atomic_helper.c           |  53 +-
 drivers/gpu/drm/drm_bridge.c                  | 756 +++++++++++++++---
 drivers/gpu/drm/drm_encoder.c                 |  15 +-
 drivers/gpu/drm/drm_probe_helper.c            |   4 +-
 drivers/gpu/drm/exynos/exynos_drm_dsi.c       |  13 +-
 drivers/gpu/drm/mediatek/mtk_hdmi.c           |   8 +-
 drivers/gpu/drm/msm/edp/edp_bridge.c          |  10 +-
 drivers/gpu/drm/omapdrm/omap_drv.c            |   4 +-
 drivers/gpu/drm/omapdrm/omap_encoder.c        |   3 +-
 drivers/gpu/drm/rcar-du/rcar_du_crtc.c        |  10 +-
 drivers/gpu/drm/vc4/vc4_dsi.c                 |  18 +-
 include/drm/drm_atomic.h                      |   3 +
 include/drm/drm_bridge.h                      | 404 +++++++++-
 include/drm/drm_encoder.h                     |   7 +-
 16 files changed, 1174 insertions(+), 214 deletions(-)

Comments

Laurent Pinchart Dec. 3, 2019, 6:19 p.m. UTC | #1
Hi Boris,

On Tue, Dec 03, 2019 at 03:15:04PM +0100, Boris Brezillon wrote:
> 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 adding a
> drm_bridge_state and a new drm_bridge_funcs.atomic_check() hook.
> Once those basic building blocks are in place, we can add new hooks to
> allow bus format negotiation (those are called just before
> ->atomic_check()). The bus format selection is done at runtime by
> testing all possible combinations across the whole bridge chain until
> one is reported to work.
> 
> No Major changes in this v4. I think I addressed all comments I got
> from Neil and Laurent (thanks for the detailed reviews BTW). Note that
> this version only contains core changes. Once those changes are merged
> I'll send the imx/panel/lvds-codec specific bits.

I think it would make sense to fast-track patches 01 to 07 (a bit
selfishly as I would have a need for them in omapdrm :-)), but starting
from 08 I wonder if it wouldn't make more sense to merge them with the
imx/panel/lvds-codec bits to have a user.

> A more detailed changelog is provided in each patch.
> 
> This patch series is also available here [1].
> 
> Thanks,
> 
> Boris
> 
> [1]https://github.com/bbrezillon/linux-0day/commits/drm-bridge-busfmt-v4
> 
> Boris Brezillon (11):
>   drm/bridge: Rename bridge helpers targeting a bridge chain
>   drm/bridge: Introduce drm_bridge_get_next_bridge()
>   drm: Stop accessing encoder->bridge directly
>   drm/bridge: Make the bridge chain a double-linked list
>   drm/bridge: Add the drm_for_each_bridge_in_chain() helper
>   drm/bridge: Add the drm_bridge_get_prev_bridge() helper
>   drm/bridge: Clarify the atomic enable/disable hooks semantics
>   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 necessary bits to support bus format negotiation
> 
>  .../drm/bridge/analogix/analogix_dp_core.c    |  41 +-
>  drivers/gpu/drm/drm_atomic.c                  |  39 +
>  drivers/gpu/drm/drm_atomic_helper.c           |  53 +-
>  drivers/gpu/drm/drm_bridge.c                  | 756 +++++++++++++++---
>  drivers/gpu/drm/drm_encoder.c                 |  15 +-
>  drivers/gpu/drm/drm_probe_helper.c            |   4 +-
>  drivers/gpu/drm/exynos/exynos_drm_dsi.c       |  13 +-
>  drivers/gpu/drm/mediatek/mtk_hdmi.c           |   8 +-
>  drivers/gpu/drm/msm/edp/edp_bridge.c          |  10 +-
>  drivers/gpu/drm/omapdrm/omap_drv.c            |   4 +-
>  drivers/gpu/drm/omapdrm/omap_encoder.c        |   3 +-
>  drivers/gpu/drm/rcar-du/rcar_du_crtc.c        |  10 +-
>  drivers/gpu/drm/vc4/vc4_dsi.c                 |  18 +-
>  include/drm/drm_atomic.h                      |   3 +
>  include/drm/drm_bridge.h                      | 404 +++++++++-
>  include/drm/drm_encoder.h                     |   7 +-
>  16 files changed, 1174 insertions(+), 214 deletions(-)
Boris Brezillon Dec. 4, 2019, 9:09 a.m. UTC | #2
On Tue, 3 Dec 2019 20:19:24 +0200
Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:

> Hi Boris,
> 
> On Tue, Dec 03, 2019 at 03:15:04PM +0100, Boris Brezillon wrote:
> > 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 adding a
> > drm_bridge_state and a new drm_bridge_funcs.atomic_check() hook.
> > Once those basic building blocks are in place, we can add new hooks to
> > allow bus format negotiation (those are called just before  
> > ->atomic_check()). The bus format selection is done at runtime by  
> > testing all possible combinations across the whole bridge chain until
> > one is reported to work.
> > 
> > No Major changes in this v4. I think I addressed all comments I got
> > from Neil and Laurent (thanks for the detailed reviews BTW). Note that
> > this version only contains core changes. Once those changes are merged
> > I'll send the imx/panel/lvds-codec specific bits.  
> 
> I think it would make sense to fast-track patches 01 to 07 (a bit
> selfishly as I would have a need for them in omapdrm :-))

Will do that end of this week.

>, but starting
> from 08 I wonder if it wouldn't make more sense to merge them with the
> imx/panel/lvds-codec bits to have a user.

I'd really like to see that happen early in this release cycle so we
can catch bugs before those commits reach Linus' tree, and the
lvds-codec changes depend on your PR. Can we make sure this one is
merged just after the MW has closed and the drm-next -> drm-misc-next
back merge done just after that?
Laurent Pinchart Dec. 4, 2019, 9:15 a.m. UTC | #3
Hi Boris,

On Wed, Dec 04, 2019 at 10:09:57AM +0100, Boris Brezillon wrote:
> On Tue, 3 Dec 2019 20:19:24 +0200 Laurent Pinchart wrote:
> > On Tue, Dec 03, 2019 at 03:15:04PM +0100, Boris Brezillon wrote:
> > > 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 adding a
> > > drm_bridge_state and a new drm_bridge_funcs.atomic_check() hook.
> > > Once those basic building blocks are in place, we can add new hooks to
> > > allow bus format negotiation (those are called just before  
> > > ->atomic_check()). The bus format selection is done at runtime by  
> > > testing all possible combinations across the whole bridge chain until
> > > one is reported to work.
> > > 
> > > No Major changes in this v4. I think I addressed all comments I got
> > > from Neil and Laurent (thanks for the detailed reviews BTW). Note that
> > > this version only contains core changes. Once those changes are merged
> > > I'll send the imx/panel/lvds-codec specific bits.  
> > 
> > I think it would make sense to fast-track patches 01 to 07 (a bit
> > selfishly as I would have a need for them in omapdrm :-))
> 
> Will do that end of this week.

Thank you.

> >, but starting
> > from 08 I wonder if it wouldn't make more sense to merge them with the
> > imx/panel/lvds-codec bits to have a user.
> 
> I'd really like to see that happen early in this release cycle so we
> can catch bugs before those commits reach Linus' tree,

I have no issue merging all your patches early in the release cycle,
including the imx/panel/lvds-codec bits. Given the rebase required for
lvds-codec it may take a bit of time though, so I'm OK if you prefer
merging the core first, but I'm not sure it will help catching bugs if
it's unused :-)

> and the
> lvds-codec changes depend on your PR. Can we make sure this one is
> merged just after the MW has closed and the drm-next -> drm-misc-next
> back merge done just after that?

I've sent the pull request already, as soon as Dave or Daniel handles
it, you'll have the necessary dependencies.
Neil Armstrong Dec. 4, 2019, 1:43 p.m. UTC | #4
On 03/12/2019 19:19, Laurent Pinchart wrote:
> Hi Boris,
> 
> On Tue, Dec 03, 2019 at 03:15:04PM +0100, Boris Brezillon wrote:
>> 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 adding a
>> drm_bridge_state and a new drm_bridge_funcs.atomic_check() hook.
>> Once those basic building blocks are in place, we can add new hooks to
>> allow bus format negotiation (those are called just before
>> ->atomic_check()). The bus format selection is done at runtime by
>> testing all possible combinations across the whole bridge chain until
>> one is reported to work.
>>
>> No Major changes in this v4. I think I addressed all comments I got
>> from Neil and Laurent (thanks for the detailed reviews BTW). Note that
>> this version only contains core changes. Once those changes are merged
>> I'll send the imx/panel/lvds-codec specific bits.
> 
> I think it would make sense to fast-track patches 01 to 07 (a bit
> selfishly as I would have a need for them in omapdrm :-)), but starting
> from 08 I wonder if it wouldn't make more sense to merge them with the
> imx/panel/lvds-codec bits to have a user.

@Boris you can push when Laurent's PR has been merged and backmerged to drm-misc-next

I have a patchset being an user of patches 8-11, so the lvds-codec stuff won't be the
only user of this !
I'll post a version ASAP to validate the v4 serie on the dw-hdmi usercase.

Thanks !

Neil

> 
>> A more detailed changelog is provided in each patch.
>>
>> This patch series is also available here [1].
>>
>> Thanks,
>>
>> Boris
>>
>> [1]https://github.com/bbrezillon/linux-0day/commits/drm-bridge-busfmt-v4
>>
>> Boris Brezillon (11):
>>   drm/bridge: Rename bridge helpers targeting a bridge chain
>>   drm/bridge: Introduce drm_bridge_get_next_bridge()
>>   drm: Stop accessing encoder->bridge directly
>>   drm/bridge: Make the bridge chain a double-linked list
>>   drm/bridge: Add the drm_for_each_bridge_in_chain() helper
>>   drm/bridge: Add the drm_bridge_get_prev_bridge() helper
>>   drm/bridge: Clarify the atomic enable/disable hooks semantics
>>   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 necessary bits to support bus format negotiation
>>
>>  .../drm/bridge/analogix/analogix_dp_core.c    |  41 +-
>>  drivers/gpu/drm/drm_atomic.c                  |  39 +
>>  drivers/gpu/drm/drm_atomic_helper.c           |  53 +-
>>  drivers/gpu/drm/drm_bridge.c                  | 756 +++++++++++++++---
>>  drivers/gpu/drm/drm_encoder.c                 |  15 +-
>>  drivers/gpu/drm/drm_probe_helper.c            |   4 +-
>>  drivers/gpu/drm/exynos/exynos_drm_dsi.c       |  13 +-
>>  drivers/gpu/drm/mediatek/mtk_hdmi.c           |   8 +-
>>  drivers/gpu/drm/msm/edp/edp_bridge.c          |  10 +-
>>  drivers/gpu/drm/omapdrm/omap_drv.c            |   4 +-
>>  drivers/gpu/drm/omapdrm/omap_encoder.c        |   3 +-
>>  drivers/gpu/drm/rcar-du/rcar_du_crtc.c        |  10 +-
>>  drivers/gpu/drm/vc4/vc4_dsi.c                 |  18 +-
>>  include/drm/drm_atomic.h                      |   3 +
>>  include/drm/drm_bridge.h                      | 404 +++++++++-
>>  include/drm/drm_encoder.h                     |   7 +-
>>  16 files changed, 1174 insertions(+), 214 deletions(-)
>
Boris Brezillon Dec. 9, 2019, 9:43 a.m. UTC | #5
On Tue, 3 Dec 2019 20:19:24 +0200
Laurent Pinchart <laurent.pinchart@ideasonboard.com> wrote:

> Hi Boris,
> 
> On Tue, Dec 03, 2019 at 03:15:04PM +0100, Boris Brezillon wrote:
> > 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 adding a
> > drm_bridge_state and a new drm_bridge_funcs.atomic_check() hook.
> > Once those basic building blocks are in place, we can add new hooks to
> > allow bus format negotiation (those are called just before  
> > ->atomic_check()). The bus format selection is done at runtime by  
> > testing all possible combinations across the whole bridge chain until
> > one is reported to work.
> > 
> > No Major changes in this v4. I think I addressed all comments I got
> > from Neil and Laurent (thanks for the detailed reviews BTW). Note that
> > this version only contains core changes. Once those changes are merged
> > I'll send the imx/panel/lvds-codec specific bits.  
> 
> I think it would make sense to fast-track patches 01 to 07 (a bit
> selfishly as I would have a need for them in omapdrm :-)),

I just queued patches 1 to 7 to drm-misc-next.