maemo-leste / bugtracker

Issue tracking repository
62 stars 3 forks source link

PowerVR DDK 1.17 Glamor/Xorg #524

Closed MerlijnWajer closed 2 years ago

MerlijnWajer commented 3 years ago
22:21 < Wizzup> ddk 1.17, the holy grail :)
22:21 < parazyd> Did you document the current status?
22:21 < parazyd> And what could be done to help out?
22:21 < uvos> no not really
22:21 < uvos> yeah ddk1.17 solves a lot of our problems...
22:21 < uvos> if only x worked
22:22 < uvos> not sure what could be done to help out
22:22 < uvos> i just need a very conious block of time
22:22 < uvos> and im not sure what avenue to explore
22:23 < Wizzup> I suppose being able to trigger the bug with the most simple program
22:24 < uvos> so fmg was to the point that on d4 it segfaults because it moves data from one type of texture to another directly
22:24 < uvos> that (maybe) is not alowed per spec
22:24 < uvos> he wrote an a porgram that repoduces this
22:24 < uvos> but i really dident go into this direction at all
22:25 < uvos> instead i tryed out pvr on mesa and wanted to try out the hybris glamor on that
22:25 < uvos> since it works on d4 with the android pvr blobs
22:25 < uvos> so i backported the hybris glamor back to gbm
22:26 < uvos> and that fails becaus it cant find a texture format it likes
22:26 < uvos> theres where i stopped to do some other stuff for now
22:26 < Wizzup> I remember something about that, wrt the texture format, but I suppose that could be many things
22:26 < uvos> yeah i dident look at why at all
22:27 < Wizzup> iirc fmg ran into that and fixed it somewhere
22:27 < uvos> fmg's sticking point is pretty solvable tbh
22:27 < Wizzup> you saw this I presume? https://github.com/maemo-leste-upstream-forks/xorg-server/commits/drm_render
22:27 < Entitlement> Wizzup - [ Commits · maemo-leste-upstream-forks/xorg-server · GitHub ]
22:27 < uvos> the porblem is known and you just have to find all the places it happens in glamor
22:28 < Wizzup> maybe this is not even for ddk 1.17
22:28 < Wizzup> hm
22:28 < uvos> but id rather use the mesa patches
22:28 < uvos> than straigt pvr
22:28 < uvos> Wizzup: yeah also fmg has his progres in a git repo
22:29 < uvos> additonally
22:29 < uvos> additonally
22:29 < uvos> on n900 nothing works for some reason, wrt rendering to gbm textures from gles, fmg mentioned.
22:29 < uvos> but idk what the state is there
22:30 < uvos> thats pretty mutch all i have
22:30 < uvos> not mutch you could say :)
22:31 < uvos> if someone wants a crack at it
22:31 < uvos> https://github.com/IMbackK/mesa <- this is patched mesa
22:31 < Entitlement> uvos - [ GitHub - IMbackK/mesa: Mesa packages with lima and llvmpipe enabled ]
22:32 < uvos> https://github.com/IMbackK/pvr-omap4 <- binary patched an packaged (sorta) prv libs
22:32 < Entitlement> uvos - [ GitHub - IMbackK/pvr-omap4: mirror of PowerVR OMAP4 libraries ]
22:32 < parazyd> Could also be worth trying latest xorg git
22:32 < uvos> parazyd: we work ontop of latest git
22:32 < parazyd> Along with this, ofc. Not saying latest xorg would solve it.
22:32 < uvos> older xorg, forget it
22:32 < parazyd> ah you did? ok
22:32 < uvos> gles support is lacking even more
22:33 < parazyd> Because in our repo it's not latest
22:33 < uvos> yeah sec
22:33 < Wizzup> uvos: this is not what you ran into right? https://github.com/IMbackK/mesa
22:33 < sicelo> Straight pvr works ... but has its own issues - even glmark2 isn't working on Droid 4 with it, unless I've made some mistakes
22:33 < Entitlement> Wizzup - [ GitHub - IMbackK/mesa: Mesa packages with lima and llvmpipe enabled ]
22:33 < Wizzup> errr
22:33 < Wizzup> https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/553
22:33 < Entitlement> Wizzup - [ Draft: glamor: Fix rendering of pixmap textures backed by EGLImageKHR image (!55... ]
22:33 < uvos> sicelo: glmark works fine
22:33 < uvos> sicelo: on ddk1.17 for me
22:33 < sicelo> *straight mesa, I mean
22:33 < uvos> hmm?
22:33 < Wizzup> I am tired today, sorry, I meant this one: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/568
22:33 < Entitlement> Wizzup - [ glamor: Fix rendering of pixmap textures backed by EGLImageKHR image (!568) · Me... ]
22:33 < uvos> strait mesa as in llvmpipe?
22:34 < uvos> with omapdrm?
22:34 < sicelo> Jonathan's mesa
22:34 < sicelo> Mesa+pvr
22:34 < uvos> yeah
22:34 < uvos> it has issues
22:34 < Wizzup> uvos: it sounds similar to the texture problem you ran into, I think
22:34 < uvos> idk if glmark works
22:34 < uvos> Wizzup: no thats not ti
22:34 < Wizzup> ok, too bad
22:35 < sicelo> You can try. No luck for me so far on postmarketos. Glmark immediately crashes the gpu there ... but it ran with TI's blobs on N900
22:35 < uvos> sicelo: ok
22:35 < uvos> it runs on full blobs for sure on d4
22:35 < uvos> weston and ksmcube at least work fine on the google pvr patches
22:36 < uvos> but yeah its buggy
22:36 < uvos> gitlab.freedesktop.org/freemangordon/xserver/-/commits/test <- i started here
22:37 < sicelo> Yes, also kmscube fine for me on pmos with Jonathan's mesa + pvr. Very reliably too. Only one time I got around 40fps, after trying some UI it didn't like
22:38 < uvos> yeah if glmark and other stuff dosent run, maybe we should continue with the blobs
22:38 < uvos> idk
22:38 < uvos> i gues the legwork with the texture suffeling might be our best bet
22:38 < uvos> (as fmg reccomends)
22:39 < sicelo> But give it a try too :-p
22:39 < sicelo> I'm too new to this stuff and might have done something wrong
22:40 < uvos> well i have no idea what im doing either tbh
22:40 < uvos> my trade is mechanical engineering
22:40 < sicelo> At least you know something about gbm and glamor
22:40 < uvos> :P
22:41 < uvos> yeah
22:41 < uvos> problem is i really dont know anything about gl
22:42 < uvos> i only know about kernel interfaces around video/gfx
22:43 < uvos> esspecaly with the texture copying problem, it would be great if we had someone with enough knowlage about gles and egl spec to tell us if whats happing in pvr is to spec
22:43 < uvos> or if its a bug
22:43 < uvos> if its a bug we could complain to ti
22:46 < parazyd> I can try getting through to some people if someone can write me what exactly I could ask them
22:46 < parazyd> wrt gles/egl
22:48 < uvos> is glTexSubImage2D allowed on EGL_KHR_image textures (backed by gbm)
22:51 < sicelo> I think I've seen that before ... glTexSubImage2D ... isn't that something missing on pvr? :-/
22:52 < uvos> no
22:52 < uvos> i think you are thinking about texture clamping modes
22:52 < sicelo> Ok. Might be mistaking it with something else
22:53 < parazyd> uvos: So depending on a yes or no answer we would know if it's a bug in the blobs?
22:53 < uvos> yes
22:53 < sicelo> Ah, mistaking it with GL_EXT_unpack_subimage
22:54 < uvos> ah yeah
23:00 < uvos> http://uvos.xyz/test.c
23:00 < uvos> http://uvos.xyz/maserati/test.c
23:00 < uvos> i also take the liberty of hosting freemangordons test app here
23:01 < uvos> it shows what you have to do to get EGL_KHR_image into glTexSubImage2D without the blobs exploading
23:01 < uvos> thanks to this it really istent more than some legwork to do the same in all places in glamor
23:02 < uvos> (should at least)
23:02 < uvos> with all blobs
23:02 < uvos> mesa-pvr has other / maby additional problems
23:06 < Wizzup> weren't there also hangs? or no hangs
23:07 < uvos> Wizzup: the hang because of the 1bpp textures was solved by fmg
23:07 < Wizzup> ok
23:08 < uvos> i think it still hangs on exit
23:08 < uvos> but i havent tried the latest on the full blob stack
23:11 < uvos> i think everyone is now sutably informed
23:11 < uvos> maybe we should copy the above log into an issue
23:12 < Wizzup> yeah...
IMbackK commented 3 years ago

to get a dev enviroment for this:

Pvr + Mesa

  1. grab https://github.com/tmlind/linux/tree/droid4-pending-v5.13 and merge https://github.com/tmlind/linux_openpvrsgx/tree/droid4-pending-pvr-omapdrm-v5.13
  2. build and install https://github.com/IMbackK/mesa
  3. grab https://github.com/IMbackK/pvr-omap4 (i never finished pacakging this so you will have to copy the files by hand)
  4. build pvrsrvinit.c in https://github.com/IMbackK/pvr-omap4 and run it
  5. voila working pvr ddk-1.17 (check with kmscube)
  6. build and install https://gitlab.freedesktop.org/freemangordon/xserver
  7. build https://github.com/IMbackK/glamor-egl provides a glamor-hybris (works on android pvr blobs) based module for x you can build seperatly to make things less annoying
  8. copy the resulting .so into xorgs plugin dir
IMbackK commented 3 years ago

pvr + pvr

  1. grab https://github.com/tmlind/linux/tree/droid4-pending-v5.13 and merge https://github.com/tmlind/linux_openpvrsgx/tree/droid4-pending-pvr-omapdrm-v5.13
  2. grab https://git.ti.com/cgit/graphics/omap5-sgx-ddk-um-linux/refs/heads branch ti-img-sgx/zeus/1.17.4948957
  3. run script below on some .so files in targetfs/ti443x/lib (sorry dont remeber which run objdump to figure it out)
  4. copy the targetfs to your device
  5. see if pvr works with kmscube
  6. grab and build https://github.com/freemangordon/pvr_egl_shim
  7. ldpreload the resulting so
  8. do the steps 5+ of the pvr+mesa path
#! /bin/sh

LIB=$1

VER_OFFSET=`readelf -V ${LIB} | grep \(.dynstr\) | cut -d' ' -f 6`
SYM_OFFSET=`readelf -V ${LIB} | grep 'Name: GLIBC_2.29' | cut -d':' -f 1`

OFFSET=$((${VER_OFFSET}+${SYM_OFFSET}+4))

printf '\002' | dd of=${LIB} bs=1 count=1 seek=${OFFSET} conv=notrunc
MerlijnWajer commented 2 years ago

Packaging wise, let's do the following in -experimental:

18:44 < freemangordon> I just pulled from tmlind's repo
18:44 < freemangordon> and it seems only :
18:44 < freemangordon> 3455ec8297f37bacf965e2c23cd33c0e45b92aae (HEAD ->
                       droid4-pending-pvr-omapdrm-v5.15) drm: pvrsgx: implement pvr_ioctl_unpriv
18:44 < freemangordon> f1e11e600e07c19174d5a8c02a008b75120e1aa9 drm: pvrsgx: dmabuf import - Do not
                       assume scatterlist memory is contiguous
18:44 < freemangordon> 6947433922ec6f81967e6215c7f84e5bc1aef86b drm: omapdrm: Export correct
                       scatterlist for TILER backed BOs
18:44 < freemangordon> are needed
18:44 < freemangordon> those I sent upstream
18:45 < freemangordon> Wizzup: but, I'll take care of that once we have the other things in place
18:49 < tmlind> how about i'll send it out tomorrow and then apply to droid4-pending-v5.15, also merge
                in v5.15?
MerlijnWajer commented 2 years ago

This is done :tada: