From 2189210e25a0c57b8b9a5ff25c7994a90df8fc5f Mon Sep 17 00:00:00 2001 From: gab Date: Thu, 20 Aug 2026 00:34:48 +0200 Subject: [PATCH] nvt: only parse per-VIC 3D entries when 3D_present is set parseEdidHDMILLCTiming() ends with a loop that consumes the remaining bytes of the HDMI VSDB and interprets each one as an NVT_3D_MULTI_LIST entry. Unlike the two 3D parsing blocks above it, this loop is not guarded by pHDMIVideo->ThreeD_Present, so trailing reserved or padding bytes are treated as 3D mode descriptors. Because NVT_HDMI_3D_SUPPORTED_STRUCT_MASK(x) is 1 << x, any byte value yields a non-zero StereoStructureMask, including 0x00. A single padding byte is therefore enough to leave HDMI3DSupported set on a display whose VSDB advertises 3D_present = 0. The cost is user-visible: nvDpyIsHDRCapable() then returns FALSE, so atomic commits setting the DRM Colorspace property to BT2020_RGB or BT2020_YCC fail with EINVAL, and SendHDRInfoFrame() returns early, so the Dynamic Range and Mastering InfoFrame is never transmitted. HDR is either unavailable or appears to enable while the sink stays in SDR. Guard the loop the same way the preceding ones are. --- src/common/modeset/timing/nvt_edidext_861.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/modeset/timing/nvt_edidext_861.c b/src/common/modeset/timing/nvt_edidext_861.c index f085999ad8..8f897ec447 100644 --- a/src/common/modeset/timing/nvt_edidext_861.c +++ b/src/common/modeset/timing/nvt_edidext_861.c @@ -3620,7 +3620,7 @@ void parseEdidHDMILLCTiming(NVT_EDID_INFO *pInfo, VSDB_DATA *pVsdb, NvU32 *pMapS } // handle any additional per vic modes listed in the EDID - while (DataSz > DataCnt) + while ((pHDMIVideo->ThreeD_Present) && (DataSz > DataCnt)) { // get a pointer to the entry. NVT_3D_MULTI_LIST * pMultiListEntry = (NVT_3D_MULTI_LIST *) &pHdmiLLC->Data[DataCnt];