Skip to contentSkip to conversation

R-Car DU changes

GIT PULL Laurent Pinchart 6 participants 11 messages Nov 7, 2014 – Nov 25, 2014

lore
Share & tools
lore
#0 lore raw

Hi Dave,

Here's a pull request that adds HDMI support to the R-Car DU driver, including a new slave encoder driver for the adv7511.

The branch is based on a merge of drm-next and Simon's tags/renesas-dt-du-for- v3.19 available at
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git, for which a pull request has been submitted for v3.19 to the ARM SoC maintainers.

I'm leaving now for two weeks of holidays and would like to avoid missing the merge window. Simon, could you please confirm that tags/renesas-dt-du-for- v3.19 is stable and ack this pull request (and possibly ping Dave on my behalf ;-)) ?

The following changes since commit 19de43d4dea8712b3574d72d3d8aa16cd17e7fed:

Merge tag 'tags/renesas-dt-du-for-v3.19' into drm/next/adv7511-base
(2014-11-07 08:06:16 +0200)

are available in the git repository at:

git://linuxtv.org/pinchartl/fbdev.git

for you to fetch changes up to cc47927ca851110d2c387a7d9fd7086112abb92e:

drm: Add adv7511 encoder driver (2014-11-07 08:19:06 +0200)

----------------------------------------------------------------
Lars-Peter Clausen (2):
drm: Decouple EDID parsing from I2C adapter
drm: Add adv7511 encoder driver

Laurent Pinchart (6):
drm: rcar-du: Remove platform data support
drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()
drm: rcar-du: Replace direct DRM encoder access with cast macro
drm: rcar-du: Replace drm_encoder with drm_slave_encoder
drm: rcar-du: Add HDMI encoder and connector support
video: Add ADV751[13] DT bindings documentation

 Documentation/devicetree/bindings/video/adi,adv7511.txt |   88 ++
 drivers/gpu/drm/drm_edid.c                              |   27 +-
 drivers/gpu/drm/i2c/Kconfig                             |    6 +
 drivers/gpu/drm/i2c/Makefile                            |    2 +
 drivers/gpu/drm/i2c/adv7511.c                           | 1010 ++++++++++++++
 drivers/gpu/drm/i2c/adv7511.h                           |  289 +++++++
 drivers/gpu/drm/rcar-du/Kconfig                         |   11 +-
 drivers/gpu/drm/rcar-du/Makefile                        |    2 +
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h                  |   10 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c                   |    4 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.h                   |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c               |   45 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h               |   23 +-
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c               |  118 +++
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h               |   31 +
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c               |  151 ++++
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h               |   35 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c                   |   53 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c               |   31 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h               |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h               |    1 -
 drivers/gpu/drm/rcar-du/rcar_du_vgacon.c                |    5 +-
 include/drm/drm_edid.h                                  |    5 +
 include/linux/platform_data/rcar-du.h                   |   74 --
 24 files changed, 1845 insertions(+), 180 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/video/adi,adv7511.txt
 create mode 100644 drivers/gpu/drm/i2c/adv7511.c
 create mode 100644 drivers/gpu/drm/i2c/adv7511.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h
 delete mode 100644 include/linux/platform_data/rcar-du.h
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 24 lines · Laurent Pinchart

Hi Dave,

Here's a pull request that adds HDMI support to the R-Car DU driver, including a new slave encoder driver for the adv7511.

The branch is based on a merge of drm-next and Simon's tags/renesas-dt-du-for- v3.19 available at
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git, for which a pull request has been submitted for v3.19 to the ARM SoC maintainers.

I'm leaving now for two weeks of holidays and would like to avoid missing the merge window. Simon, could you please confirm that tags/renesas-dt-du-for- v3.19 is stable and ack this pull request (and possibly ping Dave on my behalf ;-)) ?

The following changes since commit 19de43d4dea8712b3574d72d3d8aa16cd17e7fed:

Merge tag 'tags/renesas-dt-du-for-v3.19' into drm/next/adv7511-base
(2014-11-07 08:06:16 +0200)

are available in the git repository at:

git://linuxtv.org/pinchartl/fbdev.git

Quoted 7 lines

for you to fetch changes up to cc47927ca851110d2c387a7d9fd7086112abb92e:

drm: Add adv7511 encoder driver (2014-11-07 08:19:06 +0200)

----------------------------------------------------------------
Lars-Peter Clausen (2):
drm: Decouple EDID parsing from I2C adapter

So somehow the pull request seems to lack the branch so I can't actually take a lookc. But this patch here seems to lack review:
- kerneldoc for the newly exported function is missing
- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make it work. Or you have other magic means to optain an edid block, in which case just do that and then feed the edid drm_add_edid_modes.

Nack from me in this form. And can we try not to be quite this sneaky with drm core patches going in through driver trees, please?

Thanks, Daniel

Quoted 53 lines

drm: Add adv7511 encoder driver

Laurent Pinchart (6):
drm: rcar-du: Remove platform data support
drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()
drm: rcar-du: Replace direct DRM encoder access with cast macro
drm: rcar-du: Replace drm_encoder with drm_slave_encoder
drm: rcar-du: Add HDMI encoder and connector support
video: Add ADV751[13] DT bindings documentation

 Documentation/devicetree/bindings/video/adi,adv7511.txt |   88 ++
 drivers/gpu/drm/drm_edid.c                              |   27 +-
 drivers/gpu/drm/i2c/Kconfig                             |    6 +
 drivers/gpu/drm/i2c/Makefile                            |    2 +
 drivers/gpu/drm/i2c/adv7511.c                           | 1010 ++++++++++++++
 drivers/gpu/drm/i2c/adv7511.h                           |  289 +++++++
 drivers/gpu/drm/rcar-du/Kconfig                         |   11 +-
 drivers/gpu/drm/rcar-du/Makefile                        |    2 +
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h                  |   10 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c                   |    4 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.h                   |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c               |   45 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h               |   23 +-
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c               |  118 +++
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h               |   31 +
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c               |  151 ++++
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h               |   35 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c                   |   53 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c               |   31 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h               |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h               |    1 -
 drivers/gpu/drm/rcar-du/rcar_du_vgacon.c                |    5 +-
 include/drm/drm_edid.h                                  |    5 +
 include/linux/platform_data/rcar-du.h                   |   74 --
 24 files changed, 1845 insertions(+), 180 deletions(-)
 create mode 100644 Documentation/devicetree/bindings/video/adi,adv7511.txt
 create mode 100644 drivers/gpu/drm/i2c/adv7511.c
 create mode 100644 drivers/gpu/drm/i2c/adv7511.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h
 delete mode 100644 include/linux/platform_data/rcar-du.h
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

Hi Daniel,

Thank you for the review.

Quoted 11 lines · On Friday 07 November 2014 10:19:14 Daniel Vetter wrote:
Quoted 10 lines · Laurent Pinchart

Hi Dave,

Here's a pull request that adds HDMI support to the R-Car DU driver, including a new slave encoder driver for the adv7511.

The branch is based on a merge of drm-next and Simon's tags/renesas-dt-du-for- v3.19 available at
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git, for which a pull request has been submitted for v3.19 to the ARM SoC maintainers.

Quoted 6 lines
Quoted 6 lines

I'm leaving now for two weeks of holidays and would like to avoid missing the merge window. Simon, could you please confirm that tags/renesas-dt-du-for- v3.19 is stable and ack this pull request (and possibly ping Dave on my behalf ;-)) ?

The following changes since commit

19de43d4dea8712b3574d72d3d8aa16cd17e7fed:

Quoted 10 lines
Quoted 10 lines

Merge tag 'tags/renesas-dt-du-for-v3.19' into drm/next/adv7511-base

(2014-11-07 08:06:16 +0200)

are available in the git repository at:
git://linuxtv.org/pinchartl/fbdev.git

for you to fetch changes up to cc47927ca851110d2c387a7d9fd7086112abb92e:
drm: Add adv7511 encoder driver (2014-11-07 08:19:06 +0200)

Quoted 7 lines
Quoted 4 lines

----------------------------------------------------------------

Lars-Peter Clausen (2):
drm: Decouple EDID parsing from I2C adapter

So somehow the pull request seems to lack the branch so I can't actually take a lookc.

git request-pull is playing trick with me :-/ I'll try to fix that.

The branch is available at

git://linuxtv.org/pinchartl/fbdev.git drm/next/du

(http://git.linuxtv.org/cgit.cgi/pinchartl/fbdev.git/commit/?h=drm/next/du)

Quoted 2 lines

But this patch here seems to lack review:
- kerneldoc for the newly exported function is missing

I'll fix that.

Quoted 4 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make it work. Or you have other magic means to optain an edid block, in which case just do that and then feed the edid drm_add_edid_modes.

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 49 lines

Nack from me in this form. And can we try not to be quite this sneaky with drm core patches going in through driver trees, please?

Thanks, Daniel

Quoted 44 lines

drm: Add adv7511 encoder driver

Laurent Pinchart (6):
drm: rcar-du: Remove platform data support
drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()
drm: rcar-du: Replace direct DRM encoder access with cast macro
drm: rcar-du: Replace drm_encoder with drm_slave_encoder
drm: rcar-du: Add HDMI encoder and connector support
video: Add ADV751[13] DT bindings documentation

 Documentation/devicetree/bindings/video/adi,adv7511.txt |   88 ++
 drivers/gpu/drm/drm_edid.c                              |   27 +-
 drivers/gpu/drm/i2c/Kconfig                             |    6 +
 drivers/gpu/drm/i2c/Makefile                            |    2 +
 drivers/gpu/drm/i2c/adv7511.c                           | 1010 ++++++++++
 drivers/gpu/drm/i2c/adv7511.h                           |  289 +++++++
 drivers/gpu/drm/rcar-du/Kconfig                         |   11 +-
 drivers/gpu/drm/rcar-du/Makefile                        |    2 +
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h                  |   10 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c                   |    4 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.h                   |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c               |   45 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h               |   23 +-
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c               |  118 +++
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h               |   31 +
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c               |  151 ++++
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h               |   35 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c                   |   53 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c               |   31 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h               |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h               |    1 -
 drivers/gpu/drm/rcar-du/rcar_du_vgacon.c                |    5 +-
 include/drm/drm_edid.h                                  |    5 +
 include/linux/platform_data/rcar-du.h                   |   74 --
 24 files changed, 1845 insertions(+), 180 deletions(-)
 create mode 100644
 Documentation/devicetree/bindings/video/adi,adv7511.txt
 create mode 100644 drivers/gpu/drm/i2c/adv7511.c
 create mode 100644 drivers/gpu/drm/i2c/adv7511.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h
 delete mode 100644 include/linux/platform_data/rcar-du.h
Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw
Quoted 5 lines · Laurent Pinchart
Quoted 4 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make it work. Or you have other magic means to optain an edid block, in which case just do that and then feed the edid drm_add_edid_modes.

Quoted 7 lines

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Sounds familiar. See the special ddc-over-sdvo i2c bus we register in intel_sdvo.c, specifically look at intel_sdvo_init_ddc_proxy. It is a bit of boilerplate, but in the end just amounts to 3 small functions and one tiny vtable to wire it all up cleanly.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

Hi Daniel,

(CC'ing Rob Clark and Lars-Peter. As a reminder we're discussing the "drm:
Decouple EDID parsing from I2C adapter" patch available at
git://linuxtv.org/pinchartl/fbdev.git drm/next/du)

Quoted 14 lines · On Monday 24 November 2014 14:09:39 Daniel Vetter wrote:
Quoted 5 lines · Laurent Pinchart
Quoted 4 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make it work. Or you have other magic means to optain an edid block, in which case just do that and then feed the edid drm_add_edid_modes.

Quoted 7 lines

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 4 lines

Sounds familiar. See the special ddc-over-sdvo i2c bus we register in intel_sdvo.c, specifically look at intel_sdvo_init_ddc_proxy. It is a bit of boilerplate, but in the end just amounts to 3 small functions and one tiny vtable to wire it all up cleanly.

That's what I would have done as well if I had a device-specific I2C adapter connected to the DDC bus, but in this case the interface exposed by the ADV7511 to the SoC over I2C consists of higher level device-specific I2C commands to read EDID data. There is no low-level I2C read/write primitives available. I would thus need to expose a fake adapter that would receive I2C commands, parse them to detect an EDID block read, retrieve the EDID data and return them from the fake read. That doesn't make much sense to me.

Signature · 8 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw
Quoted 26 lines · Laurent Pinchart

Hi Daniel,

(CC'ing Rob Clark and Lars-Peter. As a reminder we're discussing the "drm:
Decouple EDID parsing from I2C adapter" patch available at
git://linuxtv.org/pinchartl/fbdev.git drm/next/du)

Quoted 14 lines · On Monday 24 November 2014 14:09:39 Daniel Vetter wrote:
Quoted 5 lines · Laurent Pinchart
Quoted 4 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make it work. Or you have other magic means to optain an edid block, in which case just do that and then feed the edid drm_add_edid_modes.

Quoted 7 lines

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 4 lines

Sounds familiar. See the special ddc-over-sdvo i2c bus we register in intel_sdvo.c, specifically look at intel_sdvo_init_ddc_proxy. It is a bit of boilerplate, but in the end just amounts to 3 small functions and one tiny vtable to wire it all up cleanly.

Quoted 7 lines

That's what I would have done as well if I had a device-specific I2C adapter connected to the DDC bus, but in this case the interface exposed by the ADV7511 to the SoC over I2C consists of higher level device-specific I2C commands to read EDID data. There is no low-level I2C read/write primitives available. I would thus need to expose a fake adapter that would receive I2C commands, parse them to detect an EDID block read, retrieve the EDID data and return them from the fake read. That doesn't make much sense to me.

The intel sdvo looks just like a simple I2C mux which will just pass-through messages from the master to the EDID EEPROM. The ADV7511 is unfortunately a bit different. You tell it to fetch the EDID information, then it will do some magic and then you can read the EDID back. Abstracting this as a this as a I2C controller will, while possible, result in a fair amount of boiler plate code that will not look particularly pretty.

- Lars

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#6 lore raw
Quoted 50 lines · Lars-Peter Clausen
Quoted 36 lines · Laurent Pinchart

Hi Daniel,

(CC'ing Rob Clark and Lars-Peter. As a reminder we're discussing the "drm:
Decouple EDID parsing from I2C adapter" patch available at
git://linuxtv.org/pinchartl/fbdev.git drm/next/du)

Quoted 22 lines · On Monday 24 November 2014 14:09:39 Daniel Vetter wrote:
Quoted 9 lines · Laurent Pinchart
Quoted 7 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make
it
work. Or you have other magic means to optain an edid block, in
which
case just do that and then feed the edid drm_add_edid_modes.

Quoted 9 lines

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls
the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 4 lines

Sounds familiar. See the special ddc-over-sdvo i2c bus we register in intel_sdvo.c, specifically look at intel_sdvo_init_ddc_proxy. It is a bit of boilerplate, but in the end just amounts to 3 small functions and one tiny vtable to wire it all up cleanly.

Quoted 11 lines

That's what I would have done as well if I had a device-specific I2C adapter
connected to the DDC bus, but in this case the interface exposed by the ADV7511 to the SoC over I2C consists of higher level device-specific I2C commands to read EDID data. There is no low-level I2C read/write primitives
available. I would thus need to expose a fake adapter that would receive I2C
commands, parse them to detect an EDID block read, retrieve the EDID data and
return them from the fake read. That doesn't make much sense to me.

Quoted 6 lines

The intel sdvo looks just like a simple I2C mux which will just pass-through messages from the master to the EDID EEPROM. The ADV7511 is unfortunately a bit different. You tell it to fetch the EDID information, then it will do some magic and then you can read the EDID back. Abstracting this as a this as a I2C controller will, while possible, result in a fair amount of boiler plate code that will not look particularly pretty.

It sounds also a bit like DP auxch also, or even how on UDL we get the edid over USB.

I'd rather see not pretty code that only one person had to look at though :-) with lots of comments on the hw design that demands ugly.

Dave.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#7 lore raw
Quoted 58 lines · Dave Airlie
Quoted 50 lines · Lars-Peter Clausen
Quoted 36 lines · Laurent Pinchart

Hi Daniel,

(CC'ing Rob Clark and Lars-Peter. As a reminder we're discussing the "drm:
Decouple EDID parsing from I2C adapter" patch available at
git://linuxtv.org/pinchartl/fbdev.git drm/next/du)

Quoted 22 lines · On Monday 24 November 2014 14:09:39 Daniel Vetter wrote:
Quoted 9 lines · Laurent Pinchart
Quoted 7 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make
it
work. Or you have other magic means to optain an edid block, in
which
case just do that and then feed the edid drm_add_edid_modes.

Quoted 9 lines

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls
the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 4 lines

Sounds familiar. See the special ddc-over-sdvo i2c bus we register in intel_sdvo.c, specifically look at intel_sdvo_init_ddc_proxy. It is a bit of boilerplate, but in the end just amounts to 3 small functions and one tiny vtable to wire it all up cleanly.

Quoted 11 lines

That's what I would have done as well if I had a device-specific I2C adapter
connected to the DDC bus, but in this case the interface exposed by the ADV7511 to the SoC over I2C consists of higher level device-specific I2C commands to read EDID data. There is no low-level I2C read/write primitives
available. I would thus need to expose a fake adapter that would receive I2C
commands, parse them to detect an EDID block read, retrieve the EDID data and
return them from the fake read. That doesn't make much sense to me.

Quoted 6 lines

The intel sdvo looks just like a simple I2C mux which will just pass-through messages from the master to the EDID EEPROM. The ADV7511 is unfortunately a bit different. You tell it to fetch the EDID information, then it will do some magic and then you can read the EDID back. Abstracting this as a this as a I2C controller will, while possible, result in a fair amount of boiler plate code that will not look particularly pretty.

Quoted 5 lines

It sounds also a bit like DP auxch also, or even how on UDL we get the edid over USB.

I'd rather see not pretty code that only one person had to look at though :-) with lots of comments on the hw design that demands ugly.

I'd rather not see that if I'm the person who has to look at it ;)

But looking around it appears as if this is a more common thing among external HDMI encoders though. E.g. the tda998x has the exact same issue and the current driver just copy&pastes drm_do_get_edid() and plugs in its own EDID block retrieval method.

On the other hand the patch that makes it possible to use a different backend then a raw I2C adapter to fetch the EDID is extremely trivial and doesn't make the existing code more complex in any way.
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#8 lore raw
Quoted 91 lines · Lars-Peter Clausen
Quoted 79 lines · Dave Airlie
Quoted 65 lines · Lars-Peter Clausen
Quoted 48 lines · Laurent Pinchart

Hi Daniel,

(CC'ing Rob Clark and Lars-Peter. As a reminder we're discussing the "drm:
Decouple EDID parsing from I2C adapter" patch available at
git://linuxtv.org/pinchartl/fbdev.git drm/next/du)

Quoted 29 lines · On Monday 24 November 2014 14:09:39 Daniel Vetter wrote:
Quoted 12 lines · Laurent Pinchart
Quoted 9 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to
make
it
work. Or you have other magic means to optain an edid block, in
which
case just do that and then feed the edid drm_add_edid_modes.

Quoted 11 lines

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls
the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the
block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs
to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 6 lines

Sounds familiar. See the special ddc-over-sdvo i2c bus we register in intel_sdvo.c, specifically look at intel_sdvo_init_ddc_proxy. It is a bit
of boilerplate, but in the end just amounts to 3 small functions and one
tiny vtable to wire it all up cleanly.

Quoted 12 lines

That's what I would have done as well if I had a device-specific I2C adapter
connected to the DDC bus, but in this case the interface exposed by the ADV7511 to the SoC over I2C consists of higher level device-specific I2C commands to read EDID data. There is no low-level I2C read/write primitives
available. I would thus need to expose a fake adapter that would receive I2C
commands, parse them to detect an EDID block read, retrieve the EDID data
and
return them from the fake read. That doesn't make much sense to me.

Quoted 10 lines

The intel sdvo looks just like a simple I2C mux which will just pass-through
messages from the master to the EDID EEPROM. The ADV7511 is unfortunately a
bit different. You tell it to fetch the EDID information, then it will do some magic and then you can read the EDID back. Abstracting this as a this
as a I2C controller will, while possible, result in a fair amount of boiler
plate code that will not look particularly pretty.

Quoted 7 lines

It sounds also a bit like DP auxch also, or even how on UDL we get the edid
over USB.

I'd rather see not pretty code that only one person had to look at though :-)
with lots of comments on the hw design that demands ugly.

I'd rather not see that if I'm the person who has to look at it ;)

Quoted 9 lines

But looking around it appears as if this is a more common thing among external HDMI encoders though. E.g. the tda998x has the exact same issue and the current driver just copy&pastes drm_do_get_edid() and plugs in its own EDID block retrieval method.

On the other hand the patch that makes it possible to use a different backend then a raw I2C adapter to fetch the EDID is extremely trivial and doesn't make the existing code more complex in any way.

I suppose the only real disadvantage of the patch is it gives driver writers a bad alternative in cases where they really should expose their ddc as an i2c_adapter.. but perhaps we should just handle that via sufficient review ;-)

(I have seen enough downstream drivers that could use i2c_adapter but do not..)

BR,
-R

Quoted 4 lines

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#9 lore raw
In reply to Laurent Pinchart
Quoted 26 lines · Laurent Pinchart

Hi Daniel,

(CC'ing Rob Clark and Lars-Peter. As a reminder we're discussing the "drm:
Decouple EDID parsing from I2C adapter" patch available at
git://linuxtv.org/pinchartl/fbdev.git drm/next/du)

Quoted 14 lines · On Monday 24 November 2014 14:09:39 Daniel Vetter wrote:
Quoted 5 lines · Laurent Pinchart
Quoted 4 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make it work. Or you have other magic means to optain an edid block, in which case just do that and then feed the edid drm_add_edid_modes.

Quoted 7 lines

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 4 lines

Sounds familiar. See the special ddc-over-sdvo i2c bus we register in intel_sdvo.c, specifically look at intel_sdvo_init_ddc_proxy. It is a bit of boilerplate, but in the end just amounts to 3 small functions and one tiny vtable to wire it all up cleanly.

Quoted 7 lines

That's what I would have done as well if I had a device-specific I2C adapter connected to the DDC bus, but in this case the interface exposed by the ADV7511 to the SoC over I2C consists of higher level device-specific I2C commands to read EDID data. There is no low-level I2C read/write primitives available. I would thus need to expose a fake adapter that would receive I2C commands, parse them to detect an EDID block read, retrieve the EDID data and return them from the fake read. That doesn't make much sense to me.

Yeah that's a bit annoying indeed. So if you capture that in the commit message + kerneldoc (stating clearly what the other options are and when to use this) the I'm ok with this patch.
-Daniel

Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw
In reply to Laurent Pinchart

Hi Laurent,

Quoted 20 lines · Laurent Pinchart

Hi Daniel,

Thank you for the review.

Quoted 15 lines · On Friday 07 November 2014 10:19:14 Daniel Vetter wrote:
Quoted 14 lines · Laurent Pinchart

Hi Dave,

Here's a pull request that adds HDMI support to the R-Car DU driver, including a new slave encoder driver for the adv7511.

The branch is based on a merge of drm-next and Simon's tags/renesas-dt-du-for- v3.19 available at
git://git.kernel.org/pub/scm/linux/kernel/git/horms/renesas.git, for which a pull request has been submitted for v3.19 to the ARM SoC maintainers.

I'm leaving now for two weeks of holidays and would like to avoid missing the merge window. Simon, could you please confirm that tags/renesas-dt-du-for- v3.19 is stable and ack this pull request (and possibly ping Dave on my behalf ;-)) ?

Welcome back from vacation :)

FYI renesas-dt-du-for was accepted by Arnd last week so it is rather unlikely it will change now: it should be a stable base.

Quoted 88 lines
Quoted 2 lines
Quoted 2 lines

The following changes since commit

19de43d4dea8712b3574d72d3d8aa16cd17e7fed:

Quoted 10 lines
Quoted 10 lines

Merge tag 'tags/renesas-dt-du-for-v3.19' into drm/next/adv7511-base

(2014-11-07 08:06:16 +0200)

are available in the git repository at:
git://linuxtv.org/pinchartl/fbdev.git

for you to fetch changes up to cc47927ca851110d2c387a7d9fd7086112abb92e:
drm: Add adv7511 encoder driver (2014-11-07 08:19:06 +0200)

Quoted 7 lines
Quoted 4 lines

----------------------------------------------------------------

Lars-Peter Clausen (2):
drm: Decouple EDID parsing from I2C adapter

So somehow the pull request seems to lack the branch so I can't actually take a lookc.

git request-pull is playing trick with me :-/ I'll try to fix that.

The branch is available at

git://linuxtv.org/pinchartl/fbdev.git drm/next/du

(http://git.linuxtv.org/cgit.cgi/pinchartl/fbdev.git/commit/?h=drm/next/du)

Quoted 2 lines

But this patch here seems to lack review:
- kerneldoc for the newly exported function is missing

I'll fix that.

Quoted 4 lines

- the interface looks rather backwards: Either this still does i2c reads, and then you'd just need a i2c-over-whatever adapter to make it work. Or you have other magic means to optain an edid block, in which case just do that and then feed the edid drm_add_edid_modes.

I have a magic way to get EDID over I2C :-) Basically the ADV7511 controls the DDC bus, and exposes EDID data over I2C using vendor commands. To read an EDID block I have to write an ADV7511 register over I2C with the block number, wait for an interrupt, read a status register to check whether EDID data is available or whether an error occurred, and then read EDID data from the ADV7511 over I2C in 64-bytes chunks. This needs to be repeated for every block. I thus can't use drm_get_edid() directly.

Quoted 41 lines

Nack from me in this form. And can we try not to be quite this sneaky with drm core patches going in through driver trees, please?

Thanks, Daniel

Quoted 36 lines

drm: Add adv7511 encoder driver

Laurent Pinchart (6):
drm: rcar-du: Remove platform data support
drm: rcar-du: Pass the encoder DT node to rcar_du_encoder_init()
drm: rcar-du: Replace direct DRM encoder access with cast macro
drm: rcar-du: Replace drm_encoder with drm_slave_encoder
drm: rcar-du: Add HDMI encoder and connector support
video: Add ADV751[13] DT bindings documentation

 Documentation/devicetree/bindings/video/adi,adv7511.txt |   88 ++
 drivers/gpu/drm/drm_edid.c                              |   27 +-
 drivers/gpu/drm/i2c/Kconfig                             |    6 +
 drivers/gpu/drm/i2c/Makefile                            |    2 +
 drivers/gpu/drm/i2c/adv7511.c                           | 1010 ++++++++++
 drivers/gpu/drm/i2c/adv7511.h                           |  289 +++++++
 drivers/gpu/drm/rcar-du/Kconfig                         |   11 +-
 drivers/gpu/drm/rcar-du/Makefile                        |    2 +
 drivers/gpu/drm/rcar-du/rcar_du_crtc.h                  |   10 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c                   |    4 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.h                   |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_encoder.c               |   45 +-
 drivers/gpu/drm/rcar-du/rcar_du_encoder.h               |   23 +-
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c               |  118 +++
 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h               |   31 +
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c               |  151 ++++
 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h               |   35 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c                   |   53 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.c               |   31 +-
 drivers/gpu/drm/rcar-du/rcar_du_lvdscon.h               |    2 -
 drivers/gpu/drm/rcar-du/rcar_du_lvdsenc.h               |    1 -
 drivers/gpu/drm/rcar-du/rcar_du_vgacon.c                |    5 +-
 include/drm/drm_edid.h                                  |    5 +
 include/linux/platform_data/rcar-du.h                   |   74 --
 24 files changed, 1845 insertions(+), 180 deletions(-)
 create mode 100644
Quoted 14 lines
Quoted 8 lines
Quoted 8 lines

Documentation/devicetree/bindings/video/adi,adv7511.txt

 create mode 100644 drivers/gpu/drm/i2c/adv7511.c
 create mode 100644 drivers/gpu/drm/i2c/adv7511.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmicon.h
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.c
 create mode 100644 drivers/gpu/drm/rcar-du/rcar_du_hdmienc.h
 delete mode 100644 include/linux/platform_data/rcar-du.h
Signature · 3 lines
Regards,

Laurent Pinchart

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel