diff --git a/libweston/backend-drm/drm.c b/libweston/backend-drm/drm.c index 46b809be..b55696c9 100644 --- a/libweston/backend-drm/drm.c +++ b/libweston/backend-drm/drm.c @@ -1416,10 +1416,10 @@ drm_output_set_gbm_format(struct weston_output *base, const char *gbm_format) { struct drm_output *output = to_drm_output(base); - struct drm_backend *b = to_drm_backend(base->compositor); - if (parse_gbm_format(gbm_format, b->gbm_format, &output->gbm_format) == -1) - output->gbm_format = b->gbm_format; + if (parse_gbm_format(gbm_format, + DRM_FORMAT_INVALID, &output->gbm_format) == -1) + output->gbm_format = DRM_FORMAT_INVALID; } static void @@ -1855,6 +1855,13 @@ drm_output_enable(struct weston_output *base) assert(!output->virtual); + if (output->gbm_format == DRM_FORMAT_INVALID) { + if (output->base.eotf_mode != WESTON_EOTF_MODE_SDR) + output->gbm_format = DRM_FORMAT_XRGB2101010; + else + output->gbm_format = b->gbm_format; + } + ret = drm_output_attach_crtc(output); if (ret < 0) return -1; @@ -2301,6 +2308,7 @@ drm_output_create(struct weston_compositor *compositor, const char *name) output->backend = b; output->crtc = NULL; + output->gbm_format = DRM_FORMAT_INVALID; #ifdef BUILD_DRM_GBM output->gbm_bo_flags = GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING; #endif diff --git a/man/weston-drm.man b/man/weston-drm.man index 5947714c..48fd0c8e 100644 --- a/man/weston-drm.man +++ b/man/weston-drm.man @@ -57,7 +57,8 @@ The actually supported pixel formats depend on the DRM driver and hardware, and the renderer used. Using Pixman-renderer, DRM-backend supports only .BR xrgb8888 " and " rgb565 . The formats supported with GL-renderer depend on the EGL and OpenGL ES 2 or 3 -implementations. The names are case-insensitive. +implementations. The names are case-insensitive. This setting applies only to +.RB "outputs in SDR mode, see " eotf-mode " in " weston.ini (5). .RB "If not specified, " xrgb8888 " is used. See also " gbm-format " in" .BR output " section." @@ -134,9 +135,11 @@ and possibly flipped. Possible values are .TP \fBgbm-format\fR=\fIformat\fR Set the DRM KMS framebuffer format for this specific output. If not set, -.RB "the value from " gbm-format " option in " core " section is used." +.RB "the value from " gbm-format " option in " core " section is used" +.RB "for SDR mode outputs and " xrgb2101010 " for other modes." .RI "For the possible values for " format " see " .BR gbm-format " option in " core " section." +.RB "For SDR mode, see " eotf-mode " in " weston.ini (7). .TP \fBpixman-shadow\fR=\fIboolean\fR If using the Pixman-renderer, use shadow framebuffers. Defaults to