mripard / sunxi-mali

GNU General Public License v2.0
100 stars 54 forks source link

Build failure with Linux 5.9/5.10 #88

Closed giuliobenetti closed 3 years ago

giuliobenetti commented 3 years ago

sunxi-mali fails to build with Linux 5.9 and 5.10 Currently working on it in my Repo, here is temp version for r6p2: https://github.com/giuliobenetti/sunxi-mali/tree/dev/fix-5.10 here I'm working for all versions: https://github.com/giuliobenetti/sunxi-mali/tree/dev/fix-5.10-all-versions

giuliobenetti commented 3 years ago

@avafinger buildroot actually failed. I've done a mistake, so now I can reproduce it and fix it.

giuliobenetti commented 3 years ago

one thing to fix is to change every occurence of:

include <asm/uaccess.h>

with:

include <linux/uaccess.h>

Then I'm fixing .ioctl difference. Then I'm going to create patches and submit. @avafinger @kjngineering

kjngineering commented 3 years ago

Sounds good - I can test build as soon as there is a branch I can drop into the buildroot package config.

avafinger commented 3 years ago

@giuliobenetti Right, Please note that A64 seems to need some additional work, but I can test both arch, no problem.

giuliobenetti commented 3 years ago

@avafinger yes .ioctl file_operations error

giuliobenetti commented 3 years ago

@avafinger @kjngineering

r6p2 is fixed with temporary patches on this branch: https://github.com/giuliobenetti/sunxi-mali/tree/dev/fix-5.10

Going to fix other versions too. Unfortunately patches for r6p2 don't fit for r6p0, rp81, rp90.

kjngineering commented 3 years ago

@giuliobenetti

I was successfully able to build the r6p2 driver under 5.10 for an arm H3 platform using your repository. I cannot test functionality however as there is some issue at boot time preventing me from getting to console. I suspect this may be unrelated - it appears to be something to do with the mmc driver.

avafinger commented 3 years ago

@giuliobenetti Tested your patch on NanoPi A64 with r6p2 gbm blobs (had this Image ready) and kernel 5.10 and it is working fine. the fbdev will take some time for me to test but I assume mali is working as it should. Thank you for your work. I will not test this in 5.9, already moved all my stuff to 5.10.

giuliobenetti commented 3 years ago

@avafinger thanks a lot for testing. Now let’s wait to be merged so I can update buildroot package too.

giuliobenetti commented 3 years ago

@kjngineering can you please test my patches on Linux 5.10 and fbdev?

kjngineering commented 3 years ago

@kjngineering can you please test my patches on Linux 5.10 and fbdev?

I was able to build (above) -- but had some other unrelated issues that prevented me from testing the driver.

I'm going to have another go - is there a particular branch/commit you would like me to build against? https://github.com/giuliobenetti/sunxi-mali/tree/dev/fix-5.10-all-versions?

giuliobenetti commented 3 years ago

@kjngineering yes that branch is correct, it's the one i've used to open PR #89 Thank you

kjngineering commented 3 years ago

@giuliobenetti

I had to switch to Buildroot 2020.11 to fix my aforementioned issue, but: I was able to build the r6p2 that branch against 5.10 on a Allwinner H3 Platform (OrangePi Zero H3 Plus2) without issue.

[    0.000000] Booting Linux on physical CPU 0x0
[    0.000000] Linux version 5.10.0 (kirby@ubuntu) (arm-buildroot-linux-gnueabihf-gcc.br_real (Buildroot 2020.11) 9.3.0, GNU ld (GNU Binutils) 2.34) #1 SMP Thu Dec 17 17:56:31 PST 2020
[    0.000000] CPU: ARMv7 Processor [410fc075] revision 5 (ARMv7), cr=10c5387d
....
[   14.224574] mali: loading out-of-tree module taints kernel.
[   14.249801] Allwinner sunXi mali glue initialized
[   14.257111] Mali:
[   14.257123] Found Mali GPU Mali-400 MP r1p1
[   14.264189] Mali:
[   14.264200] 2+0 PP cores initialized
[   14.270662] Mali:
[   14.270672] Mali device driver loaded

it passes the glmark2-es2-fbdev.

let me know when the r8p0 patchset is ok and I will test this too on the same hardware.

giuliobenetti commented 3 years ago

@kjngineering great. r8p1 is already there in PR #89. That fixes for every version.