openpvrsgx-devgroup / linux_openpvrsgx

This is about shaping existing GPL Linux kernel drivers for the PVR/SGX5 architecture so that they can become accepted into drivers/staging. It is NOT about reverse engineering or user-space components (firmware and libraries). Just the device driver. There may also be some glue code here for interfacing to the processor of the SoC (OMAP, Sunxi, Poulsbo, Cedarview, jz4780).
Other
42 stars 19 forks source link

Build fails with CONFIG_SGX_DEBUG #2

Open MightyM17 opened 3 years ago

MightyM17 commented 3 years ago

When trying to build the kernel with SGX_DEBUG=y there will be an error which prevents the kernel to be built successfully

  CC [M]  drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysconfig.o
  CC [M]  drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o
../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c: In function 'ReleaseGPTimer':
../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:539:50: error: 'SYS_SPECIFIC_DATA' {aka 'struct _SYS_SPECIFIC_DATA_TAG_'} has no member named 'sTimerRegPhysBase'
  539 |  pui32TimerDisable = OSMapPhysToLin(psSysSpecData->sTimerRegPhysBase,
      |                                                  ^~
make[6]: *** [../scripts/Makefile.build:271: drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o] Error 1
goldelico commented 3 years ago

Thanks for the report. I'll try to reproduce as soon as I find time.

Am 19.03.2021 um 16:43 schrieb Mighty @.***>:

When trying to build the kernel with SGX_DEBUG=y there will be an error which prevents the kernel to be built successfully

CC [M] drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysconfig.o CC [M] drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o ../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c: In function 'ReleaseGPTimer': ../drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:539:50: error: 'SYS_SPECIFIC_DATA' {aka 'struct _SYS_SPECIFIC_DATATAG'} has no member named 'sTimerRegPhysBase' 539 | pui32TimerDisable = OSMapPhysToLin(psSysSpecData->sTimerRegPhysBase, | ^~ make[6]: *** [../scripts/Makefile.build:271: drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o] Error 1 — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHOUPPN4PXBARKQENU4PKLTENWKFANCNFSM4ZPBB54Q.

MightyM17 commented 3 years ago

Any updates?

goldelico commented 3 years ago

Am 27.03.2021 um 15:47 schrieb Mighty @.***>:

Any updates?

No solution. I can repeat some error but it bails out earlier (likely a compiler warning level difference):

CC [M] drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.o - due to target missing drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c: In function 'ReleaseGPTimer': drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:352:3: error: implicit declaration of function 'omap_dm_timer_stop' [-Werror=implicit-function-declaration] (void) omap_dm_timer_stop(psSysSpecData->psGPTimer); ^ drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:354:3: error: implicit declaration of function 'omap_dm_timer_disable' [-Werror=implicit-function-declaration] omap_dm_timer_disable(psSysSpecData->psGPTimer); ^ drivers/gpu/drm/pvrsgx/1.17.4948957/eurasia_km/services4/system/omap/sysutils_linux.c:356:3: error: implicit declaration of function 'omap_dm_timer_free' [-Werror=implicit-function-declaration] omap_dm_timer_free(psSysSpecData->psGPTimer); ^ cc1: some warnings being treated as errors

Recipie: checkout letux-5.12-rc4 change letux_defconfig to CONFIG_SGX_DEBUG=y make letux_lpae_defconfig

What I found about these functions omap_dm_timer_stop() etc. is that they were public until v4.16 (arch/arm/plat-omap/include/plat/dmtimer.h). Then they became static in v4.17 and are available only through omap_dm_timer_ops function pointers. Registration was to be done through omap_dm_timer_request_specific() which is deprecated and also static since timers are now to be requested through omap_dm_timer_request_by_cap().

The first idea would be fixing sysutils_linux.c, but we have to do it for all older DDK releases the same way. omap_dm_timer_stop() is used from DDK 1.9 up to DDK 1.17.

So we may have to mimick this old API in pvr-drv.c to wrap the approach of modern kernels.

Unfortunately there is no common header file included by all DDK versions.

Or simply keep CONFIG_SGX_DEBUG disabled...

BR, Nikolaus

MightyM17 commented 3 years ago

Thanks for the detailed message :D Yes that is exactly the error I was facing, well it seems like a huge task to fix it again, is it better just remove it from the kconfig?

goldelico commented 3 years ago

Am 28.03.2021 um 05:48 schrieb Mighty @.***>:

Thanks for the detailed message :D Yes that is exactly the error I was facing, well it seems like a huge task to fix it again, is it better just remove it from the kconfig?

Well, a compile fix is not difficult. Making it work is. Especially since we do not really understand what the code is intended to be doing.

Attached is a patch (which should be adapted to the other DDK versions as well). Please give it a try.

BR, Nikolaus

MightyM17 commented 3 years ago

Sure thing will give it a try! Also I cannot find any patches is it in the commits?

goldelico commented 3 years ago

Am 28.03.2021 um 13:54 schrieb Mighty @.***>:

Sure thing will give it a try! Also I cannot find any patches is it in the commits?

No, it is attached to the mail I sent to the list.

MightyM17 commented 3 years ago

Oh alrighty my apologies, I still cannot find it

goldelico commented 3 years ago

Am 28.03.2021 um 15:06 schrieb Mighty @.***>:

Oh alrighty my apologies

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

Ah, I get the issue.

You are sending from github, not the official mailing list. This is not connected to the mailing list even if it looks as if it were... Github is trying to do something good but isn't really because they split the community into two separate mail systems and pretend to be the official project mailing list.

The patch is attached again here.

You may find it also under https://lists.goldelico.com/pipermail/openpvrsgx-devgroup/2021-March/thread.html in some minutes.

BR, Nikolaus

MightyM17 commented 3 years ago

Sorry for the inconvenience :( I even checked my emails but this is because of github and mailing lost as you said Thanks for the patch will try it as soon as possible

MightyM17 commented 3 years ago

Patch did not work for me still same error, anyways SGX_DEBUG shouldnt be too much of an important thing.

goldelico commented 3 years ago

Am 30.03.2021 um 08:15 schrieb Mighty @.***>:

Patch did not work for me still same error

I see - it was not exactly the same. So it may be a second issue. I'll take a look later.