@@ -2483,38 +2483,41 @@ namespace gamescope
24832483 pHDRStaticMetadata->desired_content_min_luminance
24842484 ? nits_to_u16_dark ( pHDRStaticMetadata->desired_content_min_luminance )
24852485 : nits_to_u16_dark ( 0 .0f );
2486-
2487- // Generate a default HDR10 infoframe.
2488- hdr_output_metadata defaultHDRMetadata{};
2489- hdr_metadata_infoframe *pInfoframe = &defaultHDRMetadata.hdmi_metadata_type1 ;
2490-
2491- // To be filled in by the app based on the scene, default to desired_content_max_luminance
2492- //
2493- // Using display's max_fall for the default metadata max_cll to avoid displays
2494- // overcompensating with tonemapping for SDR content.
2495- uint16_t uDefaultInfoframeLuminances = m_Mutable.HDR .uMaxFrameAverageLuminance ;
2496-
2497- pInfoframe->display_primaries [0 ].x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .r .x );
2498- pInfoframe->display_primaries [0 ].y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .r .y );
2499- pInfoframe->display_primaries [1 ].x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .g .x );
2500- pInfoframe->display_primaries [1 ].y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .g .y );
2501- pInfoframe->display_primaries [2 ].x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .b .x );
2502- pInfoframe->display_primaries [2 ].y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .b .y );
2503- pInfoframe->white_point .x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .white .x );
2504- pInfoframe->white_point .y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .white .y );
2505- pInfoframe->max_display_mastering_luminance = uDefaultInfoframeLuminances;
2506- pInfoframe->min_display_mastering_luminance = m_Mutable.HDR .uMinContentLightLevel ;
2507- pInfoframe->max_cll = uDefaultInfoframeLuminances;
2508- pInfoframe->max_fall = uDefaultInfoframeLuminances;
2509- pInfoframe->eotf = HDMI_EOTF_ST2084;
2510-
2511- m_Mutable.HDR .pDefaultMetadataBlob = GetBackend ()->CreateBackendBlob ( defaultHDRMetadata );
25122486 }
25132487 else
25142488 {
25152489 m_Mutable.HDR .bExposeHDRSupport = false ;
25162490 }
25172491 }
2492+
2493+ // Generate a default HDR10 infoframe.
2494+ if ( m_Mutable.HDR .IsHDR10 () )
2495+ {
2496+ hdr_output_metadata defaultHDRMetadata{};
2497+ hdr_metadata_infoframe *pInfoframe = &defaultHDRMetadata.hdmi_metadata_type1 ;
2498+
2499+ // To be filled in by the app based on the scene, default to desired_content_max_luminance
2500+ //
2501+ // Using display's max_fall for the default metadata max_cll to avoid displays
2502+ // overcompensating with tonemapping for SDR content.
2503+ uint16_t uDefaultInfoframeLuminances = m_Mutable.HDR .uMaxFrameAverageLuminance ;
2504+
2505+ pInfoframe->display_primaries [0 ].x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .r .x );
2506+ pInfoframe->display_primaries [0 ].y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .r .y );
2507+ pInfoframe->display_primaries [1 ].x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .g .x );
2508+ pInfoframe->display_primaries [1 ].y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .g .y );
2509+ pInfoframe->display_primaries [2 ].x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .b .x );
2510+ pInfoframe->display_primaries [2 ].y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .primaries .b .y );
2511+ pInfoframe->white_point .x = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .white .x );
2512+ pInfoframe->white_point .y = color_xy_to_u16 ( m_Mutable.DisplayColorimetry .white .y );
2513+ pInfoframe->max_display_mastering_luminance = uDefaultInfoframeLuminances;
2514+ pInfoframe->min_display_mastering_luminance = m_Mutable.HDR .uMinContentLightLevel ;
2515+ pInfoframe->max_cll = uDefaultInfoframeLuminances;
2516+ pInfoframe->max_fall = uDefaultInfoframeLuminances;
2517+ pInfoframe->eotf = HDMI_EOTF_ST2084;
2518+
2519+ m_Mutable.HDR .pDefaultMetadataBlob = GetBackend ()->CreateBackendBlob ( defaultHDRMetadata );
2520+ }
25182521 }
25192522
25202523 // ///////////////////////
0 commit comments