diff options
author | Marius Vlad <marius.vlad@collabora.com> | 2024-12-09 19:43:46 +0200 |
---|---|---|
committer | Marius Vlad <marius.vlad@collabora.com> | 2024-12-09 20:01:34 +0200 |
commit | 0824eb521f8e26e4c0f143ec7850d45c4b2f675b (patch) | |
tree | b62cfb490278d27352701a66a57316f33ff65d82 | |
parent | 71da04c74d967de1ba42d124829d2ec936857a7a (diff) |
We seem to have missed adding the ability to specify a modeline. This is
similar to native DRM outputs, specifying mode=widthXheight would give
us the output modeline resolution.
Bug-AGL: SPEC-5235
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: I455cfec7b4f937aa8b5d038b4df599aa1dff5d3f
-rw-r--r-- | src/compositor.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/compositor.c b/src/compositor.c index 00cf8d5..36a12d4 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -1395,8 +1395,11 @@ pipewire_backend_config_init(struct weston_pipewire_backend_config *config) static int pipewire_backend_output_configure(struct weston_output *output) { - int width = 640; - int height = 480; + int default_width = 640; + int default_height = 480; + int width = 0; + int height = 0; + char *mode; struct ivi_compositor *ivi = to_ivi_compositor(output->compositor); struct ivi_output_config *parsed_options = ivi->parsed_options; @@ -1417,8 +1420,13 @@ pipewire_backend_output_configure(struct weston_output *output) section = weston_config_get_section(ivi->config, "output", "name", output->name); - weston_config_section_get_int(section, "width", &width, width); - weston_config_section_get_int(section, "height", &height, height); + weston_config_section_get_string(section, "mode", &mode, NULL); + if (!mode || sscanf(mode, "%dx%d", &width, &height) != 2) { + weston_log("Invalid mode for output %s. Using defaults.\n", + output->name); + width = default_width; + height = default_height; + } if (parsed_options->width) width = parsed_options->width; |