diff options
author | Jonas Ã…dahl <jadahl@gmail.com> | 2021-04-14 09:03:12 +0200 |
---|---|---|
committer | Marge Bot <marge-bot@gnome.org> | 2021-04-14 15:15:52 +0000 |
commit | 4c7a846dc89098149cab0da6c1ac7573eb8e465c (patch) | |
tree | ff77aeccc62f63251ec2a25b49eef69224e38d8d | |
parent | 1f3c5bd3166370a031f0b0703a75a560a1dec3d8 (diff) | |
download | mutter-4c7a846dc89098149cab0da6c1ac7573eb8e465c.tar.gz |
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>
-rw-r--r-- | src/backends/native/meta-output-kms.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/backends/native/meta-output-kms.c b/src/backends/native/meta-output-kms.c index 024344a3c..fa265bcad 100644 --- a/src/backends/native/meta-output-kms.c +++ b/src/backends/native/meta-output-kms.c @@ -245,11 +245,14 @@ init_output_modes (MetaOutputInfo *output_info, output_info->preferred_mode = output_info->modes[i]; } - /* Presume that if the output supports scaling, then we have - * a panel fitter capable of adjusting any mode to suit. - */ - if (connector_state->has_scaling) - add_common_modes (output_info, gpu_kms); + if (connector_state->has_scaling && + g_list_length (connector_state->modes) == 1) + { + meta_topic (META_DEBUG_KMS, "Adding common modes to connector %u on %s", + 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) { |