linux_openpvrsgx icon indicating copy to clipboard operation
linux_openpvrsgx copied to clipboard

Atom/GMA3600-SGX545 questions

Open fl82 opened this issue 3 years ago • 14 comments

Hello,

I have a mini-itx board with the Atom SoC (x64/SSSE3) with the GMA3600/SGX545@400Mhz iGPU that usually works in modern linux with the gma500_gfx module but while it works there was of course no 3D/video acceleration beside the sofware rendering. I was reading about this project and some discussions of someone trying installing it on a similar SoC found on netbooks and I'd like to install it if it might work.

I'm not expert into kernel compilation so I'd just like to install asking some basic questions to understand how to possibly configure it and the steps. The hope would simply have a functional lxde or lxqt ubuntu o.s. (from 18.04.x to the latest 22.04) just like the original old cedarview drivers worked on Ubuntu 12.04, not usable anymore cause too much old. How would I need to configure the compilation for a x64 or x86 kernel? And do I specifically need a x86 32bit kernel compilation cause I remember every o.s. supporting this GPU only worked into 32bit o.s. is this the same situation? And what about Xorg, Mesa, video component, do I need some specific version? I don't really well understand the steps but I always hoped to see the linux o.s. possibly supporting this gpu one day but after so much time I suppose it might be late considering how many old gpu are discontinued.

Bye

fl82 avatar Apr 23 '22 11:04 fl82

Hi. nice to hear about your GMA3600 board. They seem to be quite rare now... And AFAIK nobody has managed to get something to work besides OMAP processors and to some extent on JZ4780. So it will need some persistence and experimentation. About the status, you can compile the Letux kernel (e.g. letux-5.15.y) in x86 (32 bit kernel) mode by using the arch/x86/config/letux_defconfig. I am not 100% sure if the correct SGX configs are set there. I have this running (without 3D) on an ACEPC T11 with Atom Z8350 by booting from an external USB drive. So if you can replace the kernel with a LetuxOS kernel (and kernel modules) and boot your Ubuntu system, the first milestone is reached. The next one will be to find out how to make the SGX driver being loaded. On most SoC this is done through the device tree files but on x86 we might need to tweak the code or the way the driver is built. If the driver is being loaded successfully you would see a /proc/pvr directory. Now comes the most challenging part: find original user-space drivers that match the setup incl. the version of the kernel driver. Unfortunately these are always binary only, i.e. no chance to build to match. But if you find something it should include some pvrsrvctl command which downloads the firmware. If Xorg, mesa etc. work depends on how the user-space binaries were compiled. I hope this explains a little that we have a challenging task ahead and it would therefore be nice if you could invest a little time to give it a try and report results. Especially as you have hardware. BR and thanks!

goldelico avatar Apr 25 '22 16:04 goldelico

I've managed to get it running on Samsung S5PV210 (using the OMAP 4's SGX 540-120 blobs and hex-editing so it finds the correct DRM device). Not that this helps with x86 at all... I rather lucked out that OMAP4 has the same revision as S5PV210.

xc-racer99 avatar Apr 25 '22 18:04 xc-racer99

Thanks for the explanation as said I'm not a linux expert but I am still using this SoC in a modern linux o.s. but the gma500 doesn't seem to use much of the gpu (beside at least it works) and ironically these boards went for the only old PCI external bus instead of the native PCIex one so the alternative options always have been limited. :)

fl82 avatar Apr 27 '22 11:04 fl82

Seems to me the same situation of #5 https://github.com/arvl130/kiss32-cdv-repo also has a not-so-old enough situation that you could use as a starting point.

mirh avatar Apr 06 '24 15:04 mirh

I would like to build this kernel for my intel atom Z2580 SoC with pvr sgx544MP2 gpu. But an error says that it lacks Makefile in "driver/gpu/drm/pvrsgx/1.7.862890/pvr". Anyone can help?

SteveBetter avatar Apr 10 '24 07:04 SteveBetter

Hi,

Am 10.04.2024 um 09:15 schrieb SteveBetter @.***>:

I would like to build this kernel for my intel atom Z2580 SoC with pvr sgx544MP2 gpu. But an error says that it lacks Makefile in "driver/gpu/drm/pvrsgx/1.7.862890/pvr". Anyone can help?

There seems to be an (also note the suffix "s" of "drivers"):

drivers/gpu/drm/pvrsgx/1.7.862890/pvr/INSTALL

It says that cd eurasiacon/build/linux/platform/kbuild should be done and them "make all".

Our generic Make file doesn't support it yet but with your help we might be able wrap this so that a CONFIG/make on top kernel top level works.

BR, Nikolaus

goldelico avatar Apr 10 '24 18:04 goldelico

@goldelico I browsed that sub directory. There seems to be header files. Perhaps there is something wrong with this part of "drivers/gpu/drm/pvrsgx/1.7.862890". Impossible to compile it.

SteveBetter avatar Apr 11 '24 03:04 SteveBetter

Am 11.04.2024 um 05:32 schrieb SteveBetter @.***>:

@ I browsed that sub directory. There seems to be header files. Perhaps there is something wrong with this part of "drivers/gpu/drm/pvrsgx/1.7.862890". Impossible to compile it.

It also looks as if drivers/gpu/drm/pvrsgx/1.7.862890/pvr/eurasiacon/is empty... So maybe we do not have complete code :(

It appears as if it came from: https://github.com/thomas001/cedarview-drm/tree/master/staging/cdv/pvr where the eurasiacon subdirectory is also empty.

goldelico avatar Apr 11 '24 06:04 goldelico

@goldelico I found that not only 1.7.862890 can't be compiled. Other sub directories have the same problem too. So, what should we do to drive this GPU?

SteveBetter avatar Apr 11 '24 10:04 SteveBetter

Am 11.04.2024 um 12:18 schrieb SteveBetter @.***>:

@goldelico I found that not only 1.7.862890 can't be compiled. Other sub directories have the same problem too.

I found a Makefile in many of them, e.g.:

drivers/gpu/drm/pvrsgx/1.9.2188537/eurasia_km/Makefile

But that doesn't help :(

The problem is that these DDK versions are closely tied to specific processors and user-space code. So they can neither be directly mixed between architectures nor different versions.

So, what should we do to drive this GPU?

Well, I just have some very generic ideas: a) try to locate the missing files somewhere (on some Linux system that did have vendor support) b) try to (back)port the missing files from a later DDK c) knocking on Imagination's doors and begging for the entire pvrsgx code to be made open source...

goldelico avatar Apr 11 '24 19:04 goldelico

I'm also looking around what's available for the PowerVR devices with regards to driver binaries to see if GMA3600 netbooks could be supported. The binaries from the vendor seem to have the following attributes:

  • They contain numbers libraries, notably there is always a library like libpvr2d.so.1.7.862890. The version suffix relates to the DDK version and is the same for all included binaries.
  • There are a bunch of libpvrPVR2D_*WSEGL.so.1.7.862890 libraries. Those provide support for different window systems.
  • Configuration is done through powervr.ini which is typically in /etc/. It is possible to specify the WindowSystem there and supposedly EGL would use another windowing system.
  • Filenames of the included files generally contain PVR2D somewhere in the name.

For x86 there are only a few sets of binaries available.

The main ones are from the Cedarview driver releases from Intel. Those are based on DDK version 1.7.862890 and provide X.org support. (Hacking X.org itself a bit allows me to run with slightly higher versions without running into a crash immediately.) These are meant for PowerVR SGX545 as common on netbooks and mainboards.

Older binaries seem to be provided in an EMGD package. These seem to be for SGX535 devices, but I also see references to SGX545. These seem to be based on DDK 1.5.15.3226. The file names contain EMGD instead of PVR2D. There are also window system binaries for Wayland in addition to X.org.

Other x86 binaries are provided for Android tablets based on PowerVR SGX544 and PowerVR series 6 chips. Notably Asus Zenphone 5. These are based on DDK 1.12.2701748 and only have a binary for the Android window system. The EGL libraries in a subdirectory explicitly have POWERVR-SGX544 in their filename. Maybe they are somehow tied to that model. There are also binaries for the ASUS MeMO Pad 7. These are based on DDK 1.12.3197934 and are otherwise similar. There is also a Dell Venue 8 tablet. The binaries on it do not have a DDK version suffix and the EGL libraries have POWERVR_ROGUE in their name.

There seems to be an Android DDK for the SGX540/544 available here: https://github.com/shaqfu786/GFX_Linux_DDK

jschwartzenberg avatar May 11 '24 09:05 jschwartzenberg

Hi Julius, great stuff you have found!

Am 11.05.2024 um 11:12 schrieb Julius Schwartzenberg @.***>:

I'm also looking around what's available for the PowerVR devices with regards to driver binaries to see if GMA3600 netbooks could be supported. The binaries from the vendor seem to have the following attributes: • They contain numbers libraries, notably there is always a library like libpvr2d.so.1.7.862890. The version suffix relates to the DDK version and is the same for all included binaries.

This version seems to match the kernel driver tree we have.

• There are a bunch of libpvrPVR2D_*WSEGL.so.1.7.862890 libraries. Those provide support for different window systems.
• Configuration is done through powervr.ini which is typically in /etc/. It is possible to specify the WindowSystem there and supposedly EGL would use another windowing system.

Yes, this seems to be sort of a standard...

• Filenames of the included files generally contain PVR2D somewhere in the name.

For x86 there are only a few sets of binaries available. The main ones are from the Cedarview driver releases from Intel. Those are based on DDK version 1.7.862890 and provide X.org support. (Hacking X.org itself a bit allows me to run with slightly higher versions without running into a crash immediately.) These are meant for PowerVR SGX545 as common on netbooks and mainboards. Older binaries seem to be provided in an EMGD package. These seem to be for SGX535 devices, but I also see references to SGX545. These seem to be based on DDK 1.5.15.3226. The file names contain EMGD instead of PVR2D. There are also window system binaries for Wayland in addition to X.org. For this DDK we also have some driver code. Other x86 binaries are provided for Android tablets based on PowerVR SGX544 and PowerVR series 6 chips. Notably Asus Zenphone 5. These are based on DDK 1.12.2701748 and only have a binary for the Android window system. The EGL libraries in a subdirectory explicitly have POWERVR-SGX544 in their filename. Maybe they are somehow tied to that model. There are also binaries for the ASUS MeMO Pad 7. These are based on DDK 1.12.3197934 and are otherwise similar. There is also a Dell Venue 8 tablet. The binaries on it do not have a DDK version suffix and the EGL libraries have POWERVR_ROGUE in their name. Rougue is not PVR SGX (PVR 5) but PVR 6. Their seems to be an Android DDK for the SGX540/544 available here: https://github.com/shaqfu786/GFX_Linux_DDK

This seems to be a DDK 1.8.869593 compatible driver: https://github.com/shaqfu786/GFX_Linux_DDK/blob/master/eurasia_km/include4/pvrversion.h#L39C38-L39C44 which we do not yet have in our collection: https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/branches/all?query=letux%2Fpvrsrvkm

I plan to add this for a future release.

BR and thanks, Nikolaus

PS: maybe you can subscribe to https://lists.goldelico.com/mailman/listinfo.cgi/openpvrsgx-devgroup which is a mailing list with different audience.

goldelico avatar May 13 '24 06:05 goldelico

This seems to be a DDK 1.8.869593 compatible driver: https://github.com/shaqfu786/GFX_Linux_DDK/blob/master/eurasia_km/include4/pvrversion.h#L39C38-L39C44 which we do not yet have in our collection: https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/branches/all?query=letux%2Fpvrsrvkm

I plan to add this for a future release.

Ah interesting to see you have support for various versions. Does this also include the code required to bridge the PVR parts to the Cedarview/GMA500 part? When using the source from Intel, it is necessary to enable Intel Cedarview in the kernel's menuconfig (and disable the GMA500 driver). After that all PowerVR stuff gets loaded and also /proc/pvr is available. I think this is the code that's here: https://github.com/thomas001/cedarview-drm/tree/master/staging/cdv/drv And triggered by this configuration option: https://github.com/thomas001/cedarview-drm/blob/master/staging/cdv/Kconfig

Would it be possible to introduce this in your tree(s)? I could test this. It seems the GMA500 driver and Intel's sources are related in some ways. It might also be possible to compare the two and see how Intel's variant hooks into the PVR parts.

PS: maybe you can subscribe to

https://lists.goldelico.com/mailman/listinfo.cgi/openpvrsgx-devgroup which is a mailing list with different audience.

Thanks, I tried to sign up, but did not receive a confirmation just yet. Maybe somebody needs to approve?

Message ID: <openpvrsgx-devgroup/linux_openpvrsgx/issues/8/2106735763@ github.com>

jschwartzenberg avatar May 14 '24 18:05 jschwartzenberg

Hi Julius,

Am 14.05.2024 um 20:12 schrieb Julius Schwartzenberg @.***>:

This seems to be a DDK 1.8.869593 compatible driver: https://github.com/shaqfu786/GFX_Linux_DDK/blob/master/eurasia_km/include4/pvrversion.h#L39C38-L39C44 which we do not yet have in our collection: https://github.com/openpvrsgx-devgroup/linux_openpvrsgx/branches/all?query=letux%2Fpvrsrvkm

I plan to add this for a future release.

Well, I have checked again and it turns out to be a copy of the leaked full DDK. There are a lot of files included with a confidentiality note... I was astonished that this leaked code is still around after 10 years which may mean that they are not really interested in keeping it secred. And it is DDK 1.8 while the latest one I am aware of is DDK 1.17. So there is a lot of development and improvement since back then.

Now, I am unsure if I should really integrate it... Or take only parts with a clear GPL from eurasia_km?

Ah interesting to see you have support for various versions.

Yes. We have collected all kernel driver variants we could find so far into a single tree and different CONFIG optioons allow to chose the right one. Some processors (mainly OMAP3 and siblings) are supported by two or 3 different variants.

Does this also include the code required to bridge the PVR parts to the Cedarview/GMA500 part?

Well, each variant usually contains code in the eurasia_km directory which ties the DDK to some specific hardware. In most cases this is only for OMAP. There is one case where it also supports the MIPS jz4780. But we have no MIPS compatible user space to make any use for it.

For the x86 drivers I am not sure. I have no compatible hardware soI myself didn't try more than some compile tests (which usually fail). So I don't know what works and what is missing.

When using the source from Intel, it is necessary to enable Intel Cedarview in the kernel's menuconfig (and disable the GMA500 driver). After that all PowerVR stuff gets loaded and also /proc/pvr is available.

Ok, this is already great!

I think this is the code that's here: https://github.com/thomas001/cedarview-drm/tree/master/staging/cdv/drv And triggered by this configuration option: https://github.com/thomas001/cedarview-drm/blob/master/staging/cdv/Kconfig

Would it be possible to introduce this in your tree(s)?

Basically it should be possible. We just have to create a new letux/pvrsrvkm-$DDK_RELEASE branch based on linus/master, move the files to drivers/gpu/drm/pvrsgc/$DDK_RELEASE, add proper modifications to drivers/gpu/drm/pvrsgc/{Kconfig,Makefile} and start debugging...

What likely has happened is that header files have moved or APIs changed. Then there are usually examples from other DDK versions how to fix. And, the build process may hang because of dependencies or even missing files.

I could test this. It seems the GMA500 driver and Intel's sources are related in some ways. It might also be possible to compare the two and see how Intel's variant hooks into the PVR parts.

Basically the architecture is that Imagnination did publish a DDK package in C that is agnostic to the processor the SGX is integrated in. This is the above mentioned leaked code.

The SoC vendor who has licensed the SGX module then added some code to wrap it and integrate into the OS. On kernel level and on user-space library level.

This has also been done by Microsoft for Windows or Apple for macOS. And in some cases for Linux/Android. Therefore there are many drivers around for different architectures and OS - and none is compatible to the other... And sometimes the Linux kernel driver is published but not always.

PS: maybe you can subscribe to https://lists.goldelico.com/mailman/listinfo.cgi/openpvrsgx-devgroup which is a mailing list with different audience.

Thanks, I tried to sign up, but did not receive a confirmation just yet. Maybe somebody needs to approve?

Have done recently.

Best regards, Nikolaus

jschwartzenberg avatar May 17 '24 14:05 jschwartzenberg