Attempting to create a X11 mali interface

Post Reply
crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Attempting to create a X11 mali interface

Unread post by crashoverride » Mon Apr 29, 2019 10:02 am

Proof-of-concept (POC) X11 GPU render
Image

I have been attempting to create a X11 Mali GPU driver interface. This presents several technical challenges. I finally have something to show for all the research and effort into this. The above image demonstrates the Mali fbdev driver rendering directly to a X11 window using the DRI2 protocol. This POC represents "half" of the required work: a DRI2 enabled X11 DDX. The other 'half' will be the future development of a EGL layer to interface Mali fbdev. I can not guarantee success of this project at this time. However, it looks promising now that I have a POC.

Source code is available but is of no use until the EGL layer is developed. It is provided solely for educational and discussion purposes:
https://github.com/OtherCrashOverride/jem
https://github.com/OtherCrashOverride/x ... fbturbo-n2
These users thanked the author crashoverride for the post:
meveric (Mon Apr 29, 2019 3:39 pm)

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Mon Apr 29, 2019 10:10 am

Very interesting (and useful) project!

BTW, does your "fbturbo" implementation use any 2D hardware(bitblit?) accelerator?

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Mon Apr 29, 2019 10:22 am

odroid wrote:
Mon Apr 29, 2019 10:10 am
does your "fbturbo" implementation use any 2D hardware(bitblit?) accelerator?
No, it does not.

X11 acceleration has its own set of technical challenges. However, the research into this project may be directly applicable to developing an accelerated X11 driver. While a 2D hardware accelerator is available (GE2D), past tests on C2 showed that Mali is much faster. Another major benefit of Mali is that it has a MMU. This allows graphic buffers and blits to use regular virtual memory instead of CMA. The goal would be to integrate Mali fbdev directly into the X11 DDX for 2D acceleration using the same dmabuf infrastructure developed in this project. Although, without a MMU on the display controller, true zero-copy will not be possible as it is on XU4.

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Mon Apr 29, 2019 10:43 am

I see. Thank you for the explanation.

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by mad_ady » Tue Apr 30, 2019 12:28 am

I was secretly hoping you'd be tinkering to produce something like this...
Kudos to you!

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Thu May 09, 2019 3:17 pm

The first hardware GLES2 on N2+X11 test using a custom EGL layer I created (libegl_jem.so):
Image

The program running is a Sega Genesis emulator. Other than disabling fullscreen and removing the use of /dev/dri/card0, its unmodified.
https://github.com/OtherCrashOverride/G ... shoverride

* Its currently very slow (40fps).
* Its upside-down.

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Thu May 09, 2019 8:46 pm

Unmodified glmark2-es2 from Ubuntu repo:
Image

Code: Select all

=======================================================
    glmark2 2014.03+git20150611.fa71af2d
=======================================================
    OpenGL Information
    GL_VENDOR:     ARM
    GL_RENDERER:   Mali-G52
    GL_VERSION:    OpenGL ES 3.2 git.c8adbf9.122c9daed32dbba4b3056f41a2f23c58
=======================================================
[build] use-vbo=false: FPS: 335 FrameTime: 2.985 ms
[build] use-vbo=true: FPS: 384 FrameTime: 2.604 ms
[texture] texture-filter=nearest: FPS: 375 FrameTime: 2.667 ms
[texture] texture-filter=linear: FPS: 375 FrameTime: 2.667 ms
[texture] texture-filter=mipmap: FPS: 379 FrameTime: 2.639 ms
[shading] shading=gouraud: FPS: 369 FrameTime: 2.710 ms
[shading] shading=blinn-phong-inf: FPS: 372 FrameTime: 2.688 ms
[shading] shading=phong: FPS: 360 FrameTime: 2.778 ms
[shading] shading=cel: FPS: 360 FrameTime: 2.778 ms
[bump] bump-render=high-poly: FPS: 290 FrameTime: 3.448 ms
[bump] bump-render=normals: FPS: 395 FrameTime: 2.532 ms
[bump] bump-render=height: FPS: 383 FrameTime: 2.611 ms
[effect2d] kernel=0,1,0;1,-4,1;0,1,0;: FPS: 371 FrameTime: 2.695 ms
[effect2d] kernel=1,1,1,1,1;1,1,1,1,1;1,1,1,1,1;: FPS: 441 FrameTime: 2.268 ms
[pulsar] light=false:quads=5:texture=false: FPS: 413 FrameTime: 2.421 ms
[desktop] blur-radius=5:effect=blur:passes=1:separable=true:windows=4: FPS: 224 FrameTime: 4.464 ms
[desktop] effect=shadow:windows=4: FPS: 217 FrameTime: 4.608 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 58 FrameTime: 17.241 ms
[buffer] columns=200:interleave=false:update-dispersion=0.9:update-fraction=0.5:update-method=subdata: FPS: 61 FrameTime: 16.393 ms
[buffer] columns=200:interleave=true:update-dispersion=0.9:update-fraction=0.5:update-method=map: FPS: 71 FrameTime: 14.085 ms
[ideas] speed=duration: FPS: 223 FrameTime: 4.484 ms
[jellyfish] <default>: FPS: 406 FrameTime: 2.463 ms
[terrain] <default>: FPS: 58 FrameTime: 17.241 ms
[shadow] <default>: FPS: 158 FrameTime: 6.329 ms
[refract] <default>: FPS: 76 FrameTime: 13.158 ms
[conditionals] fragment-steps=0:vertex-steps=0: FPS: 392 FrameTime: 2.551 ms
[conditionals] fragment-steps=5:vertex-steps=0: FPS: 395 FrameTime: 2.532 ms
[conditionals] fragment-steps=0:vertex-steps=5: FPS: 392 FrameTime: 2.551 ms
[function] fragment-complexity=low:fragment-steps=5: FPS: 393 FrameTime: 2.545 ms
[function] fragment-complexity=medium:fragment-steps=5: FPS: 395 FrameTime: 2.532 ms
[loop] fragment-loop=false:fragment-steps=5:vertex-steps=5: FPS: 394 FrameTime: 2.538 ms
[loop] fragment-steps=5:fragment-uniform=false:vertex-steps=5: FPS: 391 FrameTime: 2.558 ms
[loop] fragment-steps=5:fragment-uniform=true:vertex-steps=5: FPS: 393 FrameTime: 2.545 ms
=======================================================
                                  glmark2 Score: 312 
=======================================================
These users thanked the author crashoverride for the post (total 5):
mad_ady (Thu May 09, 2019 10:39 pm) • EarBiteR (Thu May 09, 2019 11:11 pm) • meveric (Fri May 10, 2019 1:53 am) • odroid (Fri May 10, 2019 9:36 am) • mxmilkb (Wed May 15, 2019 5:49 am)

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Fri May 10, 2019 9:36 am

Really impressive. :o

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by meveric » Fri May 10, 2019 4:51 pm

regarding the flipped picture:

@ptitSeb suggested to look at this code: https://github.com/ptitSeb/gl4es/blob/m ... lx.c#L2486
Maybe it can help fixing this.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Sat May 11, 2019 5:54 am

The ideal situation is to eliminate any memory copies. The technical issue preventing this is that I can not get eglCreatePixmapSurface to work (always returns EGL_BADMATCH).

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Mon May 20, 2019 4:04 pm

PPSSPP and glmark2-es:
Image

The above image shows two GLES2 programs operating at the same time (launched via SSH). Since X11 manages the windows proper (DRI2 without blit/overlay illusions), window overlap, dragging, and mouse clicks work correctly. An additional copy pass was added so the images are now displayed right side up. Not shown is that I also reworked the jem driver to hopefully eliminate kernel panics due to race conditions between the X11 server and client.
These users thanked the author crashoverride for the post (total 4):
meveric (Mon May 20, 2019 4:30 pm) • odroid (Mon May 20, 2019 4:33 pm) • BadPritt (Mon May 20, 2019 10:44 pm) • mad_ady (Mon May 20, 2019 11:33 pm)

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Mon May 20, 2019 4:12 pm

Wow~~ Glad to see non-flipped multiple GL renderings at the same time. :D
BTW, what is the exact meaning of jem? It must be a gem. ;)

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Mon May 20, 2019 4:41 pm

GEM is the Linux Graphics Execution Manager. Its described here:
https://www.kernel.org/doc/html/v4.10/g ... anager-gem

DRI2 is a X11 protocol for interfacing direct renderers such as GL/ES and VDPAU. DRI2 was designed to use GEM buffer handles.

Currently, the N2 does not have a KMS/DRM driver and therefore lacks GEM. Previously, ARM's libUMP was used to fill the role that GEM provides, but its also not available on N2. I initially attempted to port libUMP, but there are far too many 32bit hard coded casts that break on a 64bit system. This is the reason I developed JEM (sounds like GEM). When JEM is combined with ION, it fulfills the role that libUMP and GEM provide on other systems. Since ION is handling the buffer allocation and lifecycle, the JEM driver is relatively trivial. It is the "glue" between the X11 server and X11 clients:
https://github.com/OtherCrashOverride/jem
These users thanked the author crashoverride for the post:
xabolcs (Tue May 21, 2019 1:24 am)

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Mon May 20, 2019 5:35 pm

Thank you for the detail explanation.
I like the glue "JEM" indeed.
It is a brilliant idea to overcome the missing drivers/layers in the current software architecture.

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by mad_ady » Mon May 20, 2019 11:34 pm

Great work, as usual crash! Congrats!

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Tue May 21, 2019 2:58 pm

I could build the JEM driver and have jem.ko file now. :D

Code: Select all

git clone https://github.com/OtherCrashOverride/jem                                                          
cd jem/                                                                                                      
make 
I'm running Ubuntu 18.04 Mate image with Kernel 4.9.177.
Where should I copy the ko driver file to /lib/modules/4.9.177-28/kernel/drivers/ directory?

What is the next step?
Should I build your xf86-video-fbturbo-n2 driver and use the xorg.conf example to configure the N2 X11?
Anyway, I'm trying it even though I don't know what I'm doing.

Code: Select all

sudo apt install xutils-dev xorg-dev
git clone https://github.com/OtherCrashOverride/xf86-video-fbturbo-n2
cd xf86-video-fbturbo-n2/
./autogen.sh
./configure
make
Sorry for bothering you.
I am a very beginner as always. ;)
These users thanked the author odroid for the post:
mad_ady (Tue May 21, 2019 3:15 pm)

User avatar
mad_ady
Posts: 6365
Joined: Wed Jul 15, 2015 5:00 pm
languages_spoken: english
ODROIDs: XU4, C1+, C2, N1, H2, N2
Location: Bucharest, Romania
Has thanked: 145 times
Been thanked: 106 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by mad_ady » Tue May 21, 2019 3:16 pm

I expect a detailed (or not) magazine article from @crashoverride for this

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by meveric » Tue May 21, 2019 4:23 pm

I've created a DKMS package for jem and will attempt to make a package for fbturbo as well (although the later will probably only run for Debian Stretch).

But if you want you can try the DKMS package... I'd actually like to know if it works :)

I've uploaded it to: https://oph.mdrjr.net/meveric/other/N2/

I have to load jem module manually (/etc/modules) and get the /dev/jem device, fbturbo is loaded as well, but it doesn't seem to work for me.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Tue May 21, 2019 4:40 pm

odroid wrote:
Tue May 21, 2019 2:58 pm
Where should I copy the ko driver file to
I currently do not know the answer to that. I am still in testing and use 'sudo insmod jem.ko' to load it temporarily.
odroid wrote:
Tue May 21, 2019 2:58 pm
What is the next step?
I will attempt to document the requirements here, however, I was not ready for alpha/beta testing yet so there may be omissions and/or future edits to this info.

[IMPORTANT: The mali-fbdev, SDL2, and QT custom packages in the minimal image must be removed and replaced with official Ubuntu packages. This includes installing mesa-gles2 packages as a dependency. While mesa is not used, it is a dependency of most important packages.]

1) Compile and install the jem.ko driver.

2) Set correct permissions for /dev/jem and /dev/ion. They should both be in the 'video' group with +rw access. For testing, its easiest to set full access:

Code: Select all

sudo chmod a+rw /dev/jem
sudo chmod a+rw /dev/ion
3) Compile and install the xf86-video-fbturbo-n2 X11 driver:

Code: Select all

./autogen.sh
./configure --prefix=/usr
make
sudo make install
sudo cp xorg.conf /etc/X11/xorg.conf
4) Copy the libegl_jem.so file (not yet published!) as 'libEGL.so.1.0.0' and set up symlinks:

Code: Select all

lrwxrwxrwx 1 root root     15 Aug 15  2018 /usr/lib/aarch64-linux-gnu/libEGL.so -> libEGL.so.1.0.0
lrwxrwxrwx 1 root root     15 Aug 15  2018 /usr/lib/aarch64-linux-gnu/libEGL.so.1 -> libEGL.so.1.0.0
-rw-r--r-- 1 root root 315792 May 20 17:42 /usr/lib/aarch64-linux-gnu/libEGL.so.1.0.0

lrwxrwxrwx 1 root root 18 Aug 15  2018 /usr/lib/aarch64-linux-gnu/libGLESv2.so -> libGLESv2.so.2.0.0
lrwxrwxrwx 1 root root 18 Aug 15  2018 /usr/lib/aarch64-linux-gnu/libGLESv2.so.2 -> libGLESv2.so.2.0.0
lrwxrwxrwx 1 root root 37 May 10 04:27 /usr/lib/aarch64-linux-gnu/libGLESv2.so.2.0.0 -> /usr/lib/aarch64-linux-gnu/libmali.so
5) Restart X11. The /dev/jem device must be installed prior to starting X11.

Code: Select all

sudo service lightdm restart
6) If using a SSH session, set the DISPLAY environment variable.

Code: Select all

set DISPLAY=:0.0
7) Install glmark2-es2.

Code: Select all

sudo apt install glmark2-es2
If the installation fails, ensure that all custom package files (except kernel) are removed as initially noted.

8) Once glmark2-es has been confirmed to operate properly, other programs may be tested. During testing, I noticed some programs are not properly linked to libEGL.so and may require the use of LD_PRELOAD.

Code: Select all

LD_PRELOAD=libEGL.so programname

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Tue May 21, 2019 5:00 pm

For development, the following mali headers are used:
https://github.com/rockchip-linux/libma ... er/include

Known issues:
* Cache coherency issues may result in 'snow flakes' or jagged images.
* Fullscreen mode is not fully tested.
* Some programs run slow (governor). Using 'taskset' on the official Ubuntu minimal does not work (for unknown reasons). It is necessary to use 'taskset -p [mask] [pid]' to set the CPU affinity after a program is started.

Tested so far:
* Dolphin
- Does not work. It also does not work on N1 (RK3399) so its likely a code issue.

* PPSSPP
- Works
- May require LD_PRELOAD=libEGL.so
- Tested with following 'cmake/Toolchains/odroidn2.armv8.cmake' toolchain file:

Code: Select all

include_directories(SYSTEM
  /usr/include
  /usr/include/EGL
  /usr/include/GLES2
)

set(ARCH_FLAGS "-march=armv8-a+crc -mtune=cortex-a73 -funsafe-math-optimizations")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${ARCH_FLAGS}"  CACHE STRING "" FORCE)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${ARCH_FLAGS}" CACHE STRING "" FORCE)
set(CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} ${ARCH_FLAGS}" CACHE STRING "" FORCE)

# set(CMAKE_EXE_LINKER_FLAGS "-L/opt/vero3/lib" CACHE STRING "" FORCE)

set(OPENGL_LIBRARIES /usr/lib/aarch64-linux-gnu/libGLESv2.so)
set(EGL_LIBRARIES /usr/lib/aarch64-linux-gnu/libEGL.so)

set(USING_GLES2 ON)
set(USING_EGL ON)
# set(USING_FBDEV ON)
# set(ARMV7 ON)
# set(FORCED_CPU armv7)
set(USING_X11_VULKAN OFF CACHE BOOL "" FORCE)
* Mupen64Plus
- Works (both rice and glide64mk2)
- Required manually building glide64mk2 (for unknown reasons)

* Reicast
- Works
- Requires build fix

Code: Select all

diff --git a/shell/linux/Makefile b/shell/linux/Makefile
index 355903c0..228070dc 100644
--- a/shell/linux/Makefile
+++ b/shell/linux/Makefile
@@ -129,11 +129,12 @@ else ifneq (,$(findstring x64,$(platform)))
 # Generic 64 bit ARM (armv8) Linux
 else ifneq (,$(findstring arm64,$(platform)))
     NOT_ARM := 1
-    USE_X11 := 1
+    USE_SDL := 1
     ARM64_REC := 1
     ISARM64 := 1
     CFLAGS += -D TARGET_LINUX_ARMv8 -D TARGET_NO_AREC -fno-builtin-sqrtf
     CXXFLAGS += -fexceptions
+    USE_GLES := 1
 
 # Generic 32 bit ARMhf (a.k.a. ARMv7h)
 else ifneq (,$(findstring armv7h,$(platform)))

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Tue May 21, 2019 5:37 pm

Appreciate your efforts.
I can wait until you are ready for public testing.

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by meveric » Wed May 22, 2019 1:35 am

crashoverride wrote:
Tue May 21, 2019 5:00 pm
Tested so far:
* Dolphin
- Does not work. It also does not work on N1 (RK3399) so its likely a code issue.
Just to correct this, Dolphin works on the ODROID N1: viewtopic.php?p=217911#p217911
But it has some graphical issues which are related to the Mali GPU which is not very well supported in the Dolphin project.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Wed May 22, 2019 1:56 am

meveric wrote:
Wed May 22, 2019 1:35 am
Dolphin works on the ODROID N1
I compiled master from github yesterday. It runs but the screen is just a solid color. I know I have used it before on Firefly RK3399 (years ago?) so I think recent changes have caused it to stop working. Any tips for getting it running on N1 appreciated (last know working commit?). N1 is my reference for what is 'correct' operation to expect on N2.

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Wed May 22, 2019 2:02 am

I spent the day trying to implement GE2D blit hardware acceleration. Despite the effort, I was not able to get GE2D to correctly blit from an ION buffer. The 4.9.y-upstream kernel branch was also tested since it implements GE2D patches. This did not function correctly either. Due to this, I am dropping GE2D support as a planned feature. I will need to create some stand alone test programs to illustrate the issues with GE2D on N2 so hopefully Amlogic can fix it.

User avatar
meveric
Posts: 10389
Joined: Mon Feb 25, 2013 2:41 pm
languages_spoken: german, english
ODROIDs: X2, U2, U3, XU-Lite, XU3, XU3-Lite, C1, XU4, C2, C1+, XU4Q, HC1, N1, Go, H2 (N4100), N2
Has thanked: 15 times
Been thanked: 117 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by meveric » Wed May 22, 2019 2:14 am

crashoverride wrote:
Wed May 22, 2019 1:56 am
I compiled master from github yesterday. It runs but the screen is just a solid color. I know I have used it before on Firefly RK3399 (years ago?) so I think recent changes have caused it to stop working. Any tips for getting it running on N1 appreciated (last know working commit?). N1 is my reference for what is 'correct' operation to expect on N2.
Last one I tested was 5.0-7441 commit (99dff10d43) https://oph.mdrjr.net/meveric/other/N1/
I think you're correct that they changes something afterwards.. let me see if I can get the latest to work on N1.

Ah yes, one of the biggest changes was change to Qt 5.9 as a requirement, which I don't have for Debian Stretch. So I can only use a build that still supports Qt 5.7

Edit:
Just compiled: 74899e417bb0bce222a3c5cea995fd626bc61e18 5.0-8386
latest without Qt 5.9 worked fine as well on N1 uploaded it to the same folder.
Edit 2:
Qt 5.9 is exaggerated.
I've been building newer versions of dolphin and each one so far works fine with Qt 5.7 so they just put a requirement in there that is not required it seems, which is very annoying.
I'll keep trying to see how far I can get.
Donate to support my work on the ODROID GameStation Turbo Image for U2/U3 XU3/XU4 X2 X C1 as well as many other releases.
Check out the Games and Emulators section to find some of my work or check the files in my repository to find the software i build for ODROIDs.
If you want to add my repository to your image read my HOWTO integrate my repo into your image.

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Wed May 22, 2019 5:12 am

Dolphin on N2
Image

The issues affecting it are unique to N2:
1) It uses eglGetProcAddress to find core API entry points instead of using the linker. This caused it to use libmali.so instead of libegl_jem.so. I changed libegl_jem to detect this.
2) It blindly uses the first config that is returned. On bifrost, this is a R10, G10, B10, A2 (10bit color) surface that can not be used with external buffers. This currently requires a patch to Dolphin. I will attempt to compensate for it libegl_jem.

Thanks to @meveric for assistance.

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Wed May 22, 2019 9:17 am

You made it again :o

crashoverride
Posts: 4491
Joined: Tue Dec 30, 2014 8:42 pm
languages_spoken: english
ODROIDs: C1
Has thanked: 0
Been thanked: 62 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by crashoverride » Thu May 23, 2019 5:54 am

I managed to implemented cache coherency. This resolves the 'snow flake' issue (not visible in screen shots). I also implemented eglSwapInterval for VSYNC. However, as noted in another thread, the timing is "whacky". This brings the project to the point where its time to resolve external issues since I am now creating workarounds for the workarounds. ;)

What needs fixing outside:
1) eglCreatePixmapSurface - This function currently does not work. It has the single largest impact on performance and design of the software.
2) GE2D - Blitting from ION buffers currently does not work properly. This impacts performance as the CPU is now (slowly) copying surfaces.
3) VSYNC - This function appears to have unstable timing. This makes presenting 'tare free' unpredictable.

User avatar
odroid
Site Admin
Posts: 31765
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 84 times
Been thanked: 241 times
Contact:

Re: Attempting to create a X11 mali interface

Unread post by odroid » Thu May 23, 2019 8:40 am

I love the term workarounds for the workarounds.
Seems to be very close to start a beta test event :twisted:

How about assigning the xorg stuff to the big-cores to improve the timing issue?
viewtopic.php?f=177&t=34963

Kernel
Posts: 20
Joined: Sun May 05, 2019 2:23 am
languages_spoken: english
ODROIDs: C1, C2, N2
Has thanked: 9 times
Been thanked: 1 time

Re: Attempting to create a X11 mali interface

Unread post by Kernel » Wed May 29, 2019 5:47 am

:shock: Very impressive work! :)

Post Reply

Return to “Projects”

Who is online

Users browsing this forum: No registered users and 0 guests