mbox series

[00/22] drm/mediatek: Add mt8195 DisplayPort driver

Message ID 20220325171511.23493-1-granquet@baylibre.com
Headers show
Series drm/mediatek: Add mt8195 DisplayPort driver | expand

Message

Guillaume Ranquet March 25, 2022, 5:14 p.m. UTC
this series is built around the DisplayPort driver. The dpi/dpintf
driver and the added helper functions are required for the DisplayPort
driver to work.

This v9 is not quite ready yet, as project constraints forces me to
publish v9 this week, I'm sorry if it's not standard practice.

Moreover, it is still un-tested on a recent kernel.
The integration kernel we are using is still based on 5.10... but we
are actively working on bringing up a mt8195 integration branch on 5.17.
The patches have been rebased on top of next-20220301 and have been
tested to build sucessfully (no functional testing).

Changes from v8:
- The DP-Phy now has its own dt-bindings and now shares a regmap using the
  syscon facility with the DP driver.
- hot plug detection has been removed from the Embedded Display Port.
  patch and moved to the patch adding External Display Port support.
- started working on better error handling for the mtk_dp driver.
- rebased on linux-next.
- removal of tvd pll clocks re-introduced by mistake.
- various coding style fixes.

Things that are in my todolist for v10:
- fixing the train_handler in the mtk_dp driver, as I haven't been able
  to reproduce locally (hopefully migrating to running the tests on a
  more recent kernel will help)
- explaining the various sleep/delays introduced in the drivers
- explaining some of the differences between mt8195 and "legacy"
- retrieve CK/DE support from panel driver instead of hardcoding it into
  the dpi driver.
- better error handling/reporting in mtk_dp
- look into re-implementing mtk_dp_aux_transfer() using drm_dp_dpcd_read and
  drm_dp_dpcd_write as suggested by Rex.

Older revisions:
RFC - https://lore.kernel.org/linux-mediatek/20210816192523.1739365-1-msp@baylibre.com/
v1  - https://lore.kernel.org/linux-mediatek/20210906193529.718845-1-msp@baylibre.com/
v2  - https://lore.kernel.org/linux-mediatek/20210920084424.231825-1-msp@baylibre.com/
v3  - https://lore.kernel.org/linux-mediatek/20211001094443.2770169-1-msp@baylibre.com/
v4  - https://lore.kernel.org/linux-mediatek/20211011094624.3416029-1-msp@baylibre.com/
v5  - https://lore.kernel.org/all/20211021092707.3562523-1-msp@baylibre.com/
v6  - https://lore.kernel.org/linux-mediatek/20211110130623.20553-1-granquet@baylibre.com/
v7  - https://lore.kernel.org/linux-mediatek/20211217150854.2081-1-granquet@baylibre.com/
v8  - https://lore.kernel.org/linux-mediatek/20220218145437.18563-1-granquet@baylibre.com/

Functional dependencies are:
- Add Mediatek Soc DRM (vdosys0) support for mt8195
  https://lore.kernel.org/all/20211026155911.17651-1-jason-jh.lin@mediatek.com/
- Add MediaTek SoC DRM (vdosys1) support for mt8195
  https://lore.kernel.org/all/20211029075203.17093-1-nancy.lin@mediatek.com/

Guillaume Ranquet (15):
  dt-bindings: mediatek,dp_phy: Add Display Port PHY binding
  drm/edid: Convert cea_sad helper struct to kernelDoc
  drm/edid: Add cea_sad helpers for freq/length
  drm/mediatek: dpi: move dpi limits to SoC config
  drm/mediatek: dpi: implement a CK/DE pol toggle in SoC config
  drm/mediatek: dpi: implement a swap_input toggle in SoC config
  drm/mediatek: dpi: move dimension mask to SoC config
  drm/mediatek: dpi: move hvsize_mask to SoC config
  drm/mediatek: dpi: move swap_shift to SoC config
  drm/mediatek: dpi: move the yuv422_en_bit to SoC config
  drm/mediatek: dpi: move the csc_enable bit to SoC config
  drm/mediatek: dpi: Add dpintf support
  drm/meditek: dpi: Add matrix_sel helper
  drm/mediatek: Add mt8195 External DisplayPort support
  drm/mediatek: DP audio support for mt8195

Jitao Shi (2):
  drm/mediatek: add hpd debounce
  drm/mediatek: change the aux retries times when receiving AUX_DEFER

Markus Schneider-Pargmann (5):
  dt-bindings: mediatek,dpi: Add DP_INTF compatible
  dt-bindings: mediatek,dp: Add Display Port binding
  video/hdmi: Add audio_infoframe packing for DP
  phy: phy-mtk-dp: Add driver for DP phy
  drm/mediatek: Add mt8195 Embedded DisplayPort driver

 .../display/mediatek/mediatek,dp.yaml         |   97 +
 .../display/mediatek/mediatek,dpi.yaml        |   11 +-
 .../bindings/phy/mediatek,dp-phy.yaml         |   43 +
 MAINTAINERS                                   |    1 +
 drivers/gpu/drm/drm_edid.c                    |   74 +
 drivers/gpu/drm/mediatek/Kconfig              |    8 +
 drivers/gpu/drm/mediatek/Makefile             |    2 +
 drivers/gpu/drm/mediatek/mtk_dp.c             | 3204 +++++++++++++++++
 drivers/gpu/drm/mediatek/mtk_dp_reg.h         |  568 +++
 drivers/gpu/drm/mediatek/mtk_dpi.c            |  222 +-
 drivers/gpu/drm/mediatek/mtk_dpi_regs.h       |   38 +
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c   |    8 +
 drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h   |    1 +
 drivers/gpu/drm/mediatek/mtk_drm_drv.c        |    6 +-
 drivers/gpu/drm/mediatek/mtk_drm_drv.h        |    1 +
 drivers/phy/mediatek/Kconfig                  |    8 +
 drivers/phy/mediatek/Makefile                 |    1 +
 drivers/phy/mediatek/phy-mtk-dp.c             |  202 ++
 drivers/video/hdmi.c                          |   82 +-
 include/drm/dp/drm_dp_helper.h                |    2 +
 include/drm/drm_edid.h                        |   25 +-
 include/linux/hdmi.h                          |    7 +-
 include/linux/soc/mediatek/mtk-mmsys.h        |    3 +-
 23 files changed, 4541 insertions(+), 73 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml
 create mode 100644 Documentation/devicetree/bindings/phy/mediatek,dp-phy.yaml
 create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.c
 create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_reg.h
 create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c

Comments

Guillaume Ranquet March 25, 2022, 5:15 p.m. UTC | #1
From: Jitao Shi <jitao.shi@mediatek.com>
Krzysztof Kozlowski March 25, 2022, 5:31 p.m. UTC | #2
On 25/03/2022 18:14, Guillaume Ranquet wrote:
> From: Markus Schneider-Pargmann <msp@baylibre.com>
> 
> DP_INTF is similar to DPI but does not have the exact same feature set
> or register layouts.
> 
> DP_INTF is the sink of the display pipeline that is connected to the
> DisplayPort controller and encoder unit. It takes the same clocks as
> DPI.
> 
> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
> Reviewed-by: Rob Herring <robh@kernel.org>

This is v1, how did you get Rob's review already?

> ---
>  .../bindings/display/mediatek/mediatek,dpi.yaml       | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> index dd2896a40ff0..53acf9a84f7f 100644
> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
> @@ -4,16 +4,16 @@
>  $id: http://devicetree.org/schemas/display/mediatek/mediatek,dpi.yaml#
>  $schema: http://devicetree.org/meta-schemas/core.yaml#
>  
> -title: mediatek DPI Controller Device Tree Bindings
> +title: mediatek DPI/DP_INTF Controller Device Tree Bindings

While at it, remove "Device Tree Bindings". It's about hardware.


Please also rebase your tree as you use my old email address.

Best regards,
Krzysztof
Guillaume Ranquet March 25, 2022, 5:43 p.m. UTC | #3
On Fri, 25 Mar 2022 18:31, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>On 25/03/2022 18:14, Guillaume Ranquet wrote:
>> From: Markus Schneider-Pargmann <msp@baylibre.com>
>>
>> DP_INTF is similar to DPI but does not have the exact same feature set
>> or register layouts.
>>
>> DP_INTF is the sink of the display pipeline that is connected to the
>> DisplayPort controller and encoder unit. It takes the same clocks as
>> DPI.
>>
>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
>> Reviewed-by: Rob Herring <robh@kernel.org>
>
>This is v1, how did you get Rob's review already?
>

Because this is not v1... I'm not really good at this... this is actually v9...
I just didn't pay attention enough before sending the series.

What's the standard thing to do? resend with the proper versionning?

Sorry for the confusion,
Guillaume.

>> ---
>>  .../bindings/display/mediatek/mediatek,dpi.yaml       | 11 ++++++-----
>>  1 file changed, 6 insertions(+), 5 deletions(-)
>>
>> diff --git a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
>> index dd2896a40ff0..53acf9a84f7f 100644
>> --- a/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
>> +++ b/Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
>> @@ -4,16 +4,16 @@
>>  $id: http://devicetree.org/schemas/display/mediatek/mediatek,dpi.yaml#
>>  $schema: http://devicetree.org/meta-schemas/core.yaml#
>>
>> -title: mediatek DPI Controller Device Tree Bindings
>> +title: mediatek DPI/DP_INTF Controller Device Tree Bindings
>
>While at it, remove "Device Tree Bindings". It's about hardware.
>
>
>Please also rebase your tree as you use my old email address.
>
>Best regards,
>Krzysztof
Krzysztof Kozlowski March 25, 2022, 5:45 p.m. UTC | #4
On 25/03/2022 18:43, Guillaume Ranquet wrote:
> On Fri, 25 Mar 2022 18:31, Krzysztof Kozlowski <krzk@kernel.org> wrote:
>> On 25/03/2022 18:14, Guillaume Ranquet wrote:
>>> From: Markus Schneider-Pargmann <msp@baylibre.com>
>>>
>>> DP_INTF is similar to DPI but does not have the exact same feature set
>>> or register layouts.
>>>
>>> DP_INTF is the sink of the display pipeline that is connected to the
>>> DisplayPort controller and encoder unit. It takes the same clocks as
>>> DPI.
>>>
>>> Signed-off-by: Markus Schneider-Pargmann <msp@baylibre.com>
>>> Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
>>> Reviewed-by: Rob Herring <robh@kernel.org>
>>
>> This is v1, how did you get Rob's review already?
>>
> 
> Because this is not v1... I'm not really good at this... 

Don't worry, I made many more mistakes...

> this is actually v9...
> I just didn't pay attention enough before sending the series.
> 
> What's the standard thing to do? resend with the proper versionning?

Yes, please resend as v1 with cover-letter containing changelog. Anyway
someone might scream that you spam his box (immediate resends are also
not welcomed), but what to do. :)


Best regards,
Krzysztof
Guillaume Ranquet March 25, 2022, 5:53 p.m. UTC | #5
On Fri, 25 Mar 2022 18:14, Guillaume Ranquet <granquet@baylibre.com> wrote:
>this series is built around the DisplayPort driver. The dpi/dpintf
>driver and the added helper functions are required for the DisplayPort
>driver to work.
>
>This v9 is not quite ready yet, as project constraints forces me to
>publish v9 this week, I'm sorry if it's not standard practice.
>
>Moreover, it is still un-tested on a recent kernel.
>The integration kernel we are using is still based on 5.10... but we
>are actively working on bringing up a mt8195 integration branch on 5.17.
>The patches have been rebased on top of next-20220301 and have been
>tested to build sucessfully (no functional testing).
>
>Changes from v8:
>- The DP-Phy now has its own dt-bindings and now shares a regmap using the
>  syscon facility with the DP driver.
>- hot plug detection has been removed from the Embedded Display Port.
>  patch and moved to the patch adding External Display Port support.
>- started working on better error handling for the mtk_dp driver.
>- rebased on linux-next.
>- removal of tvd pll clocks re-introduced by mistake.
>- various coding style fixes.
>
>Things that are in my todolist for v10:
>- fixing the train_handler in the mtk_dp driver, as I haven't been able
>  to reproduce locally (hopefully migrating to running the tests on a
>  more recent kernel will help)
>- explaining the various sleep/delays introduced in the drivers
>- explaining some of the differences between mt8195 and "legacy"
>- retrieve CK/DE support from panel driver instead of hardcoding it into
>  the dpi driver.
>- better error handling/reporting in mtk_dp
>- look into re-implementing mtk_dp_aux_transfer() using drm_dp_dpcd_read and
>  drm_dp_dpcd_write as suggested by Rex.
>
>Older revisions:
>RFC - https://lore.kernel.org/linux-mediatek/20210816192523.1739365-1-msp@baylibre.com/
>v1  - https://lore.kernel.org/linux-mediatek/20210906193529.718845-1-msp@baylibre.com/
>v2  - https://lore.kernel.org/linux-mediatek/20210920084424.231825-1-msp@baylibre.com/
>v3  - https://lore.kernel.org/linux-mediatek/20211001094443.2770169-1-msp@baylibre.com/
>v4  - https://lore.kernel.org/linux-mediatek/20211011094624.3416029-1-msp@baylibre.com/
>v5  - https://lore.kernel.org/all/20211021092707.3562523-1-msp@baylibre.com/
>v6  - https://lore.kernel.org/linux-mediatek/20211110130623.20553-1-granquet@baylibre.com/
>v7  - https://lore.kernel.org/linux-mediatek/20211217150854.2081-1-granquet@baylibre.com/
>v8  - https://lore.kernel.org/linux-mediatek/20220218145437.18563-1-granquet@baylibre.com/
>
>Functional dependencies are:
>- Add Mediatek Soc DRM (vdosys0) support for mt8195
>  https://lore.kernel.org/all/20211026155911.17651-1-jason-jh.lin@mediatek.com/
>- Add MediaTek SoC DRM (vdosys1) support for mt8195
>  https://lore.kernel.org/all/20211029075203.17093-1-nancy.lin@mediatek.com/
>
>Guillaume Ranquet (15):
>  dt-bindings: mediatek,dp_phy: Add Display Port PHY binding
>  drm/edid: Convert cea_sad helper struct to kernelDoc
>  drm/edid: Add cea_sad helpers for freq/length
>  drm/mediatek: dpi: move dpi limits to SoC config
>  drm/mediatek: dpi: implement a CK/DE pol toggle in SoC config
>  drm/mediatek: dpi: implement a swap_input toggle in SoC config
>  drm/mediatek: dpi: move dimension mask to SoC config
>  drm/mediatek: dpi: move hvsize_mask to SoC config
>  drm/mediatek: dpi: move swap_shift to SoC config
>  drm/mediatek: dpi: move the yuv422_en_bit to SoC config
>  drm/mediatek: dpi: move the csc_enable bit to SoC config
>  drm/mediatek: dpi: Add dpintf support
>  drm/meditek: dpi: Add matrix_sel helper
>  drm/mediatek: Add mt8195 External DisplayPort support
>  drm/mediatek: DP audio support for mt8195
>
>Jitao Shi (2):
>  drm/mediatek: add hpd debounce
>  drm/mediatek: change the aux retries times when receiving AUX_DEFER
>
>Markus Schneider-Pargmann (5):
>  dt-bindings: mediatek,dpi: Add DP_INTF compatible
>  dt-bindings: mediatek,dp: Add Display Port binding
>  video/hdmi: Add audio_infoframe packing for DP
>  phy: phy-mtk-dp: Add driver for DP phy
>  drm/mediatek: Add mt8195 Embedded DisplayPort driver
>
> .../display/mediatek/mediatek,dp.yaml         |   97 +
> .../display/mediatek/mediatek,dpi.yaml        |   11 +-
> .../bindings/phy/mediatek,dp-phy.yaml         |   43 +
> MAINTAINERS                                   |    1 +
> drivers/gpu/drm/drm_edid.c                    |   74 +
> drivers/gpu/drm/mediatek/Kconfig              |    8 +
> drivers/gpu/drm/mediatek/Makefile             |    2 +
> drivers/gpu/drm/mediatek/mtk_dp.c             | 3204 +++++++++++++++++
> drivers/gpu/drm/mediatek/mtk_dp_reg.h         |  568 +++
> drivers/gpu/drm/mediatek/mtk_dpi.c            |  222 +-
> drivers/gpu/drm/mediatek/mtk_dpi_regs.h       |   38 +
> drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.c   |    8 +
> drivers/gpu/drm/mediatek/mtk_drm_ddp_comp.h   |    1 +
> drivers/gpu/drm/mediatek/mtk_drm_drv.c        |    6 +-
> drivers/gpu/drm/mediatek/mtk_drm_drv.h        |    1 +
> drivers/phy/mediatek/Kconfig                  |    8 +
> drivers/phy/mediatek/Makefile                 |    1 +
> drivers/phy/mediatek/phy-mtk-dp.c             |  202 ++
> drivers/video/hdmi.c                          |   82 +-
> include/drm/dp/drm_dp_helper.h                |    2 +
> include/drm/drm_edid.h                        |   25 +-
> include/linux/hdmi.h                          |    7 +-
> include/linux/soc/mediatek/mtk-mmsys.h        |    3 +-
> 23 files changed, 4541 insertions(+), 73 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/display/mediatek/mediatek,dp.yaml
> create mode 100644 Documentation/devicetree/bindings/phy/mediatek,dp-phy.yaml
> create mode 100644 drivers/gpu/drm/mediatek/mtk_dp.c
> create mode 100644 drivers/gpu/drm/mediatek/mtk_dp_reg.h
> create mode 100644 drivers/phy/mediatek/phy-mtk-dp.c
>
>--
>2.34.1
>

This is actually v9.
Please ignore these as I will resend the patches properly tagged as v9.

Sorry for the inconveniance,
Guillaume.