All of lore.kernel.org
 help / color / mirror / Atom feed
From: Paul Cercueil <paul@crapouillou.net>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Neil Armstrong <narmstrong@baylibre.com>,
	Paul Boddie <paul@boddie.org.uk>, Daniel Vetter <daniel@ffwll.ch>,
	Maxime Ripard <maxime@cerno.tech>,
	Jonas Karlman <jonas@kwiboo.se>, David Airlie <airlied@linux.ie>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	linux-mips <linux-mips@vger.kernel.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Robert Foss <robert.foss@linaro.org>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	Discussions about the Letux Kernel 
	<letux-kernel@openphoenux.org>
Subject: Re: [Letux-kernel] [PATCH v16 1/4] drm/bridge: dw-hdmi: introduce dw_hdmi_enable_poll()
Date: Thu, 03 Mar 2022 16:51:28 +0000	[thread overview]
Message-ID: <SHH68R.Z3J9KSY0GQVA2@crapouillou.net> (raw)
In-Reply-To: <3E620AF4-402E-45EA-9D92-92EAEA9647F5@goldelico.com>

Hi Nikolaus,

Le jeu., mars 3 2022 at 17:43:05 +0100, H. Nikolaus Schaller 
<hns@goldelico.com> a écrit :
> Hi Neil,
> 
>>  Am 03.03.2022 um 17:30 schrieb H. Nikolaus Schaller 
>> <hns@goldelico.com>:
>> 
>>  Hi Neil,
>> 
>>>  Am 03.03.2022 um 17:23 schrieb Neil Armstrong 
>>> <narmstrong@baylibre.com>:
>>> 
>>>  Hi,
>>> 
>>>  On 26/02/2022 18:12, H. Nikolaus Schaller wrote:
>>>>  so that specialization drivers like ingenic-dw-hdmi can enable 
>>>> polling.
>>>>  Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>>>>  ---
>>>>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 9 +++++++++
>>>>  include/drm/bridge/dw_hdmi.h              | 1 +
>>>>  2 files changed, 10 insertions(+)
>>>>  diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
>>>> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>>>  index 4befc104d2200..43e375da131e8 100644
>>>>  --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>>>  +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>>>  @@ -3217,6 +3217,15 @@ static int dw_hdmi_parse_dt(struct dw_hdmi 
>>>> *hdmi)
>>>>  	return 0;
>>>>  }
>>>>  +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable)
>>>>  +{
>>>>  +	if (hdmi->bridge.dev)
>>>>  +		hdmi->bridge.dev->mode_config.poll_enabled = enable;
>>>>  +	else
>>>>  +		dev_warn(hdmi->dev, "no hdmi->bridge.dev");
>>>>  +}
>>>>  +EXPORT_SYMBOL_GPL(dw_hdmi_enable_poll);
>>>>  +
>>>>  struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>>>>  			      const struct dw_hdmi_plat_data *plat_data)
>>>>  {
>>>>  diff --git a/include/drm/bridge/dw_hdmi.h 
>>>> b/include/drm/bridge/dw_hdmi.h
>>>>  index 2a1f85f9a8a3f..963960794b40e 100644
>>>>  --- a/include/drm/bridge/dw_hdmi.h
>>>>  +++ b/include/drm/bridge/dw_hdmi.h
>>>>  @@ -196,5 +196,6 @@ enum drm_connector_status 
>>>> dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi,
>>>>  void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data,
>>>>  			    bool force, bool disabled, bool rxsense);
>>>>  void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data);
>>>>  +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable);
>>>>    #endif /* __IMX_HDMI_H__ */
>>> 
>>>  As I understand, this is because the IRQ line of the dw-hdmi IP 
>>> isn't connected right ? and you use the display-connector ddc gpio 
>>> instead ?
>> 
>>  Yes. The IRQ line is not connected on all boards as far as I can 
>> see.
>> 
>>> 
>>>  In this case I think the Ingenic DRM core should call 
>>> drm_kms_helper_poll_init(drm) instead.
>> 
>>  Ah, that is good. it seems to do "dw_hdmi_enable_poll()" in a more 
>> generic way.
> 
> Well, I looked through source code and it is defined as
> 
> 	void drm_kms_helper_poll_init(struct drm_device *dev)
> 
> But there is no direct pointer to some drm_device available.
> Neither in dw-hdmi nor ingenic-dw-hdmi.

Well he said "the Ingenic DRM core" aka ingenic-drm-drv.c. You do have 
access to the main drm_device in the ingenic_drm_bind() function, so 
you can add it there (with a cleanup function calling 
drm_kms_helper_poll_fini() registered with drmm_add_action_or_reset()).

Cheers,
-Paul

> What should the parameter to drm_kms_helper_poll_init(drm) be?
> 
> From comparing code to be able to set mode_config.poll_enabled = 
> enable it should be
> 
> 	&hdmi->bridge.dev
> 
> but the struct dw_hdmi *hdmi is an opaque type for the 
> ingenic-dw-hdmi driver.
> So it can't access the hdmi-bridge directly.
> 
> What we can do is to make dw_hdmi_enable_poll() call 
> drm_kms_helper_poll_init()
> or drm_kms_helper_poll_fini().
> 
> BR and thanks,
> Nikolaus
> 
> 



WARNING: multiple messages have this Message-ID (diff)
From: Paul Cercueil <paul@crapouillou.net>
To: "H. Nikolaus Schaller" <hns@goldelico.com>
Cc: Paul Boddie <paul@boddie.org.uk>,
	Andrzej Hajda <andrzej.hajda@intel.com>,
	Jonas Karlman <jonas@kwiboo.se>, David Airlie <airlied@linux.ie>,
	Robert Foss <robert.foss@linaro.org>,
	Neil Armstrong <narmstrong@baylibre.com>,
	linux-mips <linux-mips@vger.kernel.org>,
	dri-devel <dri-devel@lists.freedesktop.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
	Maxime Ripard <maxime@cerno.tech>,
	Discussions about the Letux Kernel <letux-kernel@openphoenux.org>,
	Jernej Skrabec <jernej.skrabec@gmail.com>,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Subject: Re: [Letux-kernel] [PATCH v16 1/4] drm/bridge: dw-hdmi: introduce dw_hdmi_enable_poll()
Date: Thu, 03 Mar 2022 16:51:28 +0000	[thread overview]
Message-ID: <SHH68R.Z3J9KSY0GQVA2@crapouillou.net> (raw)
In-Reply-To: <3E620AF4-402E-45EA-9D92-92EAEA9647F5@goldelico.com>

Hi Nikolaus,

Le jeu., mars 3 2022 at 17:43:05 +0100, H. Nikolaus Schaller 
<hns@goldelico.com> a écrit :
> Hi Neil,
> 
>>  Am 03.03.2022 um 17:30 schrieb H. Nikolaus Schaller 
>> <hns@goldelico.com>:
>> 
>>  Hi Neil,
>> 
>>>  Am 03.03.2022 um 17:23 schrieb Neil Armstrong 
>>> <narmstrong@baylibre.com>:
>>> 
>>>  Hi,
>>> 
>>>  On 26/02/2022 18:12, H. Nikolaus Schaller wrote:
>>>>  so that specialization drivers like ingenic-dw-hdmi can enable 
>>>> polling.
>>>>  Signed-off-by: H. Nikolaus Schaller <hns@goldelico.com>
>>>>  ---
>>>>  drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 9 +++++++++
>>>>  include/drm/bridge/dw_hdmi.h              | 1 +
>>>>  2 files changed, 10 insertions(+)
>>>>  diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c 
>>>> b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>>>  index 4befc104d2200..43e375da131e8 100644
>>>>  --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>>>  +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c
>>>>  @@ -3217,6 +3217,15 @@ static int dw_hdmi_parse_dt(struct dw_hdmi 
>>>> *hdmi)
>>>>  	return 0;
>>>>  }
>>>>  +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable)
>>>>  +{
>>>>  +	if (hdmi->bridge.dev)
>>>>  +		hdmi->bridge.dev->mode_config.poll_enabled = enable;
>>>>  +	else
>>>>  +		dev_warn(hdmi->dev, "no hdmi->bridge.dev");
>>>>  +}
>>>>  +EXPORT_SYMBOL_GPL(dw_hdmi_enable_poll);
>>>>  +
>>>>  struct dw_hdmi *dw_hdmi_probe(struct platform_device *pdev,
>>>>  			      const struct dw_hdmi_plat_data *plat_data)
>>>>  {
>>>>  diff --git a/include/drm/bridge/dw_hdmi.h 
>>>> b/include/drm/bridge/dw_hdmi.h
>>>>  index 2a1f85f9a8a3f..963960794b40e 100644
>>>>  --- a/include/drm/bridge/dw_hdmi.h
>>>>  +++ b/include/drm/bridge/dw_hdmi.h
>>>>  @@ -196,5 +196,6 @@ enum drm_connector_status 
>>>> dw_hdmi_phy_read_hpd(struct dw_hdmi *hdmi,
>>>>  void dw_hdmi_phy_update_hpd(struct dw_hdmi *hdmi, void *data,
>>>>  			    bool force, bool disabled, bool rxsense);
>>>>  void dw_hdmi_phy_setup_hpd(struct dw_hdmi *hdmi, void *data);
>>>>  +void dw_hdmi_enable_poll(struct dw_hdmi *hdmi, bool enable);
>>>>    #endif /* __IMX_HDMI_H__ */
>>> 
>>>  As I understand, this is because the IRQ line of the dw-hdmi IP 
>>> isn't connected right ? and you use the display-connector ddc gpio 
>>> instead ?
>> 
>>  Yes. The IRQ line is not connected on all boards as far as I can 
>> see.
>> 
>>> 
>>>  In this case I think the Ingenic DRM core should call 
>>> drm_kms_helper_poll_init(drm) instead.
>> 
>>  Ah, that is good. it seems to do "dw_hdmi_enable_poll()" in a more 
>> generic way.
> 
> Well, I looked through source code and it is defined as
> 
> 	void drm_kms_helper_poll_init(struct drm_device *dev)
> 
> But there is no direct pointer to some drm_device available.
> Neither in dw-hdmi nor ingenic-dw-hdmi.

Well he said "the Ingenic DRM core" aka ingenic-drm-drv.c. You do have 
access to the main drm_device in the ingenic_drm_bind() function, so 
you can add it there (with a cleanup function calling 
drm_kms_helper_poll_fini() registered with drmm_add_action_or_reset()).

Cheers,
-Paul

> What should the parameter to drm_kms_helper_poll_init(drm) be?
> 
> From comparing code to be able to set mode_config.poll_enabled = 
> enable it should be
> 
> 	&hdmi->bridge.dev
> 
> but the struct dw_hdmi *hdmi is an opaque type for the 
> ingenic-dw-hdmi driver.
> So it can't access the hdmi-bridge directly.
> 
> What we can do is to make dw_hdmi_enable_poll() call 
> drm_kms_helper_poll_init()
> or drm_kms_helper_poll_fini().
> 
> BR and thanks,
> Nikolaus
> 
> 



  reply	other threads:[~2022-03-03 16:51 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-26 17:12 [PATCH v16 0/4] MIPS: JZ4780 and CI20 HDMI H. Nikolaus Schaller
2022-02-26 17:12 ` H. Nikolaus Schaller
2022-02-26 17:12 ` [PATCH v16 1/4] drm/bridge: dw-hdmi: introduce dw_hdmi_enable_poll() H. Nikolaus Schaller
2022-02-26 17:12   ` H. Nikolaus Schaller
2022-03-03 16:23   ` Neil Armstrong
2022-03-03 16:23     ` Neil Armstrong
2022-03-03 16:30     ` H. Nikolaus Schaller
2022-03-03 16:30       ` H. Nikolaus Schaller
2022-03-03 16:43       ` [Letux-kernel] " H. Nikolaus Schaller
2022-03-03 16:43         ` H. Nikolaus Schaller
2022-03-03 16:51         ` Paul Cercueil [this message]
2022-03-03 16:51           ` Paul Cercueil
2022-03-03 17:09           ` H. Nikolaus Schaller
2022-03-03 17:09             ` H. Nikolaus Schaller
2022-03-03 17:20             ` Paul Cercueil
2022-03-03 17:20               ` Paul Cercueil
2022-03-03 17:59               ` H. Nikolaus Schaller
2022-03-03 17:59                 ` H. Nikolaus Schaller
2022-03-04 13:30                 ` Neil Armstrong
2022-03-04 13:30                   ` Neil Armstrong
2022-03-04 16:47                   ` Paul Cercueil
2022-03-04 16:47                     ` Paul Cercueil
2022-03-04 17:51                     ` H. Nikolaus Schaller
2022-03-04 17:51                       ` H. Nikolaus Schaller
2022-03-04 18:04                       ` Paul Cercueil
2022-03-04 18:04                         ` Paul Cercueil
2022-03-04 18:15                         ` H. Nikolaus Schaller
2022-03-04 18:15                           ` H. Nikolaus Schaller
2022-03-04 18:33                           ` Paul Cercueil
2022-03-04 18:33                             ` Paul Cercueil
2022-03-04 18:41                             ` H. Nikolaus Schaller
2022-03-04 18:41                               ` H. Nikolaus Schaller
2022-03-05  7:49                               ` H. Nikolaus Schaller
2022-03-05  7:49                                 ` H. Nikolaus Schaller
2022-03-03 16:46     ` Paul Cercueil
2022-03-03 16:46       ` Paul Cercueil
2022-03-03 17:05       ` H. Nikolaus Schaller
2022-03-03 17:05         ` H. Nikolaus Schaller
2022-02-26 17:13 ` [PATCH v16 2/4] drm/ingenic: Add dw-hdmi driver specialization for jz4780 H. Nikolaus Schaller
2022-02-26 17:13   ` H. Nikolaus Schaller
2022-02-26 17:13 ` [PATCH v16 3/4] drm/bridge: display-connector: add ddc-en gpio support H. Nikolaus Schaller
2022-02-26 17:13   ` H. Nikolaus Schaller
2022-02-26 17:13 ` [PATCH v16 4/4] drm/bridge: dw-hdmi: fix bus formats negotiation for 8 bit modes H. Nikolaus Schaller
2022-02-26 17:13   ` H. Nikolaus Schaller
2022-03-01  9:18   ` Neil Armstrong
2022-03-01  9:18     ` Neil Armstrong
2022-03-01 20:37     ` H. Nikolaus Schaller
2022-03-01 20:37       ` H. Nikolaus Schaller
2022-03-02 10:25       ` Neil Armstrong
2022-03-02 10:25         ` Neil Armstrong
2022-03-02 11:15         ` H. Nikolaus Schaller
2022-03-02 11:15           ` H. Nikolaus Schaller
2022-03-02 14:34           ` Neil Armstrong
2022-03-02 14:34             ` Neil Armstrong
2022-03-02 22:24             ` H. Nikolaus Schaller
2022-03-02 22:24               ` H. Nikolaus Schaller
2022-03-03  8:35               ` Neil Armstrong
2022-03-03  8:35                 ` Neil Armstrong
2022-03-03 10:40                 ` H. Nikolaus Schaller
2022-03-03 10:40                   ` H. Nikolaus Schaller
2022-03-03 11:42                   ` Neil Armstrong
2022-03-03 11:42                     ` Neil Armstrong
2022-03-03 11:45                     ` H. Nikolaus Schaller
2022-03-03 11:45                       ` H. Nikolaus Schaller
2022-03-03 15:37                       ` H. Nikolaus Schaller
2022-03-03 15:37                         ` H. Nikolaus Schaller
2022-03-03 16:14                         ` Neil Armstrong
2022-03-03 16:14                           ` Neil Armstrong
2022-03-03 15:15                     ` Paul Cercueil
2022-03-03 15:15                       ` 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=SHH68R.Z3J9KSY0GQVA2@crapouillou.net \
    --to=paul@crapouillou.net \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=andrzej.hajda@intel.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hns@goldelico.com \
    --cc=jernej.skrabec@gmail.com \
    --cc=jonas@kwiboo.se \
    --cc=kieran.bingham+renesas@ideasonboard.com \
    --cc=letux-kernel@openphoenux.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=maxime@cerno.tech \
    --cc=narmstrong@baylibre.com \
    --cc=paul@boddie.org.uk \
    --cc=robert.foss@linaro.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.