openpvrsgx-devgroup / linux_openpvrsgx

This project is about shaping existing GPL Linux kernel drivers for the PVR/SGX5 architecture so that they can become accepted into drivers/gpu/drm. It is NOT about reverse engineering or user-space components (firmware and libs), just the kernel device drivers. There is also be some glue code for the processor of the SoC (OMAP, Sunxi, jz4780).
Other
45 stars 21 forks source link

The driver crashes when used #3

Closed MightyM17 closed 3 years ago

MightyM17 commented 3 years ago

So i tried running this with postmarketOS (which is alpine linux) and it has its own mesa-pvr-dri-classic and sgx-ddk-um aports, with that i got the following error

[   44.188201] pvrsrvkm 56000000.gpu: Enabling quirks 00000001
[   44.247711] [drm] Initialized pvr 1.17.4948957 20110701 for 56000000.gpu on minor 1
[   55.064819] PVR_K: UM DDK-(4948957) and KM DDK-(4948957) match. [ OK ]
[   56.093444] PVR_K:(Error): PollForValueKM: Timeout. Expected 0x1 but found 0x0 (mask 0x1).
[   56.095733] PVR_K:(Error): SGXInitialise: Wait for uKernel initialisation failed
[   56.096282] PVR_K: SGX debug (SGX_DDK sgxddk 1.17@4948957)
[   56.096679] PVR_K:  Host Ctl flags= 00000004
[   56.097015] PVR_K: SGX Host control:
[   56.097290] PVR_K:   (HC-0) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.097747] PVR_K:   (HC-10) 0x00000000 0x00000014 0x00030D40 0x00000003
[   56.098205] PVR_K:   (HC-20) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.098632] PVR_K:   (HC-30) 0x00000000 0xF166D140 0x00000000 0x00000000
[   56.099060] PVR_K:   (HC-40) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.109802] PVR_K: SGX TA/3D control:
[   56.110321] PVR_K:   (T3C-0) 0x0F003000 0x0F003120 0x0F002000 0x00000000
[   56.110931] PVR_K:   (T3C-10) 0x00000000 0x00000002 0x00000000 0x00000000
[   56.111541] PVR_K:   (T3C-20) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.112121] PVR_K:   (T3C-30) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.112792] PVR_K:   (T3C-40) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.113464] PVR_K:   (T3C-50) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.114105] PVR_K:   (T3C-60) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.114746] PVR_K:   (T3C-70) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.115234] PVR_K:   (T3C-80) 0x00000000 0x00000000 0x0F000000 0xBFAF8000
[   56.115692] PVR_K:   (T3C-90) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.116516] PVR_K:   (T3C-A0) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.117156] PVR_K:   (T3C-B0) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.117797] PVR_K:   (T3C-C0) 0x00000000 0x00000000 0x00000000 0x0F004000
[   56.118438] PVR_K:   (T3C-D0) 0x0F00A420 0x0F00B000 0x00000000 0x00000000
[   56.118896] PVR_K:   (T3C-E0) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.119323] PVR_K:   (T3C-F0) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.120117] PVR_K:   (T3C-100) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.123046] PVR_K:   (T3C-110) 0x00000000 0x00000000 0x00000000 0x00000000
[   56.127868] PVR_K: SGX Kernel CCB WO:0x0 RO:0x0
[   56.131988] PVR_K: Active syncs
[   56.134918] PVR_K:(Error): SGXPostPowerState: SGXInitialise failed
[   56.137542] PVR_K:(Error): PVRSRVSetDevicePowerStateKM : Transition to 0 FAILED 0x18
[   56.140441] PVR_K:(Error): SGXScheduleCCBCommandKM failed to power up device - ui32CallerID:-1 eError:24
[   56.143157] PVR_K:(Error): SGXGetMiscInfoUkernel: SGXScheduleCCBCommandKM failed.
[   56.159606] PVR_K: (FAIL) SGXInit: Unable to validate hardware core revision
[   56.162506] PVR_K:(Error): PVRSRVFinaliseSystem: Failed PVRSRVDevInitCompatCheck call (device index: 0)
[   56.166564] PVR_K:(Error): BridgedDispatchKM: Initialisation failed.  Driver unusable.

The driver fails somewhere :(

Here is the first error PVR_DPF((PVR_DBG_ERROR,"PollForValueKM: Timeout. Expected 0x%x but found 0x%x (mask 0x%x).", ui32Value, ui32ActualValue, ui32Mask)); (https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/blob/letux-pvrsrvkm-5.12-rc1/drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/srvkm/common/pvrsrv.c#L1073) well it seems pui32LinMemAddr is wrong and causes this error.

Cannot find any way to fix this and thus cant get 3D acceleration :( My GPU is SGX540 (OMAP4430)

xc-racer99 commented 3 years ago

Hi there,

I'm the one that contributed the pmOS aports. This, however, is an issue with the kernel driver. You need to add -DPVR_LINUX_MEM_AREA_USE_VMAP to the Makefile of the module. Not sure why, but this is what has had to be done for a number of kernel versions now, I forget which version it started being needed in.

Note that I only tested the pmOS aports on s5pv210, but they should work for other SGX540 devices.

MightyM17 commented 3 years ago

Hello xc-racer thanks for the reply :D, will try the solution and tell the result! Thanks a lot for your work on powervr <3

Edit : It works!! Do i need to create a PR, or are you people gonna add the patch?

xc-racer99 commented 3 years ago

Edit : It works!! Do i need to create a PR, or are you people gonna add the patch?

It should be in the repos already, it was @tmlind that figured this out IIRC. Might have been missed on a specific branch/revision.

goldelico commented 3 years ago

Am 24.03.2021 um 06:10 schrieb xc-racer99 @.***>:

Edit : It works!! Do i need to create a PR, or are you people gonna add the patch?

It should be in the repos already, it was @tmlind https://github.com/tmlind that figured this out IIRC. Might have been missed on a specific branch/revision.

If you can tell me which patch should be applied to which branch on

https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/branches

I can check and add.

BR, Nikolaus