Overriding Mesa driver

429 views
Skip to first unread message

haziqsem...@gmail.com

unread,
Apr 24, 2022, 8:59:44 PM4/24/22
to Android-x86
On regular Linux, I can set MESA_LOADER_DRIVER_OVERRIDE followed by target program but is that possible under Android, as in this env var followed by `am start`? I've looked into replacing libEGL.so and friends as temporary measure but Mesa has its own selector that handles the replacement of driver. Setting ro.hardware.egl is no go either as it points to mesa again (or I can actually override this way)?

Would be beneficial to swap to lavapipe/zink for testing purposes, but ideally if it can be exposed to graphic driver preference...

İlhan Atahan

unread,
Apr 26, 2022, 1:37:05 AM4/26/22
to Android-x86
Yes, here is how, you basically need to export this on early-init stage of boot progress.

25 Nisan 2022 Pazartesi tarihinde saat 03:59:44 UTC+3 itibarıyla haziqsem...@gmail.com şunları yazdı:

Mauro Rossi

unread,
Apr 28, 2022, 2:13:29 PM4/28/22
to Android-x86


On Monday, April 25, 2022 at 2:59:44 AM UTC+2 haziqsem...@gmail.com wrote:
... Setting ro.hardware.egl is no go either as it points to mesa again (or I can actually override this way)?

Would be beneficial to swap to lavapipe/zink for testing purposes, but ideally if it can be exposed to graphic driver preference...

in device/generic/common/init.sh it is possible to modify init_hal_gralloc() to set property  ro.hardware.egl whatever 
in order to instruct surfaceflinger to use libEGL_whatever, libGLESv1_whatever, libGLESv2_whatever
but then you have the constraint that you need to have all of three shared library modules {libEGL,libGLESv1,libGLESv2}_whatever

crw

unread,
Apr 30, 2022, 6:36:54 AM4/30/22
to Android-x86
Android x86 doesnt seem to have zink or lavapipe, so that wont work, check BOARD_GPU_DRIVERS here https://osdn.net/projects/android-x86/scm/git/device-generic-common/blobs/pie-x86/BoardConfig.mk

Huy Minh Bùi

unread,
Apr 30, 2022, 1:19:37 PM4/30/22
to Android-x86
lavapipe and zink are Vulkan drivers, so looking at BOARD_GPU_DRIVERS is no use
Vào lúc 17:36:54 UTC+7 ngày Thứ Bảy, 30 tháng 4, 2022, crw đã viết:

crw

unread,
May 1, 2022, 9:18:10 AM5/1/22
to Android-x86
zink is not a Vulkan driver , it translates open GL to Vulkan, a gallium driver in lib64/dri, 
For example here gallium drivers and Vulkan drivers can be observed separately https://github.com/archlinux/svntogit-packages/blob/packages/mesa/trunk/PKGBUILD#L48
Reply all
Reply to author
Forward
0 new messages