output/kms: Only add common modes for single mode connectors

If there was only a single mode, add the common modes to provide options
to select other resolutions than the built in default. This avoids
issues where the connector listed multiple supported modes, but where
the common modes added would exceed the possible bandwidth. We could
probably make an attempt to filter out more modes from the common mode
list to avoid these issues, but it's likely that the driver already
lists suitable modes, meaning there is no point in adding the common
modes.

The common modes were initially added[0] to add modes to connectors with
a single bundled mode, so we shouldn't regress the original bug fix.

[0] https://bugzilla.gnome.org/show_bug.cgi?id=744544

Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1232
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1824>
This commit is contained in:
Jonas Ådahl 2021-04-14 09:03:12 +02:00 committed by Marge Bot
parent 1f3c5bd316
commit 4c7a846dc8

View File

@ -245,11 +245,14 @@ init_output_modes (MetaOutputInfo *output_info,
output_info->preferred_mode = output_info->modes[i]; output_info->preferred_mode = output_info->modes[i];
} }
/* Presume that if the output supports scaling, then we have if (connector_state->has_scaling &&
* a panel fitter capable of adjusting any mode to suit. g_list_length (connector_state->modes) == 1)
*/ {
if (connector_state->has_scaling) meta_topic (META_DEBUG_KMS, "Adding common modes to connector %u on %s",
add_common_modes (output_info, gpu_kms); meta_kms_connector_get_id (kms_connector),
meta_gpu_kms_get_file_path (gpu_kms));
add_common_modes (output_info, gpu_kms);
}
if (!output_info->modes) if (!output_info->modes)
{ {