-
Notifications
You must be signed in to change notification settings - Fork 104
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ignore zero length gamma curves #3248
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3248 +/- ##
==========================================
+ Coverage 77.81% 77.83% +0.02%
==========================================
Files 1058 1068 +10
Lines 67163 67565 +402
==========================================
+ Hits 52265 52592 +327
- Misses 14898 14973 +75 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This change certainly isn't wrong, but why are we attempting to set a zero-sized gamma curve? What's trying to set this further up the stack?
I wondered that too. I've not been able to identify specific wrong logic. It like we default construct it and never change it, and I don't see anything that guarantees we will change it so... Will have a further look, but IMO this mitigation is good anyway |
The only place gamma gets set is GammaCurves gamma;
/* Get information about the current mode */
if (current_crtc) {
current_mode_info = current_crtc->mode;
if (current_crtc->gamma_size > 0)
gamma = mg::LinearGammaLUTs(current_crtc->gamma_size);
}
...
output.gamma = gamma; The upshot of which is, that if there no And, empirically, the usual way to reach this code is with |
Ignore zero length gamma curves
Ignore zero length gamma curves
Ignore zero length gamma curves
After a wake we might see an invalid Gamma curve. Ignore it.
Fixes: #3238
It fixes the problem because
ensure_crtc()
might allocate a newcurrent_crtc
but thedrmModeCrtcSetGamma()
will fail leaving it unused - but still associated with the output.