[PATCH 3/3] lib/igt_hdr: Fix EOTF bit flag checking

Alex Hung
2026-03-17T17:52:48Z

EOTF values are bit positions, not masks. Use (1 << value) to create
proper bit masks when checking HDR support in CTA-861 EDID blocks.

Signed-off-by: Alex Hung <alex.hung@amd.com>
---
lib/igt_hdr.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/igt_hdr.c b/lib/igt_hdr.c
index 6368ae78b..e1bd69087 100644
--- a/lib/igt_hdr.c
+++ b/lib/igt_hdr.c
@@ -151,8 +151,8 @@ bool igt_hdr_cta_block_has_hdr(const char *edid_ext)
{
if ((((edid_ext[0] & 0xe0) >> 5 == USE_EXTENDED_TAG) &&
(edid_ext[1] == HDR_STATIC_METADATA_BLOCK)) &&
- ((edid_ext[2] & HDMI_EOTF_TRADITIONAL_GAMMA_HDR) ||
- (edid_ext[2] & HDMI_EOTF_SMPTE_ST2084)))
+ ((edid_ext[2] & (1 << HDMI_EOTF_TRADITIONAL_GAMMA_HDR)) ||
+ (edid_ext[2] & (1 << HDMI_EOTF_SMPTE_ST2084))))
return true;

return false;
--
2.43.0