ftg has quit [Read error: Connection reset by peer]
hexdump01 has joined #linux-sunxi
hexdump0815 has quit [Ping timeout: 480 seconds]
cnxsoft has quit [Remote host closed the connection]
junari_ has joined #linux-sunxi
junari has quit [Ping timeout: 480 seconds]
bauen1 has joined #linux-sunxi
sh1 has quit [Ping timeout: 480 seconds]
junari_ has quit [Remote host closed the connection]
bauen1 has quit [Read error: Connection reset by peer]
JohnDoe_71Rus has joined #linux-sunxi
bauen1 has joined #linux-sunxi
bauen1_ has joined #linux-sunxi
bauen1 has quit [Ping timeout: 480 seconds]
sh1 has joined #linux-sunxi
junari has joined #linux-sunxi
junari has quit [Remote host closed the connection]
junari has joined #linux-sunxi
junari has quit [Remote host closed the connection]
junari has joined #linux-sunxi
junari has quit [Remote host closed the connection]
junari has joined #linux-sunxi
cnxsoft has joined #linux-sunxi
radxanaoki1 has joined #linux-sunxi
radxanaoki has quit [Ping timeout: 480 seconds]
radxanaoki1 has quit []
junari has quit [Remote host closed the connection]
apritzel has joined #linux-sunxi
Jookia has left #linux-sunxi [#linux-sunxi]
Jookia has joined #linux-sunxi
hazardchem has quit [Remote host closed the connection]
hazardchem has joined #linux-sunxi
Jookia has left #linux-sunxi [#linux-sunxi]
bauen1_ has quit [Ping timeout: 480 seconds]
apritzel has quit [Ping timeout: 480 seconds]
funderscore is now known as f_
kepstin has quit [Remote host closed the connection]
kepstin has joined #linux-sunxi
apritzel has joined #linux-sunxi
bauen1 has joined #linux-sunxi
<kuba2k2>
jernej: the registers you mentioned are slightly different on mixer0 (bsp vs mainline), in particular P0_EN, P1_EN and one of the ALPHA values
<kuba2k2>
however what's odd is that the RGB2YUV color correction is... not visible in the registers on mainline, even though it's applied by that patch
<kuba2k2>
also, BSP does not use mixer1 (all registers are in reset state)
<kuba2k2>
mm yeah, even if I manually write the CSC coeffs in mixer1, they just don't get applied (they are cleared to 0x0 anyway)
<kuba2k2>
perhaps the mixer1 doesn't have CSC?
<kuba2k2>
or maybe I messed up the register addresses.. in mixer0 it's at 0xB0000, I assumed it's the same in mixer1
evgeny_boger has joined #linux-sunxi
evgeny_boger has quit [Ping timeout: 480 seconds]
<kuba2k2>
hm, writing the same coeffs to CCSC10 in mixer1 also fixes the colors.. but only temporarily, it goes green again when I run "startx" or something that changes the display mode
<kuba2k2>
but still no luck with DCSC, like in the mentioned patch
<jernej>
interesting, it's possible that's misconfigured or not even there
bauen1 has quit [Ping timeout: 480 seconds]
<jernej>
kuba2k2: mixer1 should have dcsc according to BSP, so can you do some debug output to apply function just to make sure it is called?
<kuba2k2>
that's what I did, it is called
<kuba2k2>
and it works properly when only mixer0 is enabled (and TVE goes through mixer0), but if it is called to enable rgb2yuv for mixer1, it doesn't work
<kuba2k2>
even writing the coeffs from userspace doesn't apply the changes
<kuba2k2>
so unless the peripheral is at a different address vs mixer0 (or not there at all), I don't know what could be wrong
<kuba2k2>
interestingly, by forcing TV to mixer0 and LCD to mixer1, and setting TCON_TOP->TCON_DE_PERH to 0x02, I am able to run both LVDS and TVE simultaneously, with correct colors
<kuba2k2>
(forcing the mixer choice by literally removing the other ones from DT)
<kuba2k2>
even better, XFCE can see them as two separate displays, even though they share a single 720x480 framebuffer :D
bauen1 has joined #linux-sunxi
ftg has joined #linux-sunxi
<jernej>
kuba2k2: I'm looking into BSP sources and it's pretty clear that mixer1 is used on BSP for TVE output, but I can't find where it maps colorspace to YUV.
<kuba2k2>
soo... how can it be in reset? all mixer1 registers (at 0x5200000) are set to 00008401
<kuba2k2>
(on BSP)
<kuba2k2>
whereas mixer0 at 0x5100000 has the right coeffs in CSC registers (presumably applied in de_dcsc.c)
bauen1 has quit [Ping timeout: 480 seconds]
<jernej>
hm... can you enable two outputs on BSP?
<jernej>
maybe I'm reading it wrong and TCON is meant, not mixer
evgeny_boger has joined #linux-sunxi
<kuba2k2>
jernej: the disp driver doesn't allow that, so I'd have to enable the TCONs and mixers manually in userspace.. that's way too much to configure
<kuba2k2>
TCON1 is the TV TCON, so that would make sense
<jernej>
kuba2k2: are you aware of the following sysfs interface for runtime BSP display driver configuration: https://paste.c-net.org/BenderForty ?
<jernej>
you can use it to completely reconfigure displays without the need to recompile anything
<kuba2k2>
yes, I was following the examples from tina docs (all in Chinese) and could never get it working
<kuba2k2>
(I don't know what all the parameters are)
<jernej>
well, it's always worth to check source code
<kuba2k2>
I still think it will only allow me to "switch" the video output, i.e. no way of enabling both LVDS and TVE at the same time
<kuba2k2>
but I don't think that's the issue here - even without LVDS, when mixer1 is used, the screen is all green
<kuba2k2>
(and mixer1 seems to be used by default for TVE)
<kuba2k2>
*on mainline, that is
<jernej>
you can try, check my example above. select disp1, and use "3 11" for PAL or "3 14" for NTSC
<kuba2k2>
all I get is [ 200.069650] Invalid para
cnxsoft has quit [Ping timeout: 480 seconds]
<jernej>
strange... too bad that I don't have board to experiment
aperezdc has quit [Ping timeout: 480 seconds]
<kuba2k2>
yeah.. for now the only method that works on mainline is to disable mixer0 for LCD and disable mixer1 for TVE
<kuba2k2>
and honestly, I don't see why would both mixers be needed for a single TCON. Especially on D1s/T113 where you can't really have two digital video outputs at the same time (same GPIOs)
<kuba2k2>
so I guess I'll settle for that for now
<jernej>
one mixer is mapped to one TCON, which makes one drm device
<jernej>
if you have two pairs, you can drive two outputs completely independently
<jernej>
btw, which board do you have?
<kuba2k2>
I can drive two outputs independently (LVDS and TV), and each TCON has a single mixer in DT, not two like it originally was
<kuba2k2>
I know each TCON probably chooses one of the mixers from DT, but it seems it needs some "help" in choosing the right one
<kuba2k2>
jernej: the board is custom-made, raspberry pi form factor
<jernej>
ah, be aware that DT describes hardware, not configures it. Since each mixer can be connected to any TCON, having all possible connection is correct. It's up to the driver to select combination of the mixer and TCON.
<jernej>
IIRC current selection method is to match lower indices of both, so mixer0 will match with TCON LCD0, since both have lowest id.
<jernej>
also note that mixer0 is in almost all cases most capable, so ideally it should be matched with more capable output
<kuba2k2>
I'm aware that removing the mixer from DT is not a real solution
<kuba2k2>
but TVE needs the DCSC capability, and since mixer1 seems not to have it (or the driver doesn't know how to configure it), then mixer0 is all that's left
<jernej>
I still think that we're missing something
<kuba2k2>
same
<kuba2k2>
but I'm by no means an expert in this area, so I have no more ideas
<jernej>
H3 doesn't have TCON TOP, so switching muxer <-> TCON connections is done differently, through MUX bit
<jernej>
oh, you can also try to write alpha register in dcsc, if you haven't try already
<kuba2k2>
in mixer1? I doubt it will even actually store
<kuba2k2>
the clock setup in this patch is relevant: "mode->crtc_clock *= tv->quirks->fixed_divider;", fixed_divider being 16
<kuba2k2>
so crtc_clock=13.5MHz * 16 = 216MHz
<jernej>
yeah, H3 TVE clock feeds from DE clock
bauen1 has joined #linux-sunxi
<jernej>
but that's not the case for D1/T113
<kuba2k2>
maybe. But 13mhz is certainly not the right frequency for the TVE :)
<jernej>
have you dump clock tree on BSP and compare it to mainline?
<jernej>
by dump I mean "cat /sys/kernel/debug/clk/clk_summary"
menomc has left #linux-sunxi [#linux-sunxi]
mnemoc has joined #linux-sunxi
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
Schimsalabim has quit [Ping timeout: 480 seconds]
Schimsalabim has joined #linux-sunxi
vagrantc has joined #linux-sunxi
apritzel has quit [Ping timeout: 480 seconds]
dsimic is now known as Guest9841
dsimic has joined #linux-sunxi
Guest9841 has quit [Ping timeout: 480 seconds]
Schimsalabim has quit [Read error: Connection reset by peer]
Schimsalabim has joined #linux-sunxi
munchaus1n has joined #linux-sunxi
munchausen has quit [Ping timeout: 480 seconds]
<tokyovigilante>
jernej: did you need any time to review the v7 DE33 set? I have put together a minimum series for just RGB functionality + AFBC, and will ideally post that before I am away at the end of this week unless you want to make any other comments on v7
<jernej>
well, ideally I want mripard to comment on how to properly tackle plane issue
<jernej>
since it's important to get device tree right from the beginning
<kuba2k2>
and here I was reading CCU registers from userspace and calculating the rates manually..
dsimic has joined #linux-sunxi
<tokyovigilante>
thanks. Ok well I will send the v8 cut down as you've suggested and hopefully get more feedback, I confess my understanding of it is a bit limited and I need to do some more reading and understanding of how it should work more generally. Thanks for the help so far.
<kuba2k2>
jernej: after a fresh boot (without manually messing with the clocks, that is) the TCON TV is clocked at 1188MHz on BSP, and at 13.5MHz on mainline :)
<jernej>
1188 MHz certainly seems excesive, usually is 27 MHz or 216 MHz for TVE
<jernej>
can you post clock summary from BSP?
<jernej>
tokyovigilante: I appreciate that you're pushing this forward
<jernej>
so, if you have TCON_TV0_CLK_SRC set in TCON_TOP, then it's actually 216 MHz from TVE clock and you can ignore TCON clock
<kuba2k2>
yeah, that's what I thought. TVE clock is still 81 MHz on mainline. User manual says it should be 216
<jernej>
hm... de0 is also at 432 MHz. This can be changed in sun8i_mixer.c for mainline
<kuba2k2>
from what I can see de0 is not an issue, I never had to change its clock
<kuba2k2>
here's the clock tree on mainline: https://pastebin.com/raw/qa4kewF1 notice how the TCON TV clock was requested to 13.5 mhz and that influenced everything else connected to pll-video0
<jernej>
you might be the first one trying to run TVE with TCON_TOP
<jernej>
so those issues weren't solved yet
<kuba2k2>
I imagine so :D
<jernej>
what if you just comment out clk_set_rate() in TCON?
<kuba2k2>
I know *more or less* how to "make it work", but it would probably end up being very specific to D1/T113 and not upstream-able
<kuba2k2>
hmm I'll try that too
apritzel has joined #linux-sunxi
<kuba2k2>
without clk_set_rate() it's simply left at 297 mhz, or 1188/4, which seems to be the default rate for the mixer
wingrime1 has quit [Ping timeout: 480 seconds]
<jernej>
more important is that tve stayed at 216 MHz
<kuba2k2>
mm, it didn't
<kuba2k2>
they are all at 297
<kuba2k2>
I don't see anything that explicitly sets the tve clock
<kuba2k2>
huh, if I multiply the crtc_clock * 16, so that clk_set_rate() in TCON gets 216 mhz, then all clocks are at 216 mhz (tcon, tve, de, mixer)
<kuba2k2>
without the multiplier *16, the TCON gets 13.5 mhz as requested, but everything else gets 81 mhz for some reason