diff options
| author | Dominick DiMaggio <ddimaggio324@gmail.com> | 2025-10-29 08:53:42 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-29 12:53:42 +0000 |
| commit | ff50dc36e912b6ad764802d51be838bc7f6ed323 (patch) | |
| tree | a51a09b12e89b9ee3c5ceb2f082c09e49ff146ea /src/config | |
| parent | ce9787b3f47ce550027274a1aa25e74b6fb1c74a (diff) | |
renderer/cm: allow gamma 2.2 instead of sRGB EOTF (#12094)
Diffstat (limited to 'src/config')
| -rw-r--r-- | src/config/ConfigDescriptions.hpp | 7 | ||||
| -rw-r--r-- | src/config/ConfigManager.cpp | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/src/config/ConfigDescriptions.hpp b/src/config/ConfigDescriptions.hpp index 60a21c8b..9c503f0f 100644 --- a/src/config/ConfigDescriptions.hpp +++ b/src/config/ConfigDescriptions.hpp @@ -1542,6 +1542,13 @@ inline static const std::vector<SConfigOptionDescription> CONFIG_OPTIONS = { .type = CONFIG_OPTION_CHOICE, .data = SConfigOptionDescription::SChoiceData{0, "disable,always,ondemand,ignore"}, }, + SConfigOptionDescription{ + .value = "render:cm_sdr_eotf", + .description = "Default transfer function for displaying SDR apps. 0 - Treat unspecified as sRGB, 1 - Treat unspecified as Gamma 2.2, 2 - Treat " + "unspecified and sRGB as Gamma 2.2", + .type = CONFIG_OPTION_CHOICE, + .data = SConfigOptionDescription::SChoiceData{0, "srgb,gamma22,gamma22force"}, + }, /* * cursor: diff --git a/src/config/ConfigManager.cpp b/src/config/ConfigManager.cpp index 3c6729c4..a98e15cf 100644 --- a/src/config/ConfigManager.cpp +++ b/src/config/ConfigManager.cpp @@ -781,6 +781,7 @@ CConfigManager::CConfigManager() { registerConfigVar("render:cm_auto_hdr", Hyprlang::INT{1}); registerConfigVar("render:new_render_scheduling", Hyprlang::INT{0}); registerConfigVar("render:non_shader_cm", Hyprlang::INT{2}); + registerConfigVar("render:cm_sdr_eotf", Hyprlang::INT{0}); registerConfigVar("ecosystem:no_update_news", Hyprlang::INT{0}); registerConfigVar("ecosystem:no_donation_nag", Hyprlang::INT{0}); @@ -842,6 +843,7 @@ CConfigManager::CConfigManager() { m_config->addSpecialConfigValue("monitorv2", "mirror", {STRVAL_EMPTY}); m_config->addSpecialConfigValue("monitorv2", "bitdepth", {STRVAL_EMPTY}); // TODO use correct type m_config->addSpecialConfigValue("monitorv2", "cm", {"auto"}); + m_config->addSpecialConfigValue("monitorv2", "sdr_eotf", Hyprlang::INT{0}); m_config->addSpecialConfigValue("monitorv2", "sdrbrightness", Hyprlang::FLOAT{1.0}); m_config->addSpecialConfigValue("monitorv2", "sdrsaturation", Hyprlang::FLOAT{1.0}); m_config->addSpecialConfigValue("monitorv2", "vrr", Hyprlang::INT{0}); @@ -1115,6 +1117,9 @@ std::optional<std::string> CConfigManager::handleMonitorv2(const std::string& ou VAL = m_config->getSpecialConfigValuePtr("monitorv2", "cm", output.c_str()); if (VAL && VAL->m_bSetByUser) parser.parseCM(std::any_cast<Hyprlang::STRING>(VAL->getValue())); + VAL = m_config->getSpecialConfigValuePtr("monitorv2", "sdr_eotf", output.c_str()); + if (VAL && VAL->m_bSetByUser) + parser.rule().sdrEotf = std::any_cast<Hyprlang::INT>(VAL->getValue()); VAL = m_config->getSpecialConfigValuePtr("monitorv2", "sdrbrightness", output.c_str()); if (VAL && VAL->m_bSetByUser) parser.rule().sdrBrightness = std::any_cast<Hyprlang::FLOAT>(VAL->getValue()); |
