mbox series

[v4,00/29] Add HDMI support for RK3128

Message ID 20231222174220.55249-1-knaerzche@gmail.com (mailing list archive)
Headers show
Series Add HDMI support for RK3128 | expand

Message

Alex Bee Dec. 22, 2023, 5:41 p.m. UTC
This is version 4 of my series that aims to add support for the display
controller (VOP) and the HDMI controller block of RK3128 (which is very
similar to the one found in RK3036). The original intention of this series
was to add support for this slightly different integration but is by now,
driven by maintainer's feedback, exploded to be a rework of inno-hdmi
driver in large parts. It is, however, a change for the better.

The VOP part is very simple -  everything we need for HDMI support is
already there. I only needed to split the output selection registers from
RK3036. The VOP has an IOMMU attached, but it has a serious silicon bug:
Registers can only be written, but not be read. As it's not possible to use
it with the IOMMU driver in it's current state I'm not adding it here and
we have to live with CMA for now - which works fine also. I got response
from the vendor, that there is no possibility to read the registers and an
workaround must be implemented in software in order to use it.

The inno-hdmi driver currently gets a lot of attention [0-2] and I'm
hooking in now also. As requested I incorporated some of Maxime's series
[0] (and tested them).
I have intentionally not removed any code dealing with output format
conversion in this series. In contrast to the input format, which is always
RGB on this platform and certainly can be dropped, that can be implemented
later. And secondly I need the conversion for RGB full range to RGB limited
range for this series.

I did also some smaller driver cleanups from my side and implemented a
custom connector state which now holds the data that belongs there and it
is not longer in the device structure and, of course, addressed the
feedback from v1 [3] and v2 [4].
There hasn't been any feedback to v3[5] so far, but I fixed an issue with
the new custom connector reset hook: If there is a connector state already
it needs to be destroyed in there as well.

Please see individual patches for detailed changelog.

Note: Patches are based and tested on next-20231213.

[0] https://lore.kernel.org/all/20231207-kms-hdmi-connector-state-v5-0-6538e19d634d@kernel.org
[1] https://lore.kernel.org/all/20231204123315.28456-1-keith.zhao@starfivetech.com
[2] https://lore.kernel.org/all/2601b669-c570-f39d-8cf9-bff56c939912@gmail.com
[3] https://lore.kernel.org/all/20231213195125.212923-1-knaerzche@gmail.com/
[4] https://lore.kernel.org/all/20231216162639.125215-1-knaerzche@gmail.com/
[5] https://lore.kernel.org/all/20231219170100.188800-1-knaerzche@gmail.com/

Alex Bee (17):
  dt-bindings: display: rockchip,inno-hdmi: Document RK3128 compatible
  drm/rockchip: vop: Add output selection registers for RK312x
  drm/rockchip: inno_hdmi: Fix video timing
  drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents
  drm/rockchip: inno_hdmi: Drop irq struct member
  drm/rockchip: inno_hdmi: Remove useless include
  drm/rockchip: inno_hdmi: Subclass connector state
  drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range
  drm/rockchip: inno_hdmi: Don't power up the phy after resetting
  drm/rockchip: inno_hdmi: Split power mode setting
  drm/rockchip: inno_hdmi: Add variant support
  drm/rockchip: inno_hdmi: Add RK3128 support
  drm/rockchip: inno_hdmi: Add basic mode validation
  drm/rockchip: inno_hdmi: Drop custom fill_modes hook
  ARM: dts: rockchip: Add display subsystem for RK3128
  ARM: dts: rockchip: Add HDMI node for RK3128
  ARM: dts: rockchip: Enable HDMI output for XPI-3128

Maxime Ripard (12):
  drm/rockchip: inno_hdmi: Remove useless mode_fixup
  drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode
  drm/rockchip: inno_hdmi: Switch encoder hooks to atomic
  drm/rockchip: inno_hdmi: Get rid of mode_set
  drm/rockchip: inno_hdmi: no need to store vic
  drm/rockchip: inno_hdmi: Remove unneeded has audio flag
  drm/rockchip: inno_hdmi: Remove useless input format
  drm/rockchip: inno_hdmi: Remove tmds rate from structure
  drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support
  drm/rockchip: inno_hdmi: Move infoframe disable to separate function
  drm/rockchip: inno_hdmi: Switch to infoframe type
  drm/rockchip: inno_hdmi: Remove unused drm device pointer

 .../display/rockchip/rockchip,inno-hdmi.yaml  |  40 +-
 .../arm/boot/dts/rockchip/rk3128-xpi-3128.dts |  29 +
 arch/arm/boot/dts/rockchip/rk3128.dtsi        |  60 ++
 drivers/gpu/drm/rockchip/inno_hdmi.c          | 549 +++++++++++-------
 drivers/gpu/drm/rockchip/inno_hdmi.h          |   5 -
 drivers/gpu/drm/rockchip/rockchip_vop_reg.c   |  13 +-
 drivers/gpu/drm/rockchip/rockchip_vop_reg.h   |   3 +
 7 files changed, 484 insertions(+), 215 deletions(-)


base-commit: 48e8992e33abf054bcc0bb2e77b2d43bb899212e

Comments

Heiko Stübner Dec. 29, 2023, 11:36 p.m. UTC | #1
On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
> This is version 4 of my series that aims to add support for the display
> controller (VOP) and the HDMI controller block of RK3128 (which is very
> similar to the one found in RK3036). The original intention of this series
> was to add support for this slightly different integration but is by now,
> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
> driver in large parts. It is, however, a change for the better.
> 
> [...]

Applied, thanks!

[02/29] drm/rockchip: vop: Add output selection registers for RK312x
        commit: 407eaa4aa64a8429094fa75fac00fff5e471138d
[03/29] drm/rockchip: inno_hdmi: Fix video timing
        commit: 47a145c03484d33e65d773169d5ca1b9fe2a492e
[04/29] drm/rockchip: inno_hdmi: Remove useless mode_fixup
        commit: 099be7b6718685ebafb417e74bb637abf992474a
[05/29] drm/rockchip: inno_hdmi: Remove useless copy of drm_display_mode
        commit: 8f0df2012b8a94aed0cc450016f7592c24e92cfb
[06/29] drm/rockchip: inno_hdmi: Switch encoder hooks to atomic
        commit: ff4d4fa76fcc19f7d5d261f717121f0a88ec4e30
[07/29] drm/rockchip: inno_hdmi: Get rid of mode_set
        commit: d3e040f450ec8e46ff42fa495a433b976ab47686
[08/29] drm/rockchip: inno_hdmi: no need to store vic
        commit: d7ba3d711cf537ef0ece14cd85d2113ca338a00b
[09/29] drm/rockchip: inno_hdmi: Remove unneeded has audio flag
        commit: f8723484e045ff2d176124484907ec0199c55a0c
[10/29] drm/rockchip: inno_hdmi: Remove useless input format
        commit: c1ceee3248742149d1a602fd913bd88857da1d52
[11/29] drm/rockchip: inno_hdmi: Remove YUV-based csc coefficents
        commit: 139771b8239c43ad1bd6c2976aa12788096a5483
[12/29] drm/rockchip: inno_hdmi: Remove tmds rate from structure
        commit: 5f92474844a4fcb7997da20dd1de2031aed1d794

Best regards,
Heiko Stübner Dec. 29, 2023, 11:42 p.m. UTC | #2
On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
> This is version 4 of my series that aims to add support for the display
> controller (VOP) and the HDMI controller block of RK3128 (which is very
> similar to the one found in RK3036). The original intention of this series
> was to add support for this slightly different integration but is by now,
> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
> driver in large parts. It is, however, a change for the better.
> 
> [...]

Applied, thanks!

[13/29] drm/rockchip: inno_hdmi: Drop HDMI Vendor Infoframe support
        commit: aa4f96e2de82f5e0dfc0102d08f66918c5e3637f
[14/29] drm/rockchip: inno_hdmi: Move infoframe disable to separate function
        commit: cc9ec38cb2cd32518fe02615d004e96ce2fd0348
[15/29] drm/rockchip: inno_hdmi: Switch to infoframe type
        commit: 4278ff62b73936a9138b60cc0610381003132b77
[16/29] drm/rockchip: inno_hdmi: Remove unused drm device pointer
        commit: 153fe8dbd866869846af3a359ecf82d5ad9fe247
[17/29] drm/rockchip: inno_hdmi: Drop irq struct member
        commit: 073aa696f8cbc170a2c3502c2165aeb835be0156
[18/29] drm/rockchip: inno_hdmi: Remove useless include
        commit: f68a68fe9d9197ea6aa9cb461270685f370b165e
[19/29] drm/rockchip: inno_hdmi: Subclass connector state
        commit: ceeb0f0104a62c867656c2730a51df47e7350b8f
[20/29] drm/rockchip: inno_hdmi: Correctly setup HDMI quantization range
        commit: 164abbd2b7ef62aae6fc80450a2d085acdc3da3e
[21/29] drm/rockchip: inno_hdmi: Don't power up the phy after resetting
        commit: 71892cee6ceb3e1b88e0bb44b05c8397d8261a85
[22/29] drm/rockchip: inno_hdmi: Split power mode setting
        commit: f01e33cb586b5fd354cba73052f82c3b4246109d

Best regards,
Heiko Stübner Jan. 4, 2024, 8:14 a.m. UTC | #3
On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
> This is version 4 of my series that aims to add support for the display
> controller (VOP) and the HDMI controller block of RK3128 (which is very
> similar to the one found in RK3036). The original intention of this series
> was to add support for this slightly different integration but is by now,
> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
> driver in large parts. It is, however, a change for the better.
> 
> [...]

Applied, thanks!

[23/29] drm/rockchip: inno_hdmi: Add variant support
        commit: 5f2e93e6719701a91307090f8f7696fd6b3bffdf
[24/29] drm/rockchip: inno_hdmi: Add RK3128 support
        commit: aa54f334c291effe321aa4b9ac0e67a895fd7b58
[25/29] drm/rockchip: inno_hdmi: Add basic mode validation
        commit: 701029621d4141d0c9f8b81a88a37b95ec84ce65
[26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook
        commit: 50a3c772bd927dd409c484832ddd9f6bf00b7389


For reference, Rob has applied the rk3128 compatible in
https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/commit/?id=21960bda59852ca961fcd27fba9f92750caccd06


Best regards,
Alex Bee Jan. 5, 2024, 4:47 p.m. UTC | #4
Hi Heiko,


Am 04.01.24 um 09:14 schrieb Heiko Stuebner:
> On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
>> This is version 4 of my series that aims to add support for the display
>> controller (VOP) and the HDMI controller block of RK3128 (which is very
>> similar to the one found in RK3036). The original intention of this series
>> was to add support for this slightly different integration but is by now,
>> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
>> driver in large parts. It is, however, a change for the better.
>>
>> [...]
> Applied, thanks!
>
> [23/29] drm/rockchip: inno_hdmi: Add variant support
>          commit: 5f2e93e6719701a91307090f8f7696fd6b3bffdf
> [24/29] drm/rockchip: inno_hdmi: Add RK3128 support
>          commit: aa54f334c291effe321aa4b9ac0e67a895fd7b58
> [25/29] drm/rockchip: inno_hdmi: Add basic mode validation
>          commit: 701029621d4141d0c9f8b81a88a37b95ec84ce65
> [26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook
>          commit: 50a3c772bd927dd409c484832ddd9f6bf00b7389
>
>
> For reference, Rob has applied the rk3128 compatible in
> https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/commit/?id=21960bda59852ca961fcd27fba9f92750caccd06
thanks for keeping track on this.

Is there any reason the DT paches aren't merged yet? From what I can see
they should be fine to be merged in your v6.8-armsoc/dts32 branch which is
6.7-rc1 based. There was only a txt-binding at this point and it's very
likely that both the rockchip,inno-hdmi.yaml-conversion and the rk3128
additon will both land in 6.8 (they are both in linux-next). Linus' 6.8
merge-window will open earliest next week.
I'm really not pressuring here and I'm fine if they land in 6.9 - it's just
for my understanding for further submissions.

Alex

>
> Best regards,
Heiko Stübner Jan. 5, 2024, 5:02 p.m. UTC | #5
Am Freitag, 5. Januar 2024, 17:47:21 CET schrieb Alex Bee:
> Hi Heiko,
> 
> 
> Am 04.01.24 um 09:14 schrieb Heiko Stuebner:
> > On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
> >> This is version 4 of my series that aims to add support for the display
> >> controller (VOP) and the HDMI controller block of RK3128 (which is very
> >> similar to the one found in RK3036). The original intention of this series
> >> was to add support for this slightly different integration but is by now,
> >> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
> >> driver in large parts. It is, however, a change for the better.
> >>
> >> [...]
> > Applied, thanks!
> >
> > [23/29] drm/rockchip: inno_hdmi: Add variant support
> >          commit: 5f2e93e6719701a91307090f8f7696fd6b3bffdf
> > [24/29] drm/rockchip: inno_hdmi: Add RK3128 support
> >          commit: aa54f334c291effe321aa4b9ac0e67a895fd7b58
> > [25/29] drm/rockchip: inno_hdmi: Add basic mode validation
> >          commit: 701029621d4141d0c9f8b81a88a37b95ec84ce65
> > [26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook
> >          commit: 50a3c772bd927dd409c484832ddd9f6bf00b7389
> >
> >
> > For reference, Rob has applied the rk3128 compatible in
> > https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/commit/?id=21960bda59852ca961fcd27fba9f92750caccd06
> thanks for keeping track on this.
> 
> Is there any reason the DT paches aren't merged yet? From what I can see
> they should be fine to be merged in your v6.8-armsoc/dts32 branch which is
> 6.7-rc1 based. There was only a txt-binding at this point and it's very
> likely that both the rockchip,inno-hdmi.yaml-conversion and the rk3128
> additon will both land in 6.8 (they are both in linux-next). Linus' 6.8
> merge-window will open earliest next week.

Exactly ... and the arm subarchitectures (Rockchip, etc) feed into the
more generic soc-tree[0]  and from there in a set of pull requests.

Normally everything needs to go to the soc tree before -rc7 .
With the whole xmas stuff, I sent some stragglers in a second pull
request on monday, but that was already before Rob applied the
binding on tuesday.

So 6.8 devicetree stuff is essentially done and the dts patches
from this series will go in to 6.9 .


Hope that explains things a bit :-)
Heiko

[0] https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/

> I'm really not pressuring here and I'm fine if they land in 6.9 - it's just
> for my understanding for further submissions.
> 
> Alex
> 
> >
> > Best regards,
>
Alex Bee Jan. 5, 2024, 5:33 p.m. UTC | #6
Am 05.01.24 um 18:02 schrieb Heiko Stübner:
> Am Freitag, 5. Januar 2024, 17:47:21 CET schrieb Alex Bee:
>> Hi Heiko,
>>
>>
>> Am 04.01.24 um 09:14 schrieb Heiko Stuebner:
>>> On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
>>>> This is version 4 of my series that aims to add support for the display
>>>> controller (VOP) and the HDMI controller block of RK3128 (which is very
>>>> similar to the one found in RK3036). The original intention of this series
>>>> was to add support for this slightly different integration but is by now,
>>>> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
>>>> driver in large parts. It is, however, a change for the better.
>>>>
>>>> [...]
>>> Applied, thanks!
>>>
>>> [23/29] drm/rockchip: inno_hdmi: Add variant support
>>>           commit: 5f2e93e6719701a91307090f8f7696fd6b3bffdf
>>> [24/29] drm/rockchip: inno_hdmi: Add RK3128 support
>>>           commit: aa54f334c291effe321aa4b9ac0e67a895fd7b58
>>> [25/29] drm/rockchip: inno_hdmi: Add basic mode validation
>>>           commit: 701029621d4141d0c9f8b81a88a37b95ec84ce65
>>> [26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook
>>>           commit: 50a3c772bd927dd409c484832ddd9f6bf00b7389
>>>
>>>
>>> For reference, Rob has applied the rk3128 compatible in
>>> https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/commit/?id=21960bda59852ca961fcd27fba9f92750caccd06
>> thanks for keeping track on this.
>>
>> Is there any reason the DT paches aren't merged yet? From what I can see
>> they should be fine to be merged in your v6.8-armsoc/dts32 branch which is
>> 6.7-rc1 based. There was only a txt-binding at this point and it's very
>> likely that both the rockchip,inno-hdmi.yaml-conversion and the rk3128
>> additon will both land in 6.8 (they are both in linux-next). Linus' 6.8
>> merge-window will open earliest next week.
> Exactly ... and the arm subarchitectures (Rockchip, etc) feed into the
> more generic soc-tree[0]  and from there in a set of pull requests.
>
> Normally everything needs to go to the soc tree before -rc7 .
> With the whole xmas stuff, I sent some stragglers in a second pull
> request on monday, but that was already before Rob applied the
> binding on tuesday.
>
> So 6.8 devicetree stuff is essentially done and the dts patches
> from this series will go in to 6.9 .
>
>
> Hope that explains things a bit :-)
I assumed (for some reason) that sub-architecture maintainers are allowed
to send PRs to the respective upper tree until the merge window opens and
"all the rest" is done within this  ~2 weeks.
Thanks for explaining.

Alex
> Heiko
>
> [0] https://git.kernel.org/pub/scm/linux/kernel/git/soc/soc.git/
>
>> I'm really not pressuring here and I'm fine if they land in 6.9 - it's just
>> for my understanding for further submissions.
>>
>> Alex
>>
>>> Best regards,
>
>
>
Heiko Stübner Jan. 5, 2024, 5:50 p.m. UTC | #7
Am Freitag, 5. Januar 2024, 18:33:34 CET schrieb Alex Bee:
> 
> Am 05.01.24 um 18:02 schrieb Heiko Stübner:
> > Am Freitag, 5. Januar 2024, 17:47:21 CET schrieb Alex Bee:
> >> Hi Heiko,
> >>
> >>
> >> Am 04.01.24 um 09:14 schrieb Heiko Stuebner:
> >>> On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
> >>>> This is version 4 of my series that aims to add support for the display
> >>>> controller (VOP) and the HDMI controller block of RK3128 (which is very
> >>>> similar to the one found in RK3036). The original intention of this series
> >>>> was to add support for this slightly different integration but is by now,
> >>>> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
> >>>> driver in large parts. It is, however, a change for the better.
> >>>>
> >>>> [...]
> >>> Applied, thanks!
> >>>
> >>> [23/29] drm/rockchip: inno_hdmi: Add variant support
> >>>           commit: 5f2e93e6719701a91307090f8f7696fd6b3bffdf
> >>> [24/29] drm/rockchip: inno_hdmi: Add RK3128 support
> >>>           commit: aa54f334c291effe321aa4b9ac0e67a895fd7b58
> >>> [25/29] drm/rockchip: inno_hdmi: Add basic mode validation
> >>>           commit: 701029621d4141d0c9f8b81a88a37b95ec84ce65
> >>> [26/29] drm/rockchip: inno_hdmi: Drop custom fill_modes hook
> >>>           commit: 50a3c772bd927dd409c484832ddd9f6bf00b7389
> >>>
> >>>
> >>> For reference, Rob has applied the rk3128 compatible in
> >>> https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/commit/?id=21960bda59852ca961fcd27fba9f92750caccd06
> >> thanks for keeping track on this.
> >>
> >> Is there any reason the DT paches aren't merged yet? From what I can see
> >> they should be fine to be merged in your v6.8-armsoc/dts32 branch which is
> >> 6.7-rc1 based. There was only a txt-binding at this point and it's very
> >> likely that both the rockchip,inno-hdmi.yaml-conversion and the rk3128
> >> additon will both land in 6.8 (they are both in linux-next). Linus' 6.8
> >> merge-window will open earliest next week.
> > Exactly ... and the arm subarchitectures (Rockchip, etc) feed into the
> > more generic soc-tree[0]  and from there in a set of pull requests.
> >
> > Normally everything needs to go to the soc tree before -rc7 .
> > With the whole xmas stuff, I sent some stragglers in a second pull
> > request on monday, but that was already before Rob applied the
> > binding on tuesday.
> >
> > So 6.8 devicetree stuff is essentially done and the dts patches
> > from this series will go in to 6.9 .
> >
> >
> > Hope that explains things a bit :-)
> I assumed (for some reason) that sub-architecture maintainers are allowed
> to send PRs to the respective upper tree until the merge window opens and
> "all the rest" is done within this  ~2 weeks.
> Thanks for explaining.

No worries :-) .

The general rule of thumb is that everything should be done and ready
before the merge-window opens. Linus often writes very positively about
people sending him pull-requests even before the merge window opens ;-)
[meaning their tree is settled early and all test-robots have run]

And there are different rules in every tree.

For the soc tree the general rule of thumb of =< -rc7 - earlier with larger
changesets. On the other side drm-misc stays open all the time, but makes
a cut at -rc6. So everything targetted at v6.8 needs to be in before
v6.7-rc6.


Heiko
Heiko Stübner Jan. 25, 2024, 9:12 p.m. UTC | #8
On Fri, 22 Dec 2023 18:41:51 +0100, Alex Bee wrote:
> This is version 4 of my series that aims to add support for the display
> controller (VOP) and the HDMI controller block of RK3128 (which is very
> similar to the one found in RK3036). The original intention of this series
> was to add support for this slightly different integration but is by now,
> driven by maintainer's feedback, exploded to be a rework of inno-hdmi
> driver in large parts. It is, however, a change for the better.
> 
> [...]

Applied, thanks!

[27/29] ARM: dts: rockchip: Add display subsystem for RK3128
        commit: 695b9b57443d88a1c8e0567c88a79d1a4532c75e
[28/29] ARM: dts: rockchip: Add HDMI node for RK3128
        commit: 3fd6e33f8fde16869d4cd9cef71ca964b2b0789b
[29/29] ARM: dts: rockchip: Enable HDMI output for XPI-3128
        commit: 5aab66e319df2a6fc4ab06bcb4bd974c1ac4927e

Best regards,