wsi/display: Initially set default HDR metadata from EDID for HDR modes
For a selected non-default imageColorSpace during swapchain creation,
make sure that proper HDR setup also works even if a client app does not
explicitly call vkSetHdrMetadataEXT() in time.
Assign the EDID provided metadata here, so the 1st atomic commit will
set Colorspace and HDR metadata properties on the connector, to make sure
HDR or other wide color gamut modes get enabled.
Without this, the chain->color_outcome_serial would stay at zero and
the properties would not ever get assigned during drm_atomic_commit(),
leaving HDR disabled on the display sink.
Fixes: 13137393f6 ("wsi/display: Expose HDR10 colorspace based on EDID")
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Autumn Ashton <misyl@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37880>
This commit is contained in:
@@ -3077,6 +3077,15 @@ wsi_display_surface_create_swapchain(
|
||||
}
|
||||
}
|
||||
|
||||
/* For a non-default colorspace, make sure that proper setup also works if
|
||||
* a client app does not explicitly call vkSetHdrMetadataEXT(), but only
|
||||
* selects a HDR colorspace. We assign the EDID provided metadata here, so
|
||||
* the 1st atomic commit will assign colorspace and HDR metadata props to
|
||||
* the connector to enable HDR or Wide color gamut modes.
|
||||
*/
|
||||
if (create_info->imageColorSpace != VK_COLOR_SPACE_SRGB_NONLINEAR_KHR)
|
||||
wsi_display_set_hdr_metadata(&chain->base, &chain->hdr_metadata);
|
||||
|
||||
*swapchain_out = &chain->base;
|
||||
|
||||
return VK_SUCCESS;
|
||||
|
||||
Reference in New Issue
Block a user