* T113 TCON Top tinting troubleshooting
@ 2024-06-28 18:52 John Watts
[not found] ` <CALP2yXcUrCdzyqQx7RQUup3QjfbH4VnMVCPFVXNmmd08GJkKMQ@mail.gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: John Watts @ 2024-06-28 18:52 UTC (permalink / raw)
To: linux-sunxi
Cc: andre.przywara, Jakob L, K. James, Paul Kocialkowski,
Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Maarten Lankhorst,
Thomas Zimmermann, David Airlie, Daniel Vetter, Samuel Holland,
dri-devel, linux-arm-kernel, linux-kernel
Hello,
On the T113 (and most likely the D1) sometimes the RGB LCD output has strange
artifacts such as:
- A blue tint
- A mostly opaque green tint
- A red tint
- A pink tint
The actual tint seems to differ between boards or chips, and has some
probability of showing up that can range from 50% to 90%.
After a week or so of troubleshooting I've managed to figure out what's
happening here, and I'm not too sure how to fix it.
It appears that the TCON Top on this chip can't mux both mixers to a shared
output. The R40 (and H6?) allows this and prioritizes the DE0 when muxing, but
on the T113 it seems to cause graphical artifacts. Disabling DE1 in the
device tree can help but doesn't solve the problem entirely.
Here's a change that tests this behaviour, it sets DE1 to output to TVE0. DE0
then outputs to LCD0 as usual. I would appreciate if anyone with this issue can
test the above workaround on their boards.
There was a previous discussion here:
https://groups.google.com/g/linux-sunxi/c/HxDBpY5HbbQ/m/mX2O2OYlCwAJ
---8<--- CUT HERE ---8<---
--- a/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
+++ b/drivers/gpu/drm/sun4i/sun8i_tcon_top.c
@@ -179,7 +179,7 @@ static int sun8i_tcon_top_bind(struct device *dev, struct device *master,
* At least on H6, some registers have some bits set by default
* which may cause issues. Clear them here.
*/
- writel(0, regs + TCON_TOP_PORT_SEL_REG);
+ writel(0x20, regs + TCON_TOP_PORT_SEL_REG);
writel(0, regs + TCON_TOP_GATE_SRC_REG);
/*
---8<--- CUT HERE ---8<---
The sunxi display code works around this issue by ensuring DE0 and DE1 never
map to the same output: If you have DE0 set to TVE0 and DE1 set to LCD0,
then tell it to set DE0 to LCD0, it will silently swap TVE0 on to DE1.
I'm probably going to send a patch that copies this behaviour as it
should just work, but I'd be interested to see if there's anything I'm
missing.
John.
^ permalink raw reply [flat|nested] 4+ messages in thread[parent not found: <CALP2yXcUrCdzyqQx7RQUup3QjfbH4VnMVCPFVXNmmd08GJkKMQ@mail.gmail.com>]
* Re: T113 TCON Top tinting troubleshooting [not found] ` <CALP2yXcUrCdzyqQx7RQUup3QjfbH4VnMVCPFVXNmmd08GJkKMQ@mail.gmail.com> @ 2024-06-29 2:12 ` John Watts [not found] ` <CAMBcuYNG6n1_yc0-5MSFoh2xCfh3-tHG7VcQq5vY65RKSq39RA@mail.gmail.com> 1 sibling, 0 replies; 4+ messages in thread From: John Watts @ 2024-06-29 2:12 UTC (permalink / raw) To: Jakob L Cc: linux-sunxi, andre.przywara, K. James, Paul Kocialkowski, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Maarten Lankhorst, Thomas Zimmermann, David Airlie, Daniel Vetter, Samuel Holland, dri-devel, linux-arm-kernel, linux-kernel On Sat, Jun 29, 2024 at 01:49:53AM +0200, Jakob L wrote: > Hi John, > > good find! This seems to fix it on my DSI implementation. Every of the > recent boots resulted in a pink tint (usually it was green for me, or blue) > Booted 10 times - no tint. > > So this patch is good, but probably has to be implemented as a quirk? > > Jakob Hi Jakob, I'm not sure if this needs to be a quirk: There's not really a reason to set both DEs to the same output. My thinking right now is to error in this situation. However I think we have to somehow track which DEs have been set so we can pretend they start unset. For example: DE0: (Unset, LCD0) DE1: (Unset, TVE0) Setting DE0 to LCD0 should work, then setting DE1 to LCD0 should fail. Setting DE0 to LCD0 should work, then setting DE0 to TVE0 should work. Setting DE0 to TVE0 should work, then setting DE1 to TVE0 should fail. The mechanism here for setting a DE I think would go like this: 1. Check the opposite DE's value 2. If it is duplicate and set, error 3. If it is duplicate and unset, change the opposite DE's value 4. Set the DE 5. Mark it as set Step three requires finding an unused DE value, this could be done by inverting the bits of the new DE. Alternatively we could do what Allwinner does and start with both DEs at different values and the move instead the current DE value to the opposite DE to avoid conflicts. 'Set' here may make more sense as 'used'. I'm good at mentally over-engineering things, so if you can think of a better solution please tell me. John. ^ permalink raw reply [flat|nested] 4+ messages in thread
[parent not found: <CAMBcuYNG6n1_yc0-5MSFoh2xCfh3-tHG7VcQq5vY65RKSq39RA@mail.gmail.com>]
* Re: T113 TCON Top tinting troubleshooting [not found] ` <CAMBcuYNG6n1_yc0-5MSFoh2xCfh3-tHG7VcQq5vY65RKSq39RA@mail.gmail.com> @ 2024-06-29 20:58 ` John Watts 2024-07-02 15:32 ` Jakob L 0 siblings, 1 reply; 4+ messages in thread From: John Watts @ 2024-06-29 20:58 UTC (permalink / raw) To: Kirby Nankivell Cc: Jakob L, linux-sunxi, andre.przywara, Paul Kocialkowski, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Maarten Lankhorst, Thomas Zimmermann, David Airlie, Daniel Vetter, Samuel Holland, dri-devel, linux-arm-kernel, linux-kernel Hi, On Sat, Jun 29, 2024 at 12:14:39PM +1000, Kirby Nankivell wrote: > Tested this on a MangoPI-MQ-R with a RGB lcd and can confirm that this fix > removes the green tint I experienced. > > Disabling the mixer1 in DTS entirely also works. > > I suspect on the basis that the Mixer/TCON-TOP topology is identical to the > R40 but does not seem to experience this issue, that is a > silicon errata specific to the T113/D1s as far as we currently know. > > However, there is no functional reason from a drm perspective to require > more than one mixer tied to one output via tcon-top - unless someone has a > good argument here? > > in my opinion: > 1) implement this as a quirk on the t113 and fix mixer0 > rgb/dsi and > mixer1 > tv0 > 2) make this a global default for the sun8i tcon top driver where only one > mixer is initialised against an output (which would also impact the R40) The only reason I caught this issue was because I implemented LCD output in U-Boot and saw it looked a little better- I thought the tint was the backlight. Had you not contacted me and had it not affected the person I'm doing work for I would not have bothered looking in to this. It's entirely possible that the other supported devices have this issue, or that future ones will and nobody will notice. Going with a preventative approach here by fixing it for all potential devices and relying on the behaviour the sunxi code assumes rather than the datasheet says seems like the best approach to me. John. ^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: T113 TCON Top tinting troubleshooting 2024-06-29 20:58 ` John Watts @ 2024-07-02 15:32 ` Jakob L 0 siblings, 0 replies; 4+ messages in thread From: Jakob L @ 2024-07-02 15:32 UTC (permalink / raw) To: John Watts Cc: Kirby Nankivell, linux-sunxi, andre.przywara, Paul Kocialkowski, Maxime Ripard, Chen-Yu Tsai, Jernej Skrabec, Maarten Lankhorst, Thomas Zimmermann, David Airlie, Daniel Vetter, Samuel Holland, dri-devel, linux-arm-kernel, linux-kernel Hi John, i am pretty sure other devices don't have this. At least i have never seen it on V3s, A20, A33, H3, A64 with RGB, HDMI, LVDS, or Mipi. This was the first - and on MIPI its pretty bad, to a point where its not usable. With the allwinner u-boot from BSP i had not experience that tint - but i assumed it to be somewhere in the wrong Mipi packager or DMA setup. Since i am not very experience with mainline contributions i am not sure what is the best approach. While i agree that ideally its done right on all sunxi devices, the risk of breaking something without need should be avoided? All the best Jakob Am Sa., 29. Juni 2024 um 23:01 Uhr schrieb John Watts <contact@jookia.org>: > > Hi, > > On Sat, Jun 29, 2024 at 12:14:39PM +1000, Kirby Nankivell wrote: > > Tested this on a MangoPI-MQ-R with a RGB lcd and can confirm that this fix > > removes the green tint I experienced. > > > > Disabling the mixer1 in DTS entirely also works. > > > > I suspect on the basis that the Mixer/TCON-TOP topology is identical to the > > R40 but does not seem to experience this issue, that is a > > silicon errata specific to the T113/D1s as far as we currently know. > > > > However, there is no functional reason from a drm perspective to require > > more than one mixer tied to one output via tcon-top - unless someone has a > > good argument here? > > > > in my opinion: > > 1) implement this as a quirk on the t113 and fix mixer0 > rgb/dsi and > > mixer1 > tv0 > > 2) make this a global default for the sun8i tcon top driver where only one > > mixer is initialised against an output (which would also impact the R40) > > The only reason I caught this issue was because I implemented LCD output in > U-Boot and saw it looked a little better- I thought the tint was the backlight. > Had you not contacted me and had it not affected the person I'm doing > work for I would not have bothered looking in to this. > It's entirely possible that the other supported devices have this issue, > or that future ones will and nobody will notice. > > Going with a preventative approach here by fixing it for all potential devices > and relying on the behaviour the sunxi code assumes rather than the datasheet > says seems like the best approach to me. > > John. ^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2024-07-02 15:33 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-28 18:52 T113 TCON Top tinting troubleshooting John Watts
[not found] ` <CALP2yXcUrCdzyqQx7RQUup3QjfbH4VnMVCPFVXNmmd08GJkKMQ@mail.gmail.com>
2024-06-29 2:12 ` John Watts
[not found] ` <CAMBcuYNG6n1_yc0-5MSFoh2xCfh3-tHG7VcQq5vY65RKSq39RA@mail.gmail.com>
2024-06-29 20:58 ` John Watts
2024-07-02 15:32 ` Jakob L
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).