Pipes not supported in wlr gamma protocol #11045
-
|
Hi, Thank you for the amazing you have done with this project. While building my own stuff on top of it I encountered a weird bug but I think it has been inherited from wlroots (I am not sure though). Looking at src/protocols/GammaControl.cpp line 74 : ssize_t readBytes = pread(gammaFd.get(), m_gammaTable.data(), m_gammaTable.size() * sizeof(uint16_t), 0);
if (readBytes < 0 || (size_t)readBytes != m_gammaTable.size() * sizeof(uint16_t)) {
LOGM(ERR, "Failed to read bytes");
if ((size_t)readBytes != m_gammaTable.size() * sizeof(uint16_t)) {
gamma->error(ZWLR_GAMMA_CONTROL_V1_ERROR_INVALID_GAMMA, "Gamma ramps size mismatch");
return;
}
m_resource->sendFailed();
return;
}
It seems that this is based on wlroots implementation of the protocol which does not handle pipes correctly. This seems to be based on the interpretation that "[t]he file descriptor can be memory-mapped to provide the raw gamma table" is being read as, [t]he file descriptor must be memory-mapped to provide the raw gamma table. (see: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3992 and https://gitlab.freedesktop.org/wlroots/wlr-protocols/-/issues/138) At least one other compositor supports pipes with this protocol (see: https://github.com/YaLTeR/niri/blob/main/src/protocols/gamma_control.rs, line 171) and it does not break support for application such as I will not make a point about how this protocol had to be worded and what should be the correct implementation according to https://www.rfc-editor.org/rfc/rfc2119. I will just ask if it possible to support pipes for this protocol? I plan to open source an app that uses this protocol and having to handle mutable anonymous files per output to make a one time transfer to a compositor feels a bit overkill. Thank you for your time and consideration Edit: typo and grammar. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
a small test client would be useful. Unless you want to write the code yourself and make a MR. I have no opposition. |
Beta Was this translation helpful? Give feedback.
a small test client would be useful. Unless you want to write the code yourself and make a MR. I have no opposition.