mbox series

[PATCHv2,0/6] drm/omap: hdmi: improve hdmi4 CEC, add CEC for hdmi5

Message ID 20210302162403.983585-1-hverkuil-cisco@xs4all.nl (mailing list archive)
Headers show
Series drm/omap: hdmi: improve hdmi4 CEC, add CEC for hdmi5 | expand

Message

Hans Verkuil March 2, 2021, 4:23 p.m. UTC
This series improves the drm_bridge support for CEC by introducing two
new bridge ops in the first patch, and using those in the second patch.

This makes it possible to call cec_s_conn_info() and set
CEC_CAP_CONNECTOR_INFO for the CEC adapter, so userspace can associate
the CEC adapter with the corresponding DRM connector.

The third patch simplifies CEC physical address handling by using the
cec_s_phys_addr_from_edid helper function that didn't exist when this
code was originally written.

The fourth patch adds the cec clock to ti,omap5-dss.txt.

The fifth patch the missing cec clock to the dra7 and omap5 device tree,
and the last patch adds CEC support to the OMAP5 driver.

Tested with a Pandaboard and a Beagle X15 board.

Regards,

	Hans

Changes since v1:

- as per suggestion from Laurent, changed cec_init/exit to
  connector_attach/_detach which are just called for all
  bridges. The DRM_BRIDGE_OP_CEC was dropped.

- added patch to add the cec clock to ti,omap5-dss.txt

- swapped the order of the last two patches

- incorporated Tomi's suggestions for the hdmi5 CEC support.

Hans Verkuil (6):
  drm: drm_bridge: add connector_attach/detach bridge ops
  drm/omapdrm/dss/hdmi4: switch to the connector bridge ops
  drm/omapdrm/dss/hdmi4: simplify CEC Phys Addr handling
  dt-bindings: display: ti: ti,omap5-dss.txt: add cec clock
  dra7.dtsi/omap5.dtsi: add cec clock
  drm/omapdrm/dss/hdmi5: add CEC support

 .../bindings/display/ti/ti,omap5-dss.txt      |   4 +-
 arch/arm/boot/dts/dra7.dtsi                   |   5 +-
 arch/arm/boot/dts/omap5.dtsi                  |   5 +-
 drivers/gpu/drm/drm_bridge_connector.c        |   9 +
 drivers/gpu/drm/omapdrm/Kconfig               |   8 +
 drivers/gpu/drm/omapdrm/Makefile              |   1 +
 drivers/gpu/drm/omapdrm/dss/hdmi.h            |   1 +
 drivers/gpu/drm/omapdrm/dss/hdmi4.c           |  40 ++--
 drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c       |  13 +-
 drivers/gpu/drm/omapdrm/dss/hdmi4_cec.h       |  12 +-
 drivers/gpu/drm/omapdrm/dss/hdmi5.c           |  63 +++++-
 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c       | 209 ++++++++++++++++++
 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h       |  42 ++++
 drivers/gpu/drm/omapdrm/dss/hdmi5_core.c      |  35 ++-
 drivers/gpu/drm/omapdrm/dss/hdmi5_core.h      |  33 ++-
 include/drm/drm_bridge.h                      |  27 +++
 16 files changed, 453 insertions(+), 54 deletions(-)
 create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c
 create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h

Comments

H. Nikolaus Schaller Aug. 25, 2024, 8:31 p.m. UTC | #1
Hi,
CEC features are useful to e.g. control HDMI monitor standby.

But I wonder what happened to this series? 

I could find some reviewed-by: and acked-by: in [1] but it wasn't merged upstream
for unidentifiable reasons.

We apparently had merged this series some years ago into our LetuxOS distro kernel
and now we found it to be broken (NULL dereference) at least for omap5uevm
(and likely Pyra Handheld) after rebasing to v6.11-rc (it was already broken
since v6.9-rc1). Fixes were not difficult, but it would be better if it were
part of upstream.

BR and thanks,
Nikolaus

[1] https://lore.kernel.org/r/all/20210302162403.983585-4-hverkuil-cisco@xs4all.nl/T/

> Am 02.03.2021 um 17:23 schrieb Hans Verkuil <hverkuil-cisco@xs4all.nl>:
> 
> This series improves the drm_bridge support for CEC by introducing two
> new bridge ops in the first patch, and using those in the second patch.
> 
> This makes it possible to call cec_s_conn_info() and set
> CEC_CAP_CONNECTOR_INFO for the CEC adapter, so userspace can associate
> the CEC adapter with the corresponding DRM connector.
> 
> The third patch simplifies CEC physical address handling by using the
> cec_s_phys_addr_from_edid helper function that didn't exist when this
> code was originally written.
> 
> The fourth patch adds the cec clock to ti,omap5-dss.txt.
> 
> The fifth patch the missing cec clock to the dra7 and omap5 device tree,
> and the last patch adds CEC support to the OMAP5 driver.
> 
> Tested with a Pandaboard and a Beagle X15 board.
> 
> Regards,
> 
> Hans
> 
> Changes since v1:
> 
> - as per suggestion from Laurent, changed cec_init/exit to
>  connector_attach/_detach which are just called for all
>  bridges. The DRM_BRIDGE_OP_CEC was dropped.
> 
> - added patch to add the cec clock to ti,omap5-dss.txt
> 
> - swapped the order of the last two patches
> 
> - incorporated Tomi's suggestions for the hdmi5 CEC support.
> 
> Hans Verkuil (6):
>  drm: drm_bridge: add connector_attach/detach bridge ops
>  drm/omapdrm/dss/hdmi4: switch to the connector bridge ops
>  drm/omapdrm/dss/hdmi4: simplify CEC Phys Addr handling
>  dt-bindings: display: ti: ti,omap5-dss.txt: add cec clock
>  dra7.dtsi/omap5.dtsi: add cec clock
>  drm/omapdrm/dss/hdmi5: add CEC support
> 
> .../bindings/display/ti/ti,omap5-dss.txt      |   4 +-
> arch/arm/boot/dts/dra7.dtsi                   |   5 +-
> arch/arm/boot/dts/omap5.dtsi                  |   5 +-
> drivers/gpu/drm/drm_bridge_connector.c        |   9 +
> drivers/gpu/drm/omapdrm/Kconfig               |   8 +
> drivers/gpu/drm/omapdrm/Makefile              |   1 +
> drivers/gpu/drm/omapdrm/dss/hdmi.h            |   1 +
> drivers/gpu/drm/omapdrm/dss/hdmi4.c           |  40 ++--
> drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c       |  13 +-
> drivers/gpu/drm/omapdrm/dss/hdmi4_cec.h       |  12 +-
> drivers/gpu/drm/omapdrm/dss/hdmi5.c           |  63 +++++-
> drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c       | 209 ++++++++++++++++++
> drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h       |  42 ++++
> drivers/gpu/drm/omapdrm/dss/hdmi5_core.c      |  35 ++-
> drivers/gpu/drm/omapdrm/dss/hdmi5_core.h      |  33 ++-
> include/drm/drm_bridge.h                      |  27 +++
> 16 files changed, 453 insertions(+), 54 deletions(-)
> create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c
> create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h
> 
> -- 
> 2.30.1
>
Tomi Valkeinen Aug. 28, 2024, 1:57 p.m. UTC | #2
Hi,

On 25/08/2024 23:31, H. Nikolaus Schaller wrote:
> Hi,
> CEC features are useful to e.g. control HDMI monitor standby.
> 
> But I wonder what happened to this series?
> 
> I could find some reviewed-by: and acked-by: in [1] but it wasn't merged upstream
> for unidentifiable reasons.
> 
> We apparently had merged this series some years ago into our LetuxOS distro kernel
> and now we found it to be broken (NULL dereference) at least for omap5uevm
> (and likely Pyra Handheld) after rebasing to v6.11-rc (it was already broken
> since v6.9-rc1). Fixes were not difficult, but it would be better if it were
> part of upstream.

There was a v3:

20210428132545.1205162-1-hverkuil-cisco@xs4all.nl

I see there was a concern from Laurent in:

YLjMZiX71mcQNQdO@pendragon.ideasonboard.com

And we need an ack from the bridge maintainers for the drm_bridge parts. 
But the series is three years old, so I think someone would have to 
rebase on top of mainline and re-test and re-send first.

  Tomi

> BR and thanks,
> Nikolaus
> 
> [1] https://lore.kernel.org/r/all/20210302162403.983585-4-hverkuil-cisco@xs4all.nl/T/
> 
>> Am 02.03.2021 um 17:23 schrieb Hans Verkuil <hverkuil-cisco@xs4all.nl>:
>>
>> This series improves the drm_bridge support for CEC by introducing two
>> new bridge ops in the first patch, and using those in the second patch.
>>
>> This makes it possible to call cec_s_conn_info() and set
>> CEC_CAP_CONNECTOR_INFO for the CEC adapter, so userspace can associate
>> the CEC adapter with the corresponding DRM connector.
>>
>> The third patch simplifies CEC physical address handling by using the
>> cec_s_phys_addr_from_edid helper function that didn't exist when this
>> code was originally written.
>>
>> The fourth patch adds the cec clock to ti,omap5-dss.txt.
>>
>> The fifth patch the missing cec clock to the dra7 and omap5 device tree,
>> and the last patch adds CEC support to the OMAP5 driver.
>>
>> Tested with a Pandaboard and a Beagle X15 board.
>>
>> Regards,
>>
>> Hans
>>
>> Changes since v1:
>>
>> - as per suggestion from Laurent, changed cec_init/exit to
>>   connector_attach/_detach which are just called for all
>>   bridges. The DRM_BRIDGE_OP_CEC was dropped.
>>
>> - added patch to add the cec clock to ti,omap5-dss.txt
>>
>> - swapped the order of the last two patches
>>
>> - incorporated Tomi's suggestions for the hdmi5 CEC support.
>>
>> Hans Verkuil (6):
>>   drm: drm_bridge: add connector_attach/detach bridge ops
>>   drm/omapdrm/dss/hdmi4: switch to the connector bridge ops
>>   drm/omapdrm/dss/hdmi4: simplify CEC Phys Addr handling
>>   dt-bindings: display: ti: ti,omap5-dss.txt: add cec clock
>>   dra7.dtsi/omap5.dtsi: add cec clock
>>   drm/omapdrm/dss/hdmi5: add CEC support
>>
>> .../bindings/display/ti/ti,omap5-dss.txt      |   4 +-
>> arch/arm/boot/dts/dra7.dtsi                   |   5 +-
>> arch/arm/boot/dts/omap5.dtsi                  |   5 +-
>> drivers/gpu/drm/drm_bridge_connector.c        |   9 +
>> drivers/gpu/drm/omapdrm/Kconfig               |   8 +
>> drivers/gpu/drm/omapdrm/Makefile              |   1 +
>> drivers/gpu/drm/omapdrm/dss/hdmi.h            |   1 +
>> drivers/gpu/drm/omapdrm/dss/hdmi4.c           |  40 ++--
>> drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c       |  13 +-
>> drivers/gpu/drm/omapdrm/dss/hdmi4_cec.h       |  12 +-
>> drivers/gpu/drm/omapdrm/dss/hdmi5.c           |  63 +++++-
>> drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c       | 209 ++++++++++++++++++
>> drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h       |  42 ++++
>> drivers/gpu/drm/omapdrm/dss/hdmi5_core.c      |  35 ++-
>> drivers/gpu/drm/omapdrm/dss/hdmi5_core.h      |  33 ++-
>> include/drm/drm_bridge.h                      |  27 +++
>> 16 files changed, 453 insertions(+), 54 deletions(-)
>> create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c
>> create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h
>>
>> -- 
>> 2.30.1
>>
>
Hans Verkuil Aug. 28, 2024, 2:14 p.m. UTC | #3
On 28/08/2024 15:57, Tomi Valkeinen wrote:
> Hi,
> 
> On 25/08/2024 23:31, H. Nikolaus Schaller wrote:
>> Hi,
>> CEC features are useful to e.g. control HDMI monitor standby.
>>
>> But I wonder what happened to this series?
>>
>> I could find some reviewed-by: and acked-by: in [1] but it wasn't merged upstream
>> for unidentifiable reasons.
>>
>> We apparently had merged this series some years ago into our LetuxOS distro kernel
>> and now we found it to be broken (NULL dereference) at least for omap5uevm
>> (and likely Pyra Handheld) after rebasing to v6.11-rc (it was already broken
>> since v6.9-rc1). Fixes were not difficult, but it would be better if it were
>> part of upstream.
> 
> There was a v3:
> 
> 20210428132545.1205162-1-hverkuil-cisco@xs4all.nl
> 
> I see there was a concern from Laurent in:
> 
> YLjMZiX71mcQNQdO@pendragon.ideasonboard.com
> 
> And we need an ack from the bridge maintainers for the drm_bridge parts. But the series is three years old, so I think someone would have to rebase on top of mainline and re-test and re-send first.

I never really followed up with this. I still have the hardware, it is primarily
time. And also that for me this is quite low priority since I don't use omap5.

If someone wants to refresh this series and post it, then I would have no problem
with it.

Regards,

	Hans

> 
>  Tomi
> 
>> BR and thanks,
>> Nikolaus
>>
>> [1] https://lore.kernel.org/r/all/20210302162403.983585-4-hverkuil-cisco@xs4all.nl/T/
>>
>>> Am 02.03.2021 um 17:23 schrieb Hans Verkuil <hverkuil-cisco@xs4all.nl>:
>>>
>>> This series improves the drm_bridge support for CEC by introducing two
>>> new bridge ops in the first patch, and using those in the second patch.
>>>
>>> This makes it possible to call cec_s_conn_info() and set
>>> CEC_CAP_CONNECTOR_INFO for the CEC adapter, so userspace can associate
>>> the CEC adapter with the corresponding DRM connector.
>>>
>>> The third patch simplifies CEC physical address handling by using the
>>> cec_s_phys_addr_from_edid helper function that didn't exist when this
>>> code was originally written.
>>>
>>> The fourth patch adds the cec clock to ti,omap5-dss.txt.
>>>
>>> The fifth patch the missing cec clock to the dra7 and omap5 device tree,
>>> and the last patch adds CEC support to the OMAP5 driver.
>>>
>>> Tested with a Pandaboard and a Beagle X15 board.
>>>
>>> Regards,
>>>
>>> Hans
>>>
>>> Changes since v1:
>>>
>>> - as per suggestion from Laurent, changed cec_init/exit to
>>>   connector_attach/_detach which are just called for all
>>>   bridges. The DRM_BRIDGE_OP_CEC was dropped.
>>>
>>> - added patch to add the cec clock to ti,omap5-dss.txt
>>>
>>> - swapped the order of the last two patches
>>>
>>> - incorporated Tomi's suggestions for the hdmi5 CEC support.
>>>
>>> Hans Verkuil (6):
>>>   drm: drm_bridge: add connector_attach/detach bridge ops
>>>   drm/omapdrm/dss/hdmi4: switch to the connector bridge ops
>>>   drm/omapdrm/dss/hdmi4: simplify CEC Phys Addr handling
>>>   dt-bindings: display: ti: ti,omap5-dss.txt: add cec clock
>>>   dra7.dtsi/omap5.dtsi: add cec clock
>>>   drm/omapdrm/dss/hdmi5: add CEC support
>>>
>>> .../bindings/display/ti/ti,omap5-dss.txt      |   4 +-
>>> arch/arm/boot/dts/dra7.dtsi                   |   5 +-
>>> arch/arm/boot/dts/omap5.dtsi                  |   5 +-
>>> drivers/gpu/drm/drm_bridge_connector.c        |   9 +
>>> drivers/gpu/drm/omapdrm/Kconfig               |   8 +
>>> drivers/gpu/drm/omapdrm/Makefile              |   1 +
>>> drivers/gpu/drm/omapdrm/dss/hdmi.h            |   1 +
>>> drivers/gpu/drm/omapdrm/dss/hdmi4.c           |  40 ++--
>>> drivers/gpu/drm/omapdrm/dss/hdmi4_cec.c       |  13 +-
>>> drivers/gpu/drm/omapdrm/dss/hdmi4_cec.h       |  12 +-
>>> drivers/gpu/drm/omapdrm/dss/hdmi5.c           |  63 +++++-
>>> drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c       | 209 ++++++++++++++++++
>>> drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h       |  42 ++++
>>> drivers/gpu/drm/omapdrm/dss/hdmi5_core.c      |  35 ++-
>>> drivers/gpu/drm/omapdrm/dss/hdmi5_core.h      |  33 ++-
>>> include/drm/drm_bridge.h                      |  27 +++
>>> 16 files changed, 453 insertions(+), 54 deletions(-)
>>> create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.c
>>> create mode 100644 drivers/gpu/drm/omapdrm/dss/hdmi5_cec.h
>>>
>>> -- 
>>> 2.30.1
>>>
>>
>
H. Nikolaus Schaller Aug. 28, 2024, 7:41 p.m. UTC | #4
Hi all,

> Am 28.08.2024 um 16:14 schrieb Hans Verkuil <hverkuil-cisco@xs4all.nl>:
> 
> On 28/08/2024 15:57, Tomi Valkeinen wrote:
>> Hi,
>> 
>> On 25/08/2024 23:31, H. Nikolaus Schaller wrote:
>>> Hi,
>>> CEC features are useful to e.g. control HDMI monitor standby.
>>> 
>>> But I wonder what happened to this series?
>>> 
>>> I could find some reviewed-by: and acked-by: in [1] but it wasn't merged upstream
>>> for unidentifiable reasons.
>>> 
>>> We apparently had merged this series some years ago into our LetuxOS distro kernel
>>> and now we found it to be broken (NULL dereference) at least for omap5uevm
>>> (and likely Pyra Handheld) after rebasing to v6.11-rc (it was already broken
>>> since v6.9-rc1). Fixes were not difficult, but it would be better if it were
>>> part of upstream.
>> 
>> There was a v3:
>> 
>> 20210428132545.1205162-1-hverkuil-cisco@xs4all.nl

[A clickable link is here: https://lore.kernel.org/linux-media/20210428132545.1205162-1-hverkuil-cisco@xs4all.nl/ ]

Ah, I see. It wasn't sent to linux-omap so I didn't recognise/find it in my mails
or omap-patchwork.


>> I see there was a concern from Laurent in:
>> 
>> YLjMZiX71mcQNQdO@pendragon.ideasonboard.com

Well, he didn't reject it although he had concerns, but I am not experienced with what
he is talking about for a proper solution...

>> 
>> And we need an ack from the bridge maintainers for the drm_bridge parts. But the series is three years old, so I think someone would have to rebase on top of mainline and re-test and re-send first.
> 
> I never really followed up with this. I still have the hardware, it is primarily
> time. And also that for me this is quite low priority since I don't use omap5.
> 
> If someone wants to refresh this series and post it, then I would have no problem
> with it.

A far as I see it just needs a rebase - I guess on linux-next (or drm-misc?) and some
compile fixes I already have implemented for our distro kernel.

So if you agree I could work on it, test on omap4&5 and submit a v4 and hope that you
can jump in and support for the discussion. I would keep you (Hans) as commit author
and just add a signed-off: and tested-by:

But I will also need some time...

BR and thanks,
Nikolaus
Hans Verkuil Aug. 29, 2024, 7:45 a.m. UTC | #5
On 28/08/2024 21:41, H. Nikolaus Schaller wrote:
> Hi all,
> 
>> Am 28.08.2024 um 16:14 schrieb Hans Verkuil <hverkuil-cisco@xs4all.nl>:
>>
>> On 28/08/2024 15:57, Tomi Valkeinen wrote:
>>> Hi,
>>>
>>> On 25/08/2024 23:31, H. Nikolaus Schaller wrote:
>>>> Hi,
>>>> CEC features are useful to e.g. control HDMI monitor standby.
>>>>
>>>> But I wonder what happened to this series?
>>>>
>>>> I could find some reviewed-by: and acked-by: in [1] but it wasn't merged upstream
>>>> for unidentifiable reasons.
>>>>
>>>> We apparently had merged this series some years ago into our LetuxOS distro kernel
>>>> and now we found it to be broken (NULL dereference) at least for omap5uevm
>>>> (and likely Pyra Handheld) after rebasing to v6.11-rc (it was already broken
>>>> since v6.9-rc1). Fixes were not difficult, but it would be better if it were
>>>> part of upstream.
>>>
>>> There was a v3:
>>>
>>> 20210428132545.1205162-1-hverkuil-cisco@xs4all.nl
> 
> [A clickable link is here: https://lore.kernel.org/linux-media/20210428132545.1205162-1-hverkuil-cisco@xs4all.nl/ ]
> 
> Ah, I see. It wasn't sent to linux-omap so I didn't recognise/find it in my mails
> or omap-patchwork.
> 
> 
>>> I see there was a concern from Laurent in:
>>>
>>> YLjMZiX71mcQNQdO@pendragon.ideasonboard.com
> 
> Well, he didn't reject it although he had concerns, but I am not experienced with what
> he is talking about for a proper solution...
> 
>>>
>>> And we need an ack from the bridge maintainers for the drm_bridge parts. But the series is three years old, so I think someone would have to rebase on top of mainline and re-test and re-send first.
>>
>> I never really followed up with this. I still have the hardware, it is primarily
>> time. And also that for me this is quite low priority since I don't use omap5.
>>
>> If someone wants to refresh this series and post it, then I would have no problem
>> with it.
> 
> A far as I see it just needs a rebase - I guess on linux-next (or drm-misc?) and some
> compile fixes I already have implemented for our distro kernel.
> 
> So if you agree I could work on it, test on omap4&5 and submit a v4 and hope that you
> can jump in and support for the discussion. I would keep you (Hans) as commit author
> and just add a signed-off: and tested-by:

That would be fine.

For what it is worth, the last version I have is this one from 3 years ago:

https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=omap-bridge-cec

I haven't looked at it since.

Regards,

	Hans

> 
> But I will also need some time...
> 
> BR and thanks,
> Nikolaus
>