From c4e0f4d917615db1be61aa3b3fd918977362c324 Mon Sep 17 00:00:00 2001 From: Mario Kleiner Date: Wed, 15 Oct 2025 00:42:47 +0100 Subject: [PATCH] wsi/display: Accept 0 nits for HDR light level properties for "undefined" CTA-861-G section 6.9.1 Static Metadata Type 1 declares that zero values for different groups of HDR Metadata properties are allowed, including zero nits values for max display mastering luminance, max content light level, max frame-average light level and min display mastering luminance. A zero value is meant to be treated by the video sink as "undefined" / "unknown", and handled accordingly. This is common for dynamically generated visual content. Therefore don't assert on some minimum nits level > 0, but only check for a non-negative level. Fixes: b4176393a0aa ("wsi/display: Implement VK_EXT_hdr_metadata on KHR_display swapchain") Signed-off-by: Mario Kleiner Reviewed-by: Autumn Ashton (cherry picked from commit 19dc09aded4953aeacc2b15233643a0e4881314e) Part-of: --- .pick_status.json | 2 +- src/vulkan/wsi/wsi_common_display.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index d46b0f39e5c..07cc0051275 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -224,7 +224,7 @@ "description": "wsi/display: Accept 0 nits for HDR light level properties for \"undefined\"", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "b4176393a0aa5af547aa3f0ddfd03817e99a2588", "notes": null diff --git a/src/vulkan/wsi/wsi_common_display.c b/src/vulkan/wsi/wsi_common_display.c index d505cf785c1..c30822fc84b 100644 --- a/src/vulkan/wsi/wsi_common_display.c +++ b/src/vulkan/wsi/wsi_common_display.c @@ -2582,7 +2582,7 @@ color_xy_to_u16(float v) static inline uint16_t nits_to_u16(float nits) { - assert(nits >= 1.0f); + assert(nits >= 0.0f); assert(nits <= 65535.0f); /* * CTA-861-G @@ -2596,7 +2596,7 @@ nits_to_u16(float nits) static inline uint16_t nits_to_u16_dark(float nits) { - assert(nits >= 0.0001f); + assert(nits >= 0.0000f); assert(nits <= 6.5535f); /* * CTA-861-G