[Openpvrsgx-devgroup] CI20/JZ4780 HDMI (was Re: Status & HW to bring)

H. Nikolaus Schaller hns at goldelico.com
Mon Nov 11 20:54:13 CET 2019

Hi Paul,

> Am 11.11.2019 um 15:12 schrieb H. Nikolaus Schaller <hns at goldelico.com>:
> Hi Paul,
>> Am 11.11.2019 um 13:32 schrieb Paul Boddie <paul at boddie.org.uk>:
>> On Monday 11. November 2019 10.12.44 H. Nikolaus Schaller wrote:
>>> Ah, here is the relevant comment:
>>> https://lore.kernel.org/patchwork/patch/549312/#731123
>>> Unfortunately I have no idea what they are talking about :)
>> I interpret it as the patch not using that particular week's way of doing 
>> things in the Linux kernel.
>>> Maybe the drivers/gpu/drm/bridge/synopsys gives hints how to improve the
>>> jz4780 driver - or the synopsys driver.
>> I think there is already an upstream display driver that might be made 
>> suitable:
>> drivers/gpu/drm/ingenic/ingenic-drm.c
> This looks really good.
> But seems to support jz4740 and jz4725 only.
>> As for the Synopsys bridge driver, I wasn't convinced that anything else I 
>> found was making use of it. I imagine that it must need to be wired up to some 
>> other device, but it doesn't have the usual MODULE_DEVICE_TABLE declaration.
>> Looking at other such drivers, it seems possible that the device tree 
>> declaration would employ some input ports which then reference the output 
>> ports of the display devices.
>> For example, from arch/arm64/boot/dts/renesas/r8a77990.dtsi which uses the 
>> lvds-encoder bridge driver:
>> lvds0: lvds-encoder at feb90000 {
>>   compatible = "renesas,r8a77990-lvds";
>>   ...
>>   ports {
>>     ...
>>     port at 0 {
>>       ...
>>       lvds0_in: endpoint {
>>         remote-endpoint = <&du_out_lvds0>;
> Yes, this seems to resemble OMAP port/endpoint definitions.
>> This kind of thing isn't done in the CI20 kernel because it doesn't have a 
>> shiny-enough DRM driver, and so the display device references the HDMI device 
>> in the device tree, with the code confirming this:
>> drivers/gpu/drm/jz4780/jz4780_drv.c
>> In fact, the port/endpoint mechanism is supported in the submitted driver (see 
>> above), whereas the upstream Ingenic driver doesn't have that support, perhaps 
>> because many of the devices involved don't need to enable LVDS or HDMI to get 
>> video working.
>> So, the Ingenic driver would need to be augmented with port/endpoint support, 
>> and there would need to be a way of activating the Synopsys driver in the 
>> device tree. Exactly how the latter should be done remains a mystery to me at 
>> the moment.
> It seems to be device tree compatible but has no .compatible. It includes
> include/drm/drm_of.h and include/linux/of_graph. But there is no
> config for CONFIG_DRM_DW_HDMI except _AHB_AUDIO and _CEC in
> arch/arm/configs/imx_v6_v7_defconfig
> Indeed it seems to be used in or in combination with some i.MX6 SoC?
> AFAIK the i.MX6 has no internal HDMI encoder, so the connection isn't
> clear either.
> Indeed quite confusing so far (and quite deviating from Openpvrsgx but we
> need some working video output interface on the CI20 board).

I took the patch set for drivers/gpu/drm/jz4780 and rebased it to v5.4-rc7
(wasn't difficult).

As expected, it fails to compile:

  CC [M]  drivers/gpu/drm/bridge/synopsys/dw-hdmi.o - due to target missing
  CC [M]  drivers/gpu/drm/ingenic/ingenic-drm.o - due to target missing
  CC [M]  drivers/gpu/drm/jz4780/dw_hdmi-jz4780.o - due to target missing
drivers/gpu/drm/jz4780/dw_hdmi-jz4780.c:75:38: error: array type has incomplete element type
 static const struct dw_hdmi_sym_term jz4780_sym_term[] = {
drivers/gpu/drm/jz4780/dw_hdmi-jz4780.c:121:2: error: unknown field 'sym_term' specified in initializer
  .sym_term = jz4780_sym_term,
drivers/gpu/drm/jz4780/dw_hdmi-jz4780.c:122:2: error: unknown field 'dev_type' specified in initializer
  .dev_type = JZ4780_HDMI,
drivers/gpu/drm/jz4780/dw_hdmi-jz4780.c: In function 'dw_hdmi_jz4780_bind':
drivers/gpu/drm/jz4780/dw_hdmi-jz4780.c:189:2: error: too few arguments to function 'drm_encoder_init'
  drm_encoder_init(drm, encoder, &dw_hdmi_jz4780_encoder_funcs,
In file included from ./include/drm/drm_modeset_helper_vtables.h:33:0,
                 from ./include/drm/drm_crtc_helper.h:43,
                 from drivers/gpu/drm/jz4780/dw_hdmi-jz4780.c:20:
./include/drm/drm_encoder.h:183:5: note: declared here
 int drm_encoder_init(struct drm_device *dev,


Interestingly, it also enables the compile of drivers/gpu/drm/bridge/synopsys/dw-hdmi.o
which it seems to rely on.

If you want to take a look, I have pushed the non-compiling version:



More information about the openpvrsgx-devgroup mailing list