Skip to content

backends/native: Count MetaRenderDeviceEglStream instances externally

count_mode_setting_devices was incorrect in both name and in function. What it was actually doing was counting GPUs that had been registered with the backend so far (during the init_gpus loop). What it was intended to do was to count the number of MetaRenderDeviceEglStream instances, which is the thing we're limited to only one of. So count_mode_setting_devices would return zero whenever the first GPU initialized happened to be a MetaRenderDeviceEglStream, which would in turn prevent MetaRenderDeviceEglStream from successfully initializing. Seems it only ever worked in the case of a hybrid system where the first GPU initialized was GBM-based.

Now we count MetaRenderDeviceEglStream instances (zero or one) externally. This allows initialization to succeed when it happens to be the first (or only) GPU. And so MUTTER_DEBUG_FORCE_EGL_STREAM=1 now works.

Fixes: #2925 (closed)

Edited by Daniel van Vugt

Merge request reports