All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment
@ 2021-09-21  7:54 Yunlongli
  2021-09-21  8:27 ` Neil Armstrong
  0 siblings, 1 reply; 7+ messages in thread
From: Yunlongli @ 2021-09-21  7:54 UTC (permalink / raw)
  To: ple, narmstrong, a.hajda, robert.foss, airlied, daniel
  Cc: Laurent.pinchart, jonas, jernej.skrabec, dri-devel, linux-kernel,
	liyunlonga

In the actual tests,  the IT66121 chip sometimes misjudged whether
it had an external screen, so, reference the it66121_user_guid.pdf
about Audio/Video data is stable or not A typical initialization
of HDMI link should be based on interrupt signal and appropriate
register probing. Recommended flow is detailed in IT66121
Programming Guide. Simply put, the microcontroller should monitor
the HPD status first. Upon valid HPD event, move on to check
RxSENDetect register to see if the receiver chip is ready for
further handshaking. When RxSENDetect is asserted, start reading EDID
data through DDC channels and carry on the rest of the handshaking
subsequently.If the micro-controller makes no use of the interrupt
signal as well as the above-mentioned status  registers, the link
establishment might fail. Please do follow the suggested
initialization flow recommended in IT66121 Programming Guide.
So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection.

Signed-off-by: Yunlongli <liyunlonga@uniontech.com>
---
 drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
index 2f2a09adb4bc..9ed4fa298d11 100644
--- a/drivers/gpu/drm/bridge/ite-it66121.c
+++ b/drivers/gpu/drm/bridge/ite-it66121.c
@@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx)
 	if (regmap_read(ctx->regmap, IT66121_SYS_STATUS_REG, &val))
 		return false;
 
-	return val & IT66121_SYS_STATUS_HPDETECT;
+	return ((val & IT66121_SYS_STATUS_HPDETECT) && (val & IT66121_SYS_STATUS_SENDECTECT));
 }
 
 static int it66121_bridge_attach(struct drm_bridge *bridge,
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment
  2021-09-21  7:54 [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment Yunlongli
@ 2021-09-21  8:27 ` Neil Armstrong
  2022-03-10  8:37   ` 李云龙
  0 siblings, 1 reply; 7+ messages in thread
From: Neil Armstrong @ 2021-09-21  8:27 UTC (permalink / raw)
  To: Yunlongli, ple, a.hajda, robert.foss, airlied, daniel
  Cc: Laurent.pinchart, jonas, jernej.skrabec, dri-devel, linux-kernel

Hi,

On 21/09/2021 09:54, Yunlongli wrote:
> In the actual tests,  the IT66121 chip sometimes misjudged whether
> it had an external screen, so, reference the it66121_user_guid.pdf
> about Audio/Video data is stable or not A typical initialization
> of HDMI link should be based on interrupt signal and appropriate
> register probing. Recommended flow is detailed in IT66121
> Programming Guide. Simply put, the microcontroller should monitor
> the HPD status first. Upon valid HPD event, move on to check
> RxSENDetect register to see if the receiver chip is ready for
> further handshaking. When RxSENDetect is asserted, start reading EDID
> data through DDC channels and carry on the rest of the handshaking
> subsequently.If the micro-controller makes no use of the interrupt
> signal as well as the above-mentioned status  registers, the link
> establishment might fail. Please do follow the suggested
> initialization flow recommended in IT66121 Programming Guide.
> So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection.

Ok, the RxSENDetect is the "rx-sense" detection bit as described in the same doc:

Receiver detection circuit reports the presence or absence of an active termination at the TMDS Clock Channel (RxSENDetect)

The usage of the rx-sense signal in hpd_detect() is not clear because this would break detection of "Fake" EDID dongles or idle monitors.

The dw-hdmi handles the rx-sense, but only to power-on/off the HDMI TX, but only returns the HPD status to DRM without the RX SENSE state,
so it only saves power and doesn't change anything on DRM HPD detection.

So not sure if we should merge this as-is.

Neil

> 
> Signed-off-by: Yunlongli <liyunlonga@uniontech.com>
> ---
>  drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> index 2f2a09adb4bc..9ed4fa298d11 100644
> --- a/drivers/gpu/drm/bridge/ite-it66121.c
> +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> @@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx)
>  	if (regmap_read(ctx->regmap, IT66121_SYS_STATUS_REG, &val))
>  		return false;
>  
> -	return val & IT66121_SYS_STATUS_HPDETECT;
> +	return ((val & IT66121_SYS_STATUS_HPDETECT) && (val & IT66121_SYS_STATUS_SENDECTECT));
>  }
>  
>  static int it66121_bridge_attach(struct drm_bridge *bridge,
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment
  2021-09-21  8:27 ` Neil Armstrong
@ 2022-03-10  8:37   ` 李云龙
  0 siblings, 0 replies; 7+ messages in thread
From: 李云龙 @ 2022-03-10  8:37 UTC (permalink / raw)
  To: Neil Armstrong, Phong LE, Andrzej Hajda, Robert Foss,
	David Airlie, Daniel Vetter
  Cc: linux-kernel, dri-devel, Laurent.pinchart, Jernej Skrabec, Jonas Karlman

[-- Attachment #1: Type: text/plain, Size: 3506 bytes --]

I tested it on Loongarch and MIPS, and the results were fine。
&nbsp;
&nbsp;
------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"Neil&nbsp;Armstrong"<narmstrong@baylibre.com&gt;;
Date: &nbsp;Tue, Sep 21, 2021 08:28 AM
To: &nbsp;"Yunlongli"<liyunlonga@uniontech.com&gt;; "Phong LE"<ple@baylibre.com&gt;; "Andrzej Hajda"<a.hajda@samsung.com&gt;; "Robert Foss"<robert.foss@linaro.org&gt;; "David Airlie"<airlied@linux.ie&gt;; "Daniel Vetter"<daniel@ffwll.ch&gt;; 
Cc: &nbsp;"Laurent.pinchart"<Laurent.pinchart@ideasonboard.com&gt;; "Jonas Karlman"<jonas@kwiboo.se&gt;; "Jernej Skrabec"<jernej.skrabec@gmail.com&gt;; "dri-devel"<dri-devel@lists.freedesktop.org&gt;; "linux-kernel"<linux-kernel@vger.kernel.org&gt;; 
Subject: &nbsp;Re: [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment

&nbsp;

Hi,

On 21/09/2021 09:54, Yunlongli wrote:
&gt; In the actual tests,&nbsp; the IT66121 chip sometimes misjudged whether
&gt; it had an external screen, so, reference the it66121_user_guid.pdf
&gt; about Audio/Video data is stable or not A typical initialization
&gt; of HDMI link should be based on interrupt signal and appropriate
&gt; register probing. Recommended flow is detailed in IT66121
&gt; Programming Guide. Simply put, the microcontroller should monitor
&gt; the HPD status first. Upon valid HPD event, move on to check
&gt; RxSENDetect register to see if the receiver chip is ready for
&gt; further handshaking. When RxSENDetect is asserted, start reading EDID
&gt; data through DDC channels and carry on the rest of the handshaking
&gt; subsequently.If the micro-controller makes no use of the interrupt
&gt; signal as well as the above-mentioned status&nbsp; registers, the link
&gt; establishment might fail. Please do follow the suggested
&gt; initialization flow recommended in IT66121 Programming Guide.
&gt; So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection.

Ok, the RxSENDetect is the "rx-sense" detection bit as described in the same doc:

Receiver detection circuit reports the presence or absence of an active termination at the TMDS Clock Channel (RxSENDetect)

The usage of the rx-sense signal in hpd_detect() is not clear because this would break detection of "Fake" EDID dongles or idle monitors.

The dw-hdmi handles the rx-sense, but only to power-on/off the HDMI TX, but only returns the HPD status to DRM without the RX SENSE state,
so it only saves power and doesn't change anything on DRM HPD detection.

So not sure if we should merge this as-is.

Neil

&gt; 
&gt; Signed-off-by: Yunlongli <liyunlonga@uniontech.com&gt;
&gt; ---
&gt;&nbsp; drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
&gt;&nbsp; 1 file changed, 1 insertion(+), 1 deletion(-)
&gt; 
&gt; diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
&gt; index 2f2a09adb4bc..9ed4fa298d11 100644
&gt; --- a/drivers/gpu/drm/bridge/ite-it66121.c
&gt; +++ b/drivers/gpu/drm/bridge/ite-it66121.c
&gt; @@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx)
&gt;&nbsp; 	if (regmap_read(ctx-&gt;regmap, IT66121_SYS_STATUS_REG, &amp;val))
&gt;&nbsp; 		return false;
&gt;&nbsp; 
&gt; -	return val &amp; IT66121_SYS_STATUS_HPDETECT;
&gt; +	return ((val &amp; IT66121_SYS_STATUS_HPDETECT) &amp;&amp; (val &amp; IT66121_SYS_STATUS_SENDECTECT));
&gt;&nbsp; }
&gt;&nbsp; 
&gt;&nbsp; static int it66121_bridge_attach(struct drm_bridge *bridge,
&gt;

[-- Attachment #2: Type: text/html, Size: 4134 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment.
  2021-09-18  3:50 Yunlongli
@ 2021-09-20  9:47   ` Robert Foss
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Foss @ 2021-09-20  9:47 UTC (permalink / raw)
  To: Yunlongli
  Cc: Phong LE, Neil Armstrong, Andrzej Hajda, David Airlie,
	Daniel Vetter, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	dri-devel, linux-kernel

Hey Yunlongli,

Thanks for submitting this fix.

On Sat, 18 Sept 2021 at 05:51, Yunlongli <liyunlonga@uniontech.com> wrote:

The formatting of this commit message is a bit unusual, let's try to
change it to the normal formatting.

Remove the dot from the commit title:
"drm: bridge: it66121: Added it66121 chip external screen status
judgment." -> "drm: bridge: it66121: Added it66121 chip external
screen status judgment"


>
> fix: Add further confirm if external screens are involved.

The "fix:" tag is not needed. However if this commit fixes a bug
introduced in an earlier commit a machine readable tag like the the
one below could be added after the commit message.

Fixes: 988156dc2fc9 ("drm: bridge: add it66121 driver")

>
> log: In the actual tests,  the IT66121 chip sometimes misjudged whether
>      it had an external screen, so, reference the it66121_user_guid.pdf
>      about Audio/Video data is stable or not A typical initialization
>      of HDMI link should be based on interrupt signal and appropriate
>      register probing. Recommended flow is detailed in IT66121
>      Programming Guide. Simply put, the microcontroller should monitor
>      the HPD status first. Upon valid HPD event, move on to check
>      RxSENDetect register to see if the receiver chip is ready for
>      further handshaking. When RxSENDetect is asserted, start reading EDID
>      data through DDC channels and carry on the rest of the handshaking
>      subsequently.If the micro-controller makes no use of the interrupt
>      signal as well as the above-mentioned status  registers, the link
>      establishment might fail. Please do follow the suggested
>      initialization flow recommended in IT66121 Programming Guide.
>      So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection.
>

The "log:" prefix is not needed, and neither is the indentation of the text.

Secondly maybe it would be nice to format the above chunk of text into
paragraphs just to make it easier to read.

> Signed-off-by: Yunlongli <liyunlonga@uniontech.com>
> ---
>  drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> index 2f2a09adb4bc..9ed4fa298d11 100644
> --- a/drivers/gpu/drm/bridge/ite-it66121.c
> +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> @@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx)
>         if (regmap_read(ctx->regmap, IT66121_SYS_STATUS_REG, &val))
>                 return false;
>
> -       return val & IT66121_SYS_STATUS_HPDETECT;
> +       return ((val & IT66121_SYS_STATUS_HPDETECT) && (val & IT66121_SYS_STATUS_SENDECTECT));
>  }
>
>  static int it66121_bridge_attach(struct drm_bridge *bridge,
> --
> 2.20.1
>
>
>

With the above suggestions fixed, feel free to add my r-b and submit a
v2 of this patch.
Reviewed-by: Robert Foss <robert.foss@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment.
@ 2021-09-20  9:47   ` Robert Foss
  0 siblings, 0 replies; 7+ messages in thread
From: Robert Foss @ 2021-09-20  9:47 UTC (permalink / raw)
  To: Yunlongli
  Cc: Phong LE, Neil Armstrong, Andrzej Hajda, David Airlie,
	Daniel Vetter, Laurent Pinchart, Jonas Karlman, Jernej Skrabec,
	dri-devel, linux-kernel

Hey Yunlongli,

Thanks for submitting this fix.

On Sat, 18 Sept 2021 at 05:51, Yunlongli <liyunlonga@uniontech.com> wrote:

The formatting of this commit message is a bit unusual, let's try to
change it to the normal formatting.

Remove the dot from the commit title:
"drm: bridge: it66121: Added it66121 chip external screen status
judgment." -> "drm: bridge: it66121: Added it66121 chip external
screen status judgment"


>
> fix: Add further confirm if external screens are involved.

The "fix:" tag is not needed. However if this commit fixes a bug
introduced in an earlier commit a machine readable tag like the the
one below could be added after the commit message.

Fixes: 988156dc2fc9 ("drm: bridge: add it66121 driver")

>
> log: In the actual tests,  the IT66121 chip sometimes misjudged whether
>      it had an external screen, so, reference the it66121_user_guid.pdf
>      about Audio/Video data is stable or not A typical initialization
>      of HDMI link should be based on interrupt signal and appropriate
>      register probing. Recommended flow is detailed in IT66121
>      Programming Guide. Simply put, the microcontroller should monitor
>      the HPD status first. Upon valid HPD event, move on to check
>      RxSENDetect register to see if the receiver chip is ready for
>      further handshaking. When RxSENDetect is asserted, start reading EDID
>      data through DDC channels and carry on the rest of the handshaking
>      subsequently.If the micro-controller makes no use of the interrupt
>      signal as well as the above-mentioned status  registers, the link
>      establishment might fail. Please do follow the suggested
>      initialization flow recommended in IT66121 Programming Guide.
>      So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection.
>

The "log:" prefix is not needed, and neither is the indentation of the text.

Secondly maybe it would be nice to format the above chunk of text into
paragraphs just to make it easier to read.

> Signed-off-by: Yunlongli <liyunlonga@uniontech.com>
> ---
>  drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
> index 2f2a09adb4bc..9ed4fa298d11 100644
> --- a/drivers/gpu/drm/bridge/ite-it66121.c
> +++ b/drivers/gpu/drm/bridge/ite-it66121.c
> @@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx)
>         if (regmap_read(ctx->regmap, IT66121_SYS_STATUS_REG, &val))
>                 return false;
>
> -       return val & IT66121_SYS_STATUS_HPDETECT;
> +       return ((val & IT66121_SYS_STATUS_HPDETECT) && (val & IT66121_SYS_STATUS_SENDECTECT));
>  }
>
>  static int it66121_bridge_attach(struct drm_bridge *bridge,
> --
> 2.20.1
>
>
>

With the above suggestions fixed, feel free to add my r-b and submit a
v2 of this patch.
Reviewed-by: Robert Foss <robert.foss@linaro.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment.
@ 2021-09-18  3:55 Yunlongli
  0 siblings, 0 replies; 7+ messages in thread
From: Yunlongli @ 2021-09-18  3:55 UTC (permalink / raw)
  To: ple, narmstrong, a.hajda, robert.foss, airlied, daniel
  Cc: Laurent.pinchart, jonas, jernej.skrabec, dri-devel, linux-kernel,
	liyunlonga

fix: Add further confirm if external screens are involved.

log: In the actual tests,  the IT66121 chip sometimes misjudged whether
     it had an external screen, so, reference the it66121_user_guid.pdf
     about Audio/Video data is stable or not A typical initialization
     of HDMI link should be based on interrupt signal and appropriate
     register probing. Recommended flow is detailed in IT66121
     Programming Guide. Simply put, the microcontroller should monitor
     the HPD status first. Upon valid HPD event, move on to check
     RxSENDetect register to see if the receiver chip is ready for
     further handshaking. When RxSENDetect is asserted, start reading EDID
     data through DDC channels and carry on the rest of the handshaking
     subsequently.If the micro-controller makes no use of the interrupt
     signal as well as the above-mentioned status  registers, the link
     establishment might fail. Please do follow the suggested
     initialization flow recommended in IT66121 Programming Guide.
     So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection.

Signed-off-by: Yunlongli <liyunlonga@uniontech.com>
---
 drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
index 2f2a09adb4bc..9ed4fa298d11 100644
--- a/drivers/gpu/drm/bridge/ite-it66121.c
+++ b/drivers/gpu/drm/bridge/ite-it66121.c
@@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx)
 	if (regmap_read(ctx->regmap, IT66121_SYS_STATUS_REG, &val))
 		return false;
 
-	return val & IT66121_SYS_STATUS_HPDETECT;
+	return ((val & IT66121_SYS_STATUS_HPDETECT) && (val & IT66121_SYS_STATUS_SENDECTECT));
 }
 
 static int it66121_bridge_attach(struct drm_bridge *bridge,
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment.
@ 2021-09-18  3:50 Yunlongli
  2021-09-20  9:47   ` Robert Foss
  0 siblings, 1 reply; 7+ messages in thread
From: Yunlongli @ 2021-09-18  3:50 UTC (permalink / raw)
  To: ple, narmstrong, a.hajda, robert.foss, airlied, daniel
  Cc: Laurent.pinchart, jonas, jernej.skrabec, dri-devel, linux-kernel,
	liyunlonga

fix: Add further confirm if external screens are involved.

log: In the actual tests,  the IT66121 chip sometimes misjudged whether
     it had an external screen, so, reference the it66121_user_guid.pdf
     about Audio/Video data is stable or not A typical initialization
     of HDMI link should be based on interrupt signal and appropriate
     register probing. Recommended flow is detailed in IT66121
     Programming Guide. Simply put, the microcontroller should monitor
     the HPD status first. Upon valid HPD event, move on to check
     RxSENDetect register to see if the receiver chip is ready for
     further handshaking. When RxSENDetect is asserted, start reading EDID
     data through DDC channels and carry on the rest of the handshaking
     subsequently.If the micro-controller makes no use of the interrupt
     signal as well as the above-mentioned status  registers, the link
     establishment might fail. Please do follow the suggested
     initialization flow recommended in IT66121 Programming Guide.
     So, I add the IT66121_SYS_STATUS_SENDECTECT register status detection.

Signed-off-by: Yunlongli <liyunlonga@uniontech.com>
---
 drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/bridge/ite-it66121.c b/drivers/gpu/drm/bridge/ite-it66121.c
index 2f2a09adb4bc..9ed4fa298d11 100644
--- a/drivers/gpu/drm/bridge/ite-it66121.c
+++ b/drivers/gpu/drm/bridge/ite-it66121.c
@@ -523,7 +523,7 @@ static bool it66121_is_hpd_detect(struct it66121_ctx *ctx)
 	if (regmap_read(ctx->regmap, IT66121_SYS_STATUS_REG, &val))
 		return false;
 
-	return val & IT66121_SYS_STATUS_HPDETECT;
+	return ((val & IT66121_SYS_STATUS_HPDETECT) && (val & IT66121_SYS_STATUS_SENDECTECT));
 }
 
 static int it66121_bridge_attach(struct drm_bridge *bridge,
-- 
2.20.1




^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-10  8:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-21  7:54 [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment Yunlongli
2021-09-21  8:27 ` Neil Armstrong
2022-03-10  8:37   ` 李云龙
  -- strict thread matches above, loose matches on Subject: below --
2021-09-18  3:55 Yunlongli
2021-09-18  3:50 Yunlongli
2021-09-20  9:47 ` Robert Foss
2021-09-20  9:47   ` Robert Foss

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.