From 8de94ec9c99557b5a0d99fa8c8eb358948cf855c Mon Sep 17 00:00:00 2001 From: Pekka Paalanen Date: Tue, 7 Jun 2022 15:02:55 +0300 Subject: [PATCH] compositor: add weston.ini option max-bpc For working around hardware limitations as explained in the man page. Now added for completeness' sake without knowing if anyone will ever need this. Signed-off-by: Pekka Paalanen --- compositor/main.c | 4 ++++ man/weston-drm.man | 9 +++++++++ 2 files changed, 13 insertions(+) diff --git a/compositor/main.c b/compositor/main.c index cbbcee1f..044c9df7 100644 --- a/compositor/main.c +++ b/compositor/main.c @@ -2000,6 +2000,7 @@ drm_backend_output_configure(struct weston_output *output, enum weston_drm_backend_output_mode mode = WESTON_DRM_BACKEND_OUTPUT_PREFERRED; uint32_t transform = WL_OUTPUT_TRANSFORM_NORMAL; + uint32_t max_bpc; char *s; char *modeline = NULL; char *gbm_format = NULL; @@ -2011,6 +2012,9 @@ drm_backend_output_configure(struct weston_output *output, return -1; } + weston_config_section_get_uint(section, "max-bpc", &max_bpc, 16); + api->set_max_bpc(output, max_bpc); + weston_config_section_get_string(section, "mode", &s, "preferred"); if (strcmp(s, "off") == 0) { diff --git a/man/weston-drm.man b/man/weston-drm.man index 48fd0c8e..eaaf311c 100644 --- a/man/weston-drm.man +++ b/man/weston-drm.man @@ -164,6 +164,15 @@ Defaults to false. Note that When a connector is disconnected, there is no EDID information to provide a list of video modes. Therefore a forced output should also have a detailed mode line specified. +.TP +\fBmax-bpc\fR=\fIN\fR +.RB "Set \(dq" "max bpc" "\(dq KMS property to value" +.IR N , +silenty clamped to the hardware driver supported range. This artificially +limits the driver chosen link bits-per-channel which may be useful for working +around sink hardware (e.g. monitor) limitations. The default is 16 which is +practically unlimited. If you need to work around hardware issues, try a lower +value like 8. .SS Section remote-output .TP