[idd] keep the generated EDID immutable

Generate the EDID once during adapter initialization and update only the
live mode list when resolutions change.

Changing the EDID during a monitor replug causes Windows to identify it
as a different monitor, losing the existing display configuration.
Reusing the original EDID preserves the monitor identity while still
allowing dynamic modes to be advertised through IddCx.
This commit is contained in:
Geoffrey McRae
2026-07-18 02:14:12 +10:00
parent b69dd4d897
commit 37d7f0e48f
2 changed files with 18 additions and 14 deletions

View File

@@ -140,11 +140,12 @@ private:
void DeInitLGMP();
void LGMPTimer();
void ResendCursor() const;
void InitializeEdid();
// Guards m_displayModes and m_edid. The mode list is rebuilt on the LGMP
// timer thread (SetResolution) while IddCx concurrently enumerates it on its
// own callback threads (ParseMonitorDescription / MonitorQueryTargetModes /
// FinishInit). Never held across an IddCx API call - snapshot then call.
// own callback threads. The EDID is initialized once and remains immutable.
// Never held across an IddCx API call - snapshot then call.
mutable SRWLOCK m_modeLock = SRWLOCK_INIT;
CSettings::DisplayModes m_displayModes;