Skip to content

Commit 014874d

Browse files
committed
Removing the egl-generic rendering platform from the supported list if
another platform is available
1 parent 4c131c1 commit 014874d

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

src/server/graphics/default_configuration.cpp

+23
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,29 @@ auto mir::DefaultServerConfiguration::the_rendering_platforms() ->
316316
else
317317
{
318318
platform_modules = mir::graphics::rendering_modules_for_device(platforms, display_targets, dynamic_cast<mir::options::ProgramOption&>(*the_options()), the_console_services());
319+
320+
// In the case that we have more than one platform, we try and remove mir:egl-generic,
321+
// since it is problematic. See https://github.com/MirServer/mir/issues/3112
322+
// TODO: Remove me once a multi-rendering-platform paradigm is fully supported, and we
323+
// don't just select the first (or last?) platform and use that everywhere.
324+
if (platform_modules.size() > 1)
325+
{
326+
auto it = platform_modules.begin();
327+
while (it != platform_modules.end())
328+
{
329+
auto describe_module = it->second->load_function<mg::DescribeModule>(
330+
"describe_graphics_module",
331+
MIR_SERVER_GRAPHICS_PLATFORM_VERSION);
332+
333+
auto description = describe_module();
334+
if (strcmp(description->name, "mir:egl-generic") == 0)
335+
{
336+
platform_modules.erase(it);
337+
break;
338+
}
339+
it++;
340+
}
341+
}
319342
}
320343

321344
for (auto const& [device, platform]: platform_modules)

0 commit comments

Comments
 (0)