Miouyouyou / RockMyy

Build scripts and patches used to cross-compile 5.6-rcX kernels for RK3288 boards
MIT License
32 stars 8 forks source link

Can we use Chromebit userspace drivers? #11

Closed kingio closed 4 years ago

kingio commented 5 years ago

I noticed that my Chromebit has libmali.so -> 1.4 Midgard-"r22p0-01rel0". Since it has RK3288, the same as Asus TinkerBoard. Could i reuse it's libs to get hardware acceleration working on the tinkerboard?

(i've tried Armbian images, TinkerOS v2.0.7-8 and i never get chrome with video hardware acc working).

My attempt was:

  1. Copy libmali.so from Chromebit and place it to /home/linaro/mali_test in TinkerBoard
  2. Run LD_LIBRARY_PATH=/home/linaro/mali_test /etc/chrome

Output: file /dev/mali0 is not of a compatible version (user 11.4, kernel 10.6)

What else should i grab to make it work? Or can i bypass that compatibility check to see if it works anyway?

I could share the libs if they fit for your project too. I've also seen that they have rk3288_vpu module rather than rockchip_vpu.

kingio commented 5 years ago

Yep, the one from debian (i just made apt install blabla..). After compiling:

On tty:

king@tinkerboard:~$ glmark2-es2-drm
Error: Failed to find a suitable DRM device
Error: main: Could not initialize canvas
Segmentation fault

On desktop:

tinkerboard:/home/king/glmark2# glmark2-es2-drm
Segmentation fault

Compilation said install /usr/local/bin/glmark2-es2-drm so i also tried running directly that path, but i ge tthe same output.

Miouyouyou commented 5 years ago

On TTY, try running it with --debug just to be sure. Also, before hand, do : chmod 0666 /dev/mali0 Just to be sure.

On the worst case, uninstall the r0p0 driver and try with the r1p0

kingio commented 5 years ago

OK, first i've done the chmod and then the --debug:

# /usr/local/bin/glmark2-es2-drm --debug
Debug: Failed to open DRM module 'i915'
Debug: Failed to open DRM module 'nouveau'
Debug: Failed to open DRM module 'radeon'
Debug: Failed to open DRM module 'vmgfx'
Debug: Failed to open DRM module 'omapdrm'
Debug: Failed to open DRM module 'exynos'
Error: Failed to find a suitable DRM device
Error: main: Could not initialize canvas
Segmentation fault
Miouyouyou commented 5 years ago

Sounds like the old one... In the directory where you compiled glmark-es2-drm, there should be a "build" directory with a glmark-es2-drm binary. Look for this one and execute it from there, like this ./glmark-es2-drm

kingio commented 5 years ago

I don't think it is: Jan 28 13:01 /usr/local/bin/glmark2-es2-drmI checked the build dir, there are multiple forlders and a config log file, but no glmark2-es2-drm looks like it got moved automatically after build

Miouyouyou commented 5 years ago

Relaunch the compilation with ./waf then but don't install it.

kingio commented 5 years ago

Yep! it works! 60FPS stable on each test

Miouyouyou commented 5 years ago

Nice ! So, the only remaining part is testing the VPU through a version of MPP which understands the vpu_service.

Tonymac32 commented 5 years ago

Mpp builds easily on the Tinker itself, I'm not able to do more party due to not knowing where to link everything for testing and being at day job (lunch break). The last release is 14 months old, 200+ commits since then.

Miouyouyou commented 5 years ago

Yeah, but then you need MPV with RKMPP. And MPV wants the latest version of FFMPEG. So I'm compiling and... we'll see...

Miouyouyou commented 4 years ago

VPU is now mainlined... But the V4L2 request API is still a mess to deal with. That said, it's now more an user-space issue than a driver issue.