We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 3938

Summary: [PATCH] RPI vendor & mesa driver coexistence fixes
Product: SDL Reporter: Conn O'Griofa <connogriofa>
Component: videoAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.7   
Hardware: ARM   
OS: Linux   
Attachments: [PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver
[PATCH] SDL_video: try to bootstrap KMSDRM before RPI video driver
[PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver
[PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver
[PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver

Description Conn O'Griofa 2017-11-02 23:02:12 UTC
Created attachment 3057 [details]
[PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver

For your consideration, the following patches enhance support for Raspberry Pi's vendor *and* experimental VC4 driver:

* Fix ES1/PVR applications when using the latest Raspberry Pi firmware; the renamed libbrcmGLESv2 is supposed to provide support for 2/1/PVR in one library. This will fix ES1/PVR applications.
* Add simple detection of the VC4 mesa driver; if "/sys/module/vc4/" is present, use the standard Mesa library names instead of the Broadcom versions.
* Bootstrap the KMSDRM driver before RPI to prevent an issue with the Mesa VC4 driver failing to initialize.

The sum effect of these two patches is that ES1/PVR applications are fixed on the vendor library, and it's now possible to compile a build with "--enable-video-rpi --enable-video-kmsdrm" together. The same SDL2 build will work with the vendor libraries and Mesa VC4 graphics stack (via KMSDRM).
Comment 1 Conn O'Griofa 2017-11-02 23:02:48 UTC
Created attachment 3058 [details]
[PATCH] SDL_video: try to bootstrap KMSDRM before RPI video driver
Comment 2 Conn O'Griofa 2017-11-02 23:05:06 UTC
Created attachment 3059 [details]
[PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver
Comment 3 Conn O'Griofa 2017-11-03 00:25:21 UTC
Created attachment 3060 [details]
[PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver
Comment 4 Conn O'Griofa 2017-11-03 00:50:17 UTC
Created attachment 3061 [details]
[PATCH] Raspberry Pi: fix ES 1/PVR support & autodetect Mesa driver

Apologies for the spam. I needed to update the patch to ensure that the legacy library names (/opt/vc/lib/libEGL.so and /opt/vc/lib/libGLESv2.so) still work for ES1/PVR.

Both libbrcmGLESv2.so (new name) and libGLESv2.so (old) support all profiles; /opt/vc/lib/libGLES_CM.so & /opt/vc/lib/libGLESv1_CM.so were always symlinks to /opt/vc/lib/libGLESv2.so.
Comment 5 Sam Lantinga 2017-11-04 16:05:03 UTC
Your patches are in, thanks!
https://hg.libsdl.org/SDL/rev/18e285e9e1be
https://hg.libsdl.org/SDL/rev/591e138c5a04