Skip to contentSkip to conversation

drm: bridge: it66121: Added it66121 chip external screen status judgment.

PATCH In review Yunlongli 2 participants 3 messages Sep 18, 2021 – Sep 20, 2021

Subsystems (4)
lore
Share & tools
lore

Yunlongli

author
#0 lore raw

PATCH 1/1 drm: bridge: it66121: Added it66121 chip external screen status judgment.

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.

---
 drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it66121.c +1 -1
index 2f2a09adb4bc..9ed4fa298d11 100644
@@ -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,
Signature · 1 line
2.20.1
Reviewed-by on v1 1/1
#1 lore raw

Hey Yunlongli,

Thanks for submitting this fix.

On Sat, 18 Sept 2021 at 05:51, Yunlongli <[email protected]> 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"

Quoted 2 lines

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")
Quoted 17 lines

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.

Quoted 19 lines
---
 drivers/gpu/drm/bridge/ite-it66121.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it66121.c +1 -2
index 2f2a09adb4bc..9ed4fa298d11 100644
@@ -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,
--
Quoted 4 lines

2.20.1

With the above suggestions fixed, feel free to add my r-b and submit a v2 of this patch.

author Reviewed-by Robert Foss
#2 lore raw

OK,I will modify the message. Thanks a lot.

---------------原始邮件---------------
发件人: Robert Foss<[email protected]&gt;
发送时间: 2021-09-20(周一) 17:47
收件人: Yunlongli<[email protected]&gt;
抄 送: Phong LE<[email protected]&gt;, Neil Armstrong<[email protected]&gt;, Andrzej Hajda<[email protected]&gt;, David Airlie<[email protected]&gt;, Daniel Vetter<[email protected]&gt;, Laurent Pinchart<[email protected]&gt;, Jonas Karlman<[email protected]&gt;, Jernej Skrabec<[email protected]&gt;, dri-devel<[email protected]&gt;, linux-kernel<[email protected]&gt; 主题: Re: [PATCH] drm: bridge: it66121: Added it66121 chip external screen status judgment.

Hey Yunlongli,

Thanks for submitting this fix.

On Sat, 18 Sept 2021 at 05:51, Yunlongli <[email protected]&gt; 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." -&gt; "drm: bridge: it66121: Added it66121 chip external screen status judgment"

&gt;
&gt; 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")

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

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.

&gt; Signed-off-by: Yunlongli <[email protected]&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;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (regmap_read(ctx-&gt;regmap, IT66121_SYS_STATUS_REG, &amp;val)) &gt;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false;
&gt;
&gt; -&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return val &amp; IT66121_SYS_STATUS_HPDETECT;
&gt; +&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return ((val &amp; IT66121_SYS_STATUS_HPDETECT) &amp;&amp; (val &amp; IT66121_SYS_STATUS_SENDECTECT)); &gt;&nbsp; }
&gt;
&gt;&nbsp; static int it66121_bridge_attach(struct drm_bridge *bridge,
&gt; --
&gt; 2.20.1
&gt;
&gt;
&gt;

With the above suggestions fixed, feel free to add my r-b and submit a v2 of this patch.