3
0
mirror of https://github.com/hyprwm/Hyprland.git synced 2026-08-18 11:02:10 +00:00

render/cm: fix hdrMetadataEqual returning inverted result (#15825)

std::memcmp returns a nonzero value when the buffers differ, so
hdrMetadataEqual() returned true for differing metadata and false for
identical metadata. The caller in commitFrame compares
!hdrMetadataEqual(WANTED, CURRENT), which inverted this again: identical
HDR metadata was treated as changed every frame, re-sending
AQ_OUTPUT_STATE_HDR and forcing a full DRM modeset on every commit.

Fixes a per-frame modeset loop on displays with HDR metadata configured
(e.g. cm=hdredid).

Co-authored-by: neonvoidx <me@neonvoid.dev>
This commit is contained in:
Lucas Ritzdorf
2026-08-11 11:06:15 -06:00
committed by GitHub
parent 45c8510c9c
commit 8a24bb3bb6

View File

@ -2304,7 +2304,7 @@ static bool hdrMetadataEqual(const hdr_output_metadata& a, const hdr_output_meta
return false;
static_assert(std::has_unique_object_representations_v<hdr_metadata_infoframe>);
return std::memcmp(&a.hdmi_metadata_type1, &b.hdmi_metadata_type1, sizeof(a.hdmi_metadata_type1));
return std::memcmp(&a.hdmi_metadata_type1, &b.hdmi_metadata_type1, sizeof(a.hdmi_metadata_type1)) == 0;
}
void IHyprRenderer::handleFullscreenSettings(PHLMONITOR pMonitor) {