renderer/cm: allow gamma 2.2 instead of sRGB EOTF (#12094)

This commit is contained in:
Dominick DiMaggio 2025-10-29 08:53:42 -04:00 committed by GitHub
parent ce9787b3f4
commit ff50dc36e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 51 additions and 15 deletions

View file

@ -48,6 +48,7 @@ struct SMonitorRule {
std::string mirrorOf = "";
bool enable10bit = false;
NCMType::eCMType cmType = NCMType::CM_SRGB;
int sdrEotf = 0;
float sdrSaturation = 1.0f; // SDR -> HDR
float sdrBrightness = 1.0f; // SDR -> HDR
@ -132,6 +133,7 @@ class CMonitor {
bool m_vrrActive = false; // this can be TRUE even if VRR is not active in the case that this display does not support it.
bool m_enabled10bit = false; // as above, this can be TRUE even if 10 bit failed.
NCMType::eCMType m_cmType = NCMType::CM_SRGB;
int m_sdrEotf = 0;
float m_sdrSaturation = 1.0f;
float m_sdrBrightness = 1.0f;
float m_sdrMinLuminance = 0.2f;
@ -275,7 +277,7 @@ class CMonitor {
// methods
void onConnect(bool noRule);
void onDisconnect(bool destroy = false);
void applyCMType(NCMType::eCMType cmType);
void applyCMType(NCMType::eCMType cmType, int cmSdrEotf);
bool applyMonitorRule(SMonitorRule* pMonitorRule, bool force = false);
void addDamage(const pixman_region32_t* rg);
void addDamage(const CRegion& rg);