maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   Open source 3d-graphics for N900 (Work in progress) (https://talk.maemo.org/showthread.php?t=82455)

AapoRantalainen 2012-02-20 09:01

Open source 3d-graphics for N900 (Work in progress)
 
I made version-0001 for open source 3d-graphics driver for N900. This is actually just template using Vincent software rasterizer, but at least there are now something. I have idea that next step is to start using hardware one function at a time, but I'm really in dead end and don't know how to do that.

Is reverse engineering needed in next step? How to start that? (Latest reverse engineered GPU took 4 months: https://gitorious.org/lima )
Is there any use of (GPL) kernel modules for omaplfb and pvrsrvkm (drivers/gpu/pvr)?


------------
Code:

git clone https://git.gitorious.org/vincent-n900/vincent-n900.git
cd vincent-n900/
./autogen.sh
./configure
make
rcp -r  .libs/*so* user@n900:vin

(Works with sb1 and sb2 (with gcc-4.2 and gcc-4.6)).

Roadmap/Checklist:
*Open source. OK
*Compilable. OK
*Produces libGLES_CM.so. OK
*Produces libEGL.so. OK
#Drop-in replacement for libraries on device (binaries using stock version, doesn't need recompilation). OK
*On real device can run NeheGles examples. OK
#...correctly. FAIL, minor glitches
#...fast. FAIL, damn slow
(it draws upside-down, but this is not critical on this moment)

*Replacement for libGLESv2.so. MISSING
---
Testing on device:
Code:

sudo apt-get install nehegles
cd /opt/nehegles
LD_LIBRARY_PATH=~/vin ./lesson02

Results with Nehe:
lesson-number (description) | fps with stock hardware driver : fps with Vincent (other issues)
02 (static image) | 91 : 29
03 (static image) | 91 : 31
04 (rotating shapes) | 91 : 42
05 (rotating objects) | 80 : 13 (cube flickers)
06 (rotating cube with texture) | 63 : 5
07 (cube with texture, rotated with arrows) | 72 : 11
08 (cube with texture, rotated with arrows) | 79 : 11
09 (flare-glare) | 30 : 2
10 (corridor walking) | 46 : 3 (glitches on roof)
11 (textured flag) | 45 : 3
12 (static multiple boxes) | 71 : 4
16 (fog, cube with texture, rotated with arrows) | 67 : 8 (minor glitches)
18 (drawing) | 74 : 13
19 (fireworks) | 26 : 2
20 (two moving layers, first one transparency) 20 : 0.6 (badly broken, first layer is small and second big)

GrimyHR 2012-02-20 09:06

Re: Open source 3d-graphics for N900 (Work in progress)
 
Quote:

Originally Posted by AapoRantalainen (Post 1167236)
I made version-0001 for open source 3d-graphics driver for N900. This is actually just template using Vincent software rasterizer, but at least there are now something. I have idea that next step is to start using hardware one function at a time, but I'm really in dead end and don't know how to do that.

Is reverse engineering needed in next step? How to start that? (Latest reverse engineered GPU took 4 months: https://gitorious.org/lima )
Is there any use of (GPL) kernel modules for omaplfb and pvrsrvkm (drivers/gpu/pvr)?

omg, if you actually manage to do this i will love you till i die(infact i might die as soon as you do it as ill probably get a heart attack or a stroke from overwhelming emotions) :p

ivgalvez 2012-02-20 10:19

Re: Open source 3d-graphics for N900 (Work in progress)
 
I think this could be a very big task and too difficult to achieve. It would be better to have a newer 3.x kernel with up to date binary drivers for GPU and DSP (with support for Vsync!) and for that task, there is also a lot of work to do.

AapoRantalainen 2012-02-20 11:05

Re: Open source 3d-graphics for N900 (Work in progress)
 
Quote:

Originally Posted by ivgalvez (Post 1167256)
It would be better to have a newer 3.x kernel with up to date binary drivers for GPU and DSP (with support for Vsync!)

GPU on N900 is PowerVR SGX530.
Is there binary drivers for 3.x kernel?

Seems to me that kernel-power team is separating huge Nokia kernel-patches and when they are ready, these patches can be applied to the kernel 3.x. (So 3.x kernel on N900 'is coming', but not related to this thread).
---
I just found that Writing open source drivers for PowerVR is a project on the FSF's high priority list.
http://libreplanet.org/wiki/Group:PowerVR_drivers

It is not providing anything to download, but there are links to read more information about whole topic.

ivgalvez 2012-02-20 11:12

Re: Open source 3d-graphics for N900 (Work in progress)
 
Good luck if you are really planning to jump into this. To me it seems like a very long time effort.

AapoRantalainen 2012-03-29 17:59

Re: Open source 3d-graphics for N900 (Work in progress)
 
Some points I have learned:
*Software rasterizer was not first step (It can't be used as starting point)
*gles1 is not (system) critical part, it is not even installed on stock device

--
I think this is the data flow
Code:

application (e.g. HelloWorld)
      |
library (libgles2-sgx-img)
      |
kernel modules (omaplfb.ko and pvrsrvkm.ko)
      |
Hardware

I got kernel modules compiled with additional (debug) messages, so next step could be print everything what is passed through modules (there will be much of cryptic data).

-------
I checked what (stock) packages we will miss if libgles2-sgx-img is dropped (as I think debian is runned on N900):

Code:

xserver-xomap
hildon-desktop (because libclutter-0.8-0)
(libqt4-gui and much of other qt4-packages)

So with patched hildon-desktop and xserver-xomap it would be possible to run Maemo5 on N900 without closed source graphics driver. (Strictly speaking this is offtopic)

AapoRantalainen 2012-04-04 09:18

Re: Open source 3d-graphics for N900 (Work in progress)
 
Quote:

So with patched hildon-desktop and xserver-xomap it would be possible to run Maemo5 on N900 without closed source graphics driver. (Strictly speaking this is offtopic)
I realised that 'debugging' graphics driver will be much easier if there are only one application currently using gles, so I got gles2 entirely disabled. Hildon-desktop is then run on software-GL.

Read more on here: http://talk.maemo.org/showthread.php?p=1187842


All times are GMT. The time now is 16:03.

vBulletin® Version 3.8.8