mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Dave Airlie <airlied@linux.ie>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	Andy Yan <andy.yan@rock-chips.com>,
	Yakir Yang <ykk@rock-chips.com>,
	Vladimir Zapolskiy <vladimir_zapolskiy@mentor.com>,
	Paul Boddie <paul@boddie.org.uk>,
	linux-mips@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	MIPS Creator CI20 Development 
	<mips-creator-ci20-dev@googlegroups.com>
Subject: Re: DRM interaction problems on Ingenic CI20 / jz4780 with dw-hdmi and ingenic-drm
Date: Mon, 04 May 2020 03:05:22 +0200	[thread overview]
Message-ID: <YC8S9Q.M96AR8DWGF0F1@crapouillou.net> (raw)
In-Reply-To: <125Q8Q.9F49TXF6ZICX1@crapouillou.net>

Hi Nikolaus,

So I just wrote a HDMI driver for a different chip, I guess I can 
answer some of your questions now.


Le lun. 13 avril 2020 à 13:25, Paul Cercueil <paul@crapouillou.net> a 
écrit :
> Hi Nikolaus,
> 
> 
> Le sam. 11 avril 2020 à 16:14, H. Nikolaus Schaller 
> <hns@goldelico.com> a écrit :
>> Hi,
>> we (Paul Boddie and me) are working to get HDMI functional on the
>> Ingenic CI20 board with jz4780 SoC which uses a specialization of
>> the dw-hdmi driver.
>> 
>> 
>> So far we have identified two issues.
>> 
>> The first is that HPD interrupts are not properly processed.
>> 
>> drm_helper_hpd_irq_event() is called by HPD events but
>> dev->mode_config.poll_enabled is false.
>> 

This is to be used when there's no hardware interrupt. I believe you 
have one, right? Then call drm_kms_helper_hotplug_event() from the 
interrupt handler instead.

>> Therefore the interrupt is ignored and nothing happens.
>> 
>> Now I wonder about the logic behind checking for poll_enabled.
>> I understand that a driver can do either polling or irq or both.
>> 
>> Therefore handling the irq_event shouldn't be disabled by 
>> poll_enabled
>> being false. Otherwise we can only do: nothing, polling, polling+irq
>> but not irq alone.
>> 
>> The jz4780 hdmi subsystem (drm/bridge/dw-hdmi.c) uses
>> 
>> 	connector->polled = DRM_CONNECTOR_POLL_HPD;
>> 
>> but shouldn't this enable polling? Note that there seems to be
>> no (direct) call to drm_kms_helper_poll_init().
>> 
>> If we set dev->mode_config.poll_enabled = true in
>> drm_helper_hpd_irq_event() things start to work.
>> 
>> Please can you clarify what would be best practise here to
>> get HPD event handling working.
>> 

Remove that - this stuff is for hardware without interrupts, where 
everything has to be polled.

>> The other issue is in dw-hdmi.c:
>> 
>> We found out that ingenic_drm_encoder_atomic_check() fails because
>> 
>> info->num_bus_formats == 0
>> 
>> and not 1. This blocks further initialization.
>> 
>> The reason seems to be that dw_hdmi_bridge_attach() does not call
>> drm_display_info_set_bus_formats() with a proper format like
>> other drivers (e.g. drm/bridge/ti-tfp410.c) are doing.
>> 
>> We have patched to set a single bus format MEDIA_BUS_FMT_RGB888_1X24
>> and then DRM setup seems to work (although we still have no valid
>> HDMI signal but that is likely something else).
>> 
>> Please can you explain how setting the bus format should be fixed
>> in dw-hdmi.c.
>> 

I'm not sure, but that information may come from EDID data. Are you 
able to obtain video modes from the connected monitor?

-Paul

>> If these questions should be forwarded to other specialists, please
>> do so.
> 
> It should be sent to the DRI mailing list, you missed the most 
> important one.
> 
> -Paul
> 
>> 
>> BR and thanks,
>> Nikolaus Schaller



  parent reply	other threads:[~2020-05-04  1:05 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-11 14:14 H. Nikolaus Schaller
2020-04-13 11:25 ` Paul Cercueil
2020-04-13 11:46   ` H. Nikolaus Schaller
2020-05-04  1:05   ` Paul Cercueil [this message]
2020-05-05 18:26     ` Paul Boddie
2020-05-09 13:43       ` Paul Cercueil

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YC8S9Q.M96AR8DWGF0F1@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=airlied@linux.ie \
    --cc=andy.yan@rock-chips.com \
    --cc=hns@goldelico.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=mips-creator-ci20-dev@googlegroups.com \
    --cc=paul@boddie.org.uk \
    --cc=s.hauer@pengutronix.de \
    --cc=vladimir_zapolskiy@mentor.com \
    --cc=ykk@rock-chips.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®