libera/#maemo-leste/ Monday, 2021-10-25

Wizzupok, should be done14:11
Wizzup(isp switch)14:11
freemangordontmlind: seems there is some coherency issue on mmaped BOs, no matter what I do, x11perf tests show terrible tearing. this happens on both d4 and n90016:08
freemangordonI think what I am doing is correct:16:09
freemangordon1. mmap16:10
freemangordon2. ioctl  DMA_BUF_IOCTL_SYNC/  DMA_BUF_SYNC_START16:10
freemangordon3. read/write memory16:10
freemangordon4. ioctl  DMA_BUF_IOCTL_SYNC/  DMA_BUF_SYNC_END16:10
freemangordon5. munmap16:10
freemangordonunless I am missing something, this should assure coherency between CPU and GPU16:11
freemangordonbut it does not :(16:11
freemangordonat least this is my understanding16:20
freemangordonor, something else happens16:20
tmlindfreemangordon: ok, care to upload some vid on the tearing?16:25
freemangordonthe same happens with omap driver though16:25
freemangordonok16:25
freemangordontmlind: BTW, I modified   omap_gem_is_cached_coherent to always return false and am testing with that on d416:26
tmlindhmm so with the reverted 33bc43 we at least need to check OMAP_BO_WC and OMAP_BO_UNCACHED masks separately as OMAP_BO_UNCACHED is 016:27
freemangordonbma_buf gems are allocated with OMAP_BO_WC flag IIUC16:28
tmlindyeah and on n900 it should be DMABUF16:29
freemangordonisn;t it dma_buf on d4 too?16:29
freemangordondespite the tiler?16:29
freemangordonsec, to provide link to the video16:30
tmlindno, it's shmem write-combine on omap4, OMAP_BO_MEM_DMA_API on n900 afaik16:30
tmlindweird if both n900 and d4 have the same tearing.. i confirmed that hdmi enabled does not remove the tearing i'm seeing with wlroots and termite16:30
tmlindso i thought this was tiler mapping related issue, but maybe what you see on n900 and d4 is something different then16:31
freemangordonI didn't try omap driver on n900 though, but the issue looks the same with glamor replacement driver16:33
freemangordonhttp://46.249.74.23/leste/20211025_001.mp416:33
freemangordonthis16:33
freemangordonomap driver16:34
freemangordonwith glamor replacement it is worse, because of the way higher performance16:34
freemangordonalso, there is a black rectangle in the upper-right corner of the screen for -comppixwin500 (and some other tests)16:35
freemangordonlemme record another video16:35
tmlindthat top left corner tearing on d4 looks somewhat similar to what i see with wlroots and termite16:37
freemangordonsee http://46.249.74.23/leste/20211025_002.mp416:38
freemangordonmaybe xorg related, lemme downgrade to stock16:39
tmlindheh have not seen that one before :)16:39
tmlindbrb16:39
uvosfreemangordon: honestly cant tell what http://46.249.74.23/leste/20211025_001.mp4 is supposed to show me16:39
uvosthats what x11perf  -comppixwinXXX looks like on my dekstop too16:40
freemangordonwith a black rectangle?!?16:40
uvosfreemangordon: first video16:40
freemangordon-comppixwinXXX is the second video16:40
uvoswhats the first one of?16:41
freemangordon-dots16:41
uvosyeah no black rectangles ofc16:41
freemangordonhalf of the dots are missing, in a random order :)16:41
freemangordonlets see with stock xorg16:42
uvosfreemangordon: yeah16:42
uvosthats how dots works on destkop for me too16:42
freemangordonreally?16:42
uvosuncomposed x is immidate mode....16:42
uvosyeah16:42
uvosuncompsed x looks like that16:42
uvos*uncomposited?16:43
freemangordonnot here16:43
uvosnot sure how to say16:43
uvosfreemangordon: using intel?16:43
freemangordonon my desktop I mean16:43
uvosintel has a hack in the ddx16:43
uvoswhat ddx16:43
freemangordonno, nvidia16:43
uvossome ddx use specal hacks to work around it16:44
freemangordonbut, this is ubuntu 14 so everything is all16:44
uvosbut regular x has no vsync and uses uncoordinated imiidate mode rendering16:44
uvoswhich is what modesetting dose16:44
uvosnvidia ddx also has special tear free option in ddx iirc16:44
uvos(from 10 years ago)16:44
freemangordonnot really, IIUC, I think it renders to back buffer16:44
uvosyeah but when the draw calls are processed16:45
uvoscore x ones that is16:45
uvosis uncoordinated with any refresh16:45
uvosso the application dose XPlotPixel or whatever16:45
uvosand that lands on this frame or the next or who knows16:45
freemangordonno, see backscrol about the sequance16:45
freemangordonDMA_BUF_SYNC_START/DMA_BUF_SYNC_END16:46
uvosno i mean in X api16:46
freemangordonmaybe I don;t understand what you say16:46
freemangordonmodesetting has only one buffer?16:47
uvosold school x draws directly into front buffer, so core x drawing calls dont coordinate with any refesh16:47
freemangordonIIUC, it has 2 buffers and draw calls are on back buffer16:47
uvoshow modesting draws is immaterial16:47
uvosthe core x drawing fuctions draw when the call comes in from xlib over the wire16:48
uvosthat can be before or after a refresh16:48
freemangordonbut ms presents on vsync16:49
uvossure but what is it presenting16:49
uvosthe back buffer16:49
freemangordonyes16:49
uvosthe tearing is on the back buffer allready16:49
freemangordonbut why it is there, given that all the drawing happened there?16:49
uvosbecause the x application that uses core x drawing calls16:50
uvosjust draws at some point in time onto the back buffer16:50
uvosthe backbuffer then flips while its sill drawing16:50
uvosthis is the whole problem16:50
uvoswhy removing tearing entirely is almost impossible in x16:51
uvosand why wayland has this every frame is perfect thing16:51
uvosas a core concept16:51
freemangordonso, lemme see if I get this right:16:51
freemangordon1. we have a back buffer not currently presented on the screen16:52
freemangordon2: application issues "fill rectangle" call16:52
freemangordon3. DDX starts drawing that rectangle on the back buffer16:53
freemangordon4. somehow, in the middle of the drawing MS flips16:53
freemangordonuvos: is this what happens?16:53
uvosfreemangordon: no16:53
freemangordonok, call me stupid, but I don;t get it then :)16:54
dreamerfreemangordon: you're stupid16:54
freemangordonthanks16:54
dreamer:)16:54
dreamery/w16:54
uvosfreemangordon: application wants to draw 3 lines16:55
uvosfreemangordon: applicaiton  calls XDrawLine, x draws line on back buffer, application calls XDrawLine, line finishes drawing, ms flips buffer, application calls XDrawLine16:55
uvosupps one frame with 2 lines16:55
uvosand one frame with 1 line16:55
Wizzupttps://gitlab.freedesktop.org/vliaskov/xserver/-/commit/18be004ad18b8a33e5854c08ab2ea023f34890b616:56
freemangordonuvos: that's why I gave example with "fill rectangle"16:56
uvosfreemangordon: so the not sure what happens with rectangle16:56
uvossome calls decompose into others16:56
Wizzupfrom https://gitlab.freedesktop.org/xorg/xserver/-/issues/24416:56
uvosso 1 rectangle can have tearing16:56
sunshavifmg: dreamer: :)16:56
dreamersunshavi: fmg?16:57
sunshavis/fmg/freemangordon/16:57
Wizzupalso https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/24#note_4146816:57
uvoshttp://uvos.xyz/maserati/videos/recording.mp416:57
freemangordonuvos: they decompose, but the particular test case draws 4000 dots16:57
uvosmodesetting on amdgpu16:57
uvosfreemangordon: right so some frames have dots16:58
uvossome dont16:58
uvossome have some16:58
freemangordonbut they are drawn in a single pass, I can provide call stack16:58
Wizzup(what I linked adds tearfree to modesetting, but not for rotated display and also is not merged in xserver)16:58
freemangordonuvos: video seems to be broken16:59
uvosuse mpv16:59
freemangordon45k16:59
Wizzupit works for me16:59
uvosthats correct16:59
freemangordonok16:59
uvosff dosent like it on my end ether16:59
freemangordonomg17:00
freemangordonthis is awful17:00
uvoswell it goes away if you enable compositing17:01
uvosbecause then every application has its own back buffer17:01
uvosand draw calls just accumulated17:01
uvosbut this is just how x is desinged17:02
uvosits also largly irrelivant because modern applications ussualy just flip the whole window as one pixmap17:03
freemangordonstock xorg + omap driver draws nothing :D17:06
Wizzupright, x11perf might not be the best test case for tearing17:08
uvosaccualy what is concerning about the dots video on d417:08
uvosis that is changes so slowly17:09
freemangordonthis is omp driver17:09
uvosok17:09
freemangordon*omap17:09
freemangordonwith glmaor replacement is it waaaay faster17:09
freemangordonbut still, we should not have that black rectangle17:09
uvosright17:09
uvosthere is something wrong there for sure17:10
uvosmaybe same thing as missing tiles on ddk1.917:10
uvosbut idk17:10
uvosjust spculating17:10
uvos*speculating17:10
freemangordonno tiles on n90017:11
uvosno tiler on n90017:11
uvossgx is sill a tile based renderer17:11
uvosbut that dosen pass though gpu dose it17:11
uvoshmm17:11
freemangordonand there the black rectangle is on lower-left corner17:11
freemangordonit doesn't17:11
uvosno idea17:11
uvossorry17:11
freemangordonthat why I think there is something wrong with either cache or mmap17:11
Wizzupis this also visible outside of x11perf?17:13
uvosit might make sense to try your dri3 non glamor modesetting on some very stable drm driver17:13
uvoslike amdgpu or intel17:13
uvosjust to ensure that its not that17:13
freemangordonuvos: hmm, lemme try MS without glamor17:14
uvosyeah just NoAccel glamor might be a good test too17:14
uvos*modesetting17:14
freemangordonmhm17:15
bencohconsidering how people complain about tearing issues on various pc setups, it might be just that, yeah17:16
freemangordonthe same happens on NoAccel glamor17:17
uvos*modesetting17:17
uvos:P17:17
freemangordonyea17:18
freemangordonbut it happens with omap too17:18
uvosso some buffer sync thing between cpu and dss or something17:18
uvoslike that17:18
freemangordonso I would say it is a kernel thing17:18
uvosyeah17:18
uvostmlind is your fault :P17:18
freemangordonheh, upstream xorg has font sizes broken :D17:19
uvosfreemangordon: might make sense to try omapdrm with NoAccel modesetting on a mainline kernel with no sgx patches17:20
uvosand see if it sill happens & report a bug on linux17:20
uvosml17:20
uvosi can do so if you like17:21
freemangordonyeah, maybe17:21
freemangordonuvos: if you can17:21
uvosok17:21
freemangordonthat'd help a lot17:21
freemangordonbut I think I didn;t see the same issue with ny test applications17:22
uvosdo any of your test applicaitons17:22
uvosoh ok17:22
uvosnvm then17:22
uvosfreemangordon: wrt font sizes17:26
uvosfreemangordon: xorg is probubly just reporting correct dpi17:26
uvosfreemangordon: i noticed that the display size porparty in x is wrong on current leste setup17:26
uvosfreemangordon: setting it to be correct breaks gtk2 fonts17:27
uvosamoung others17:27
uvosso check that17:27
freemangordonah, I see17:28
uvosxdpyinfo  | grep resolution17:30
tmlindfreemangordon: here are hopefully better version of two patches to replace the reverted 33bc43 commit: muru.com/linux/d4/omapdrm-flush/17:30
tmlindseems to fix my termite on wlroots issue better than 33bc43 based on quick testing17:31
freemangordontmlind: shall I test?17:31
tmlindheh well based on about 1 minute of testing :)17:31
tmlindyeah please do, hopefully it won't hang n900 any longer17:32
freemangordonok, will try in a couple of minutes17:32
tmlindwell if n900 hangs then would be good to know which of the two patches causes it17:32
tmlindso far no tearing here :)17:34
tmlindoh also the weirdness around the sun in stellarium seems to be gone now17:36
tmlindok saw some tearing on the hdmi panel, so there's at least some issues remaining17:39
tmlindbbl17:40
tmlinduvos: maybe also take a look and see if those help with the tearing you're seeing?18:01
freemangordonuvos: resolution:    264x265 dots per inch18:09
tmlindhmm running glmark2-es2-wayland nowadays produces a sgx lockup, i guess that must be the mesa vs blobs issue18:11
freemangordonmhm18:11
freemangordontmlind: with both patches applied n900 seems to boot fine18:12
freemangordonglmark runs fine too, so it seems nothing got broken :)18:16
tmlindok great18:18
tmlinddid these help with your tearing issues at all?18:19
freemangordonlemme check18:19
freemangordonno18:26
freemangordonthis black square is still there on both devices18:26
tmlindok18:27
tmlindseems like a separate issue so i'll push out these two fixes if no comments18:28
freemangordonyeah18:32
tmlindok pushed out updated droid4-pending-pvr-omapdrm-v5.1518:37
tmlindlooks like rm /dev/dri/renderD128; ln -s /dev/dri/card0 /dev/dri/renderD128 can be used to work around the omapdrm/pvr render node limitations18:46
tmlindwe should somehow fix omapdrm to allow the standard calls on /dev/dri/renderD128 also with only allocation happening on /dev/dri/card018:47
tmlindi guess the /dev/dri/renderD128 is created automatically by the kernel based on some flag?18:50
uvosfreemangordon: yeah thats correct18:50
uvosfreemangordon: so upstream fixed it18:50
uvoson current leste its resolution:    96x9618:51
tmlindah DRIVER_RENDER i guess creates /dev/dri/renderD12818:51
uvosannoingly nokia just decided its ok to just scall up the fonts18:51
uvosand leave it set wrong at 96x96 (before kms xorg had no way to know the display size without being told in xorg.conf)18:52
uvosthis is also why scaling in qt5 and gtk3 is broken in leste18:52
uvoswell part of the reason anyways18:52
uvoseven if xorg reports correctly scaling is still pretty broken18:53
uvosbecause the toolkits (esp gtk3) dont do this well18:53
uvos(and gtk2 dosent scalle at all besides fonts)18:53
uvosand everyone blames "X" for scaling being broken on linux... but im getting into a rant here again18:54
uvosand now in wayland mutter they report lie to applications to about the window size and then do bliniear scaling on gpu to make things the right size.. grrr18:56
tmlinduhh i guess nothing wrong with omapdrm for /dev/dri/renderD128, we somehow need to translate /dev/dri/renderD128 to /dev/dri/card0 for the pvr mesa or blobs :(19:06
* tmlind goes to build mesa again on d419:19
freemangordontmlind: doess dss support HW rotation?19:38
freemangordonI remember there was something called vrfb19:38
tmlindi think rotation is there only for the tiler and there was something in omap1 that used the sdma19:44
freemangordondo you know if dss driver supports it?19:44
tmlinddon't think so, i think only tiler is supported19:44
freemangordon:(19:45
uvosportrait n900 will be hella slow with roation working in sw no?19:45
tmlindnot sure if later omaps even have the sdma support for rotation any longer since omap119:45
freemangordonuvos: yeah19:45
uvos:(19:45
uvoswell pvr2d could do it19:45
freemangordonbut, fremantle somehow manages to do it19:45
tmlindhmm so what was nokia using on fremantle then?19:45
uvospvr2d proubly can rotate the surface on pvr or?19:45
freemangordondon;t know19:45
freemangordonbut, I think omapfb was able to rotate19:46
freemangordonso I guess it was somthing in the kernal19:46
tmlindoh there is some roation support in omapdrm for framebuffer with the rotate command line, not sure if it's all software without tiler19:46
* tmlind has 472/1150 of mesa compiled..19:55
uvosweeee19:56
uvoswe need a big arm server or something19:56
uvos(yeah i know expensive)19:56
WizzupI had that, but it broke down20:05
uvosyeah i know a amd one20:07
freemangordonhmm, why modesetting does not rotate through GL?20:18
uvosit dosent with the glamor path?20:19
uvosin the non glamor path should be obvious why..20:19
freemangordonit doesn;t20:19
uvosi gues that they never needed it20:19
freemangordonit seems it does SW rotation even with glamor20:19
uvossince desktop gpus can rotate in drm20:20
freemangordonyeah20:20
freemangordonI am starting to wonder if it makes sense to continue waste time on that20:20
freemangordonthat == modesetting20:20
uvosi dont see why your wasting time?20:21
freemangordonbecause it is broken all over the place20:21
uvosthe plan is to create a acell plugin that uses pvr2d right?20:21
uvosok20:21
freemangordonyes, but we have nasty bug in modesetting20:21
freemangordon*bugs20:21
uvoswhat is it?20:21
uvosmaybe list the ones you found20:22
freemangordonlet me record a video, you might have an idea what it might be20:22
uvosi can try repoducing them later20:22
uvoson amdgpu or plain omapdrm w/o sgx20:22
freemangordonBTW h-d scrolls with 58-59 fps20:22
freemangordonon n90020:22
uvosneat20:22
freemangordonyeah20:22
uvoswhat about gtk2 scrolling lists and sutch?20:23
uvos(ie non gl accelerated rendering)20:23
freemangordonbut, there is some 'frames repetition", you'll see in the video20:23
uvosok20:23
freemangordonI want ^^^ fixed first20:23
uvosany you have evidence that this is ms fault?20:23
uvosor why are you unhappy with it20:23
freemangordonit happens with glamor as well20:23
uvossure but that dosent mean its not omapdrms fault...20:24
freemangordon'real' galmor20:24
freemangordonwait for a video :)20:24
uvosok ok20:24
uvosalso any bugs you find in ms upstream might fix20:24
uvossince ms is also the base of xwayland....20:24
uvos...and wildy used still on bare metal x too20:25
freemangordonhttp://46.249.74.23/leste/20211025_003.mp420:29
freemangordonI have the feeling that wrong pixmaps is being drawn to20:30
uvosfreemangordon: well i dont see anything that couldent be cause by the kernel messing up buffer allocation or setting up the mmu for dss usage20:31
uvosbut im prediposed to think modesetting is not buggy beacuse i have used it for like 10+ years on various devices....20:32
uvosthe fact that ddk1.9 with vidoe-omap allso has kinda simmular looking artifacts20:32
uvosaltho they are less bad20:32
uvosalso makes me suspect the kernel...20:33
freemangordonmost-probably because it is slower :)20:33
freemangordonyeah, could be20:33
freemangordonbut have no idea how to debug20:33
uvoswell first i would try mainline kernel no patches with mainline modesetting no patches on a d4 and see if it artifacts20:34
freemangordoneither the driver draws to wrong framebuffer or MS asks kernel to flip to wrong framebuffer or kernel displays wrong framebuffer :)20:35
uvosi will do this soon i promise20:35
uvostomorrow20:35
uvosand then ask on the kernel m-l20:35
uvosand maybe report a bug against xorg20:35
uvosif so20:35
freemangordonthis happens with hildon-desktop only20:35
freemangordonhmm, I will start it with SW rendering, lets see20:35
uvosoh so the problem with black sections in core x rendering is gohne20:36
uvossorry if i missed it in backscroll20:36
tmlindyeah maybe the two patches i pushed today fixed the black sections that don't get refreshed20:37
freemangordonno, it isn't20:37
tmlindyou still see some black squares that don't get refreshed?20:38
freemangordononly with x11perf20:38
freemangordonbut I guess this is to be ignored20:39
uvosno20:39
uvosfreemangordon: try something else that renders in 2 in a loop20:39
uvoslike resizing xeyes or something20:39
freemangordonhmm, it seems like ms without glamor works fine20:40
uvosalso sutch artifacts i also sometimes encounter on wayland (sway, weston) too20:40
uvosagain makeing me suspect kernel...20:40
freemangordonI see20:40
uvoslike bits black bits of missing frame mostly at the top right20:41
uvoscan hapen in qt applications on sway20:41
freemangordonby kernel you mean omapdrm I guess20:41
uvosyeah20:41
freemangordontmlind: can we have tomi on the channel  somehow?20:42
freemangordon:)20:42
freemangordonoh, so what we have working now on n900 is omapfd, right?20:43
freemangordon*omapfb20:43
uvosyes20:43
uvoson d4 its omapdrm20:43
uvosand its artifacting20:43
uvosagain the common bit is omapdrm20:43
freemangordonyeah20:43
freemangordonmhm20:43
freemangordonI wonder how to debug that20:44
uvosno idea20:44
Wizzupif you take a screenshot using X, I guess the artifacts are not there?20:44
uvostotaly over my head20:44
freemangordonWizzup: did you watch the video?20:44
Wizzupyes20:44
uvosfreemangordon: yeah but if scrot also shows the problem is interesing question20:44
uvoson ddk1.9 scrot is fine20:44
freemangordonI wouldn;t say these are artifacts, rather wrong framebuffers20:45
freemangordonwhat is scrot20:45
uvosx11 screenshot tool20:45
Wizzupfreemangordon: yeah, I was wondering around the xterm20:45
freemangordonWizzup: it is like it renders every line to a different framebuffer/pixmap20:46
tmlindi uploaded the omapdrm flush debug patch i used too to muru.com/linux/d4/omapdrm-flush/20:46
freemangordonhmm, maybe I shall trace what FB memory it renders to20:48
tmlindi just looked at the flushing path taken after starting sway and termite and pressing keys, maybe there are other paths that are unhandled too20:50
tmlindhowever, afaik n900 is not using this code path at all since it's not shmem write-combined20:51
* tmlind has 1096/1150 of mesa built now..20:51
freemangordonbut it is WC, no?20:51
tmlindhmm actually yeah, but not shmem mapped so should not need anything there20:52
freemangordonhmm, whith h-d running I see no black box20:54
uvosfreemangordon: well the artifacting is highly timeing dependant20:57
uvosfreemangordon: on ddk1.920:57
uvosfreemangordon: you can mess with the sgx clocks and make it better or way worse20:57
uvosfreemangordon: generaly longer frame rendering times makes the problem explode20:57
uvosso the missing boxes might just be a timeing fluke20:58
uvos(if the ddk1.9 problem and yours is related in the first place - but it suspect it is)20:58
* tmlind has mesa finally built21:12
tmlindlooks like the render node checks are in the blobs21:15
freemangordonany idea what "omapdrm omapdrm.0: atomic complete timeout (pipe 0)!" is?22:18

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!