-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Linux DRM - Fix issues with current implementation #3513
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Not sure about
|
While I agree that it is a "workaround", it's more needed than with other backends. Let me give you the real world example which makes it needed as compared to the cases in which you have a window manager. I agree it is a "workaround" in the sense that I'd like to make it so this stuff is selectable by an end user with an SFML API interface (like I'd like it to be on other backends/systems). But until then, this is the only way. With all of this said, DRM already uses a certain set of environment variables for determining display stuff on initialization.
Bonus fun fact: if you have displays connected to different graphics cards, you will be able to select between them by using SFML_DRM_DEVICE. You just won't be able to if they share the graphics card (like in the example above). Now, to be clear: I think these environment variables should be better documented. They're very important, and I've seen no notice of them anywhere in documentation. I may be wrong about that, but that is what I saw. |
Description
This PR fixes three issues I noticed while testing the DRM setup by myself:
The first two points are fixed thanks to the new function inside DRMContext.cpp: getEglLoaded(), which returns whether Egl was dynamically loaded correctly.
The last point is solved by adding the SFML_DRM_CONNECTOR_ID environment variable, which SFML checks at runtime. If this variable is set, it will specify the ID for the connector (and the screen that is plugged into said connector).
Tasks
How to test this PR?
To test this, a Linux environment without a Desktop active is required.
This can be achieved by using certain combinations on some devices, like CTRL + Alt + F3.
For point 1, to test this, simply set SFML_DRM_DEVICE to a bad file value (anything will work). It shouldn't crash inside DRMContext.
For point 2, launch a program in an environment without libegl1. I used a Raspberry Pi loaded with the Raspbian OS Lite image, with libgm1 and libgl1 installed, but without libegl1 installed. Again, the result is that it shouldn't crash inside DRMContext.
A helpful error message should also get printed.
For point 3, it requires a second monitor. Check the ID of the connector via the drm_info command, and then the user should be able to change the screen on which the application is displayed on.