joyrider3774
Posts: 35
Joined: Sun Mar 13, 2016 12:21 pm

Is it possible to detect if we run X11 legacy or opengl / kms driver ?

Sun Feb 09, 2020 7:03 pm

Is it possible to detect if we run X11 legacy or opengl / kms driver ? does a value get written somewhere or should i scan /boot/config.txt ? or is there some other way ?

ejolson
Posts: 4247
Joined: Tue Mar 18, 2014 11:47 am

Re: Is it possible to detect if we run X11 legacy or opengl / kms driver ?

Sun Feb 09, 2020 7:55 pm

joyrider3774 wrote:
Sun Feb 09, 2020 7:03 pm
Is it possible to detect if we run X11 legacy or opengl / kms driver ? does a value get written somewhere or should i scan /boot/config.txt ? or is there some other way ?
Does a difference show up with lsmod?

trejan
Posts: 1112
Joined: Tue Jul 02, 2019 2:28 pm

Re: Is it possible to detect if we run X11 legacy or opengl / kms driver ?

Sun Feb 09, 2020 8:49 pm

The Minecraft Pi startup script does this:

Code: Select all

if grep -q okay /proc/device-tree/soc/v3d@7ec00000/status \
        /proc/device-tree/soc/firmwarekms@7e600000/status 2> /dev/null; then
        export LD_PRELOAD=libbcm_host.so.1.0
        export LD_LIBRARY_PATH=lib/mesa
else
        export LD_LIBRARY_PATH=lib/brcm
fi

Return to “General programming discussion”