Skip to content

Commit

Permalink
Removing the egl-generic rendering platform from the supported list if
Browse files Browse the repository at this point in the history
another platform is available
  • Loading branch information
mattkae committed Nov 10, 2023
1 parent 4c131c1 commit 014874d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/server/graphics/default_configuration.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,29 @@ auto mir::DefaultServerConfiguration::the_rendering_platforms() ->
else
{
platform_modules = mir::graphics::rendering_modules_for_device(platforms, display_targets, dynamic_cast<mir::options::ProgramOption&>(*the_options()), the_console_services());

// In the case that we have more than one platform, we try and remove mir:egl-generic,
// since it is problematic. See https://github.com/MirServer/mir/issues/3112
// TODO: Remove me once a multi-rendering-platform paradigm is fully supported, and we
// don't just select the first (or last?) platform and use that everywhere.
if (platform_modules.size() > 1)
{
auto it = platform_modules.begin();
while (it != platform_modules.end())
{
auto describe_module = it->second->load_function<mg::DescribeModule>(
"describe_graphics_module",
MIR_SERVER_GRAPHICS_PLATFORM_VERSION);

auto description = describe_module();
if (strcmp(description->name, "mir:egl-generic") == 0)
{
platform_modules.erase(it);
break;
}
it++;
}
}
}

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

0 comments on commit 014874d

Please sign in to comment.