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

GLES drivers and DRM issues with Linux 4.17-rc5 #6

Closed Miouyouyou closed 6 years ago

Miouyouyou commented 6 years ago

It seems that the Mali driver is now unable to work correctly.

glmark-es2-drm throws 0x3001 errors (Not initialized)

Querying the basic GPU capabilities with vulkan work with the fbdev driver, but the GLES calls still fail with this one. Stracing the calls to the Mali kernel driver, when trying to run glmark-es2-drm shows that the user-space driver try to mmap2 using a ridiculous offset 0x102020000 which will never work.

Now, I have no real dmesg errors that pertain to this issue, so I have no idea if that's a real kernel issue or just user-space borking issue.

Miouyouyou commented 6 years ago

... Maybe it's that patch ? https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/mm/mmap.c?id=be83bbf806822b1b89e0a0f23cd87cddc409e429

At the moment, the only thing I'm sure is that the problem is happening in the Mali driver kbase_gpu_mmap function, after calling kbase_add_va_region . Now, the driver does a lot of >> PAGE_SHIFT << PAGE_SHIFT dances, which is what Linus Torvalds mmap patch is deprecating.

I still have to test it though and... I still have no idea how I'll be able to fix this...

Miouyouyou commented 6 years ago

Fixed ! It was indeed that patch. However, the DRM guys had the same issue and provided a simple patch which I mimicked on the Midgard drivers.

https://github.com/Miouyouyou/RockMyy/blob/master/patches/Midgard/r19p0-01rel0/0009-GPU-ARM-Midgard-Adapt-to-the-new-mmap-call-checks.patch