drm_self_refresh_helper_update_avg_times() was incorrectly accessing the new incoming state after drm_atomic_helper_commit_hw_done(). But this state might have already been superceeded by an !nonblock atomic update resulting in dereferencing an already free'd crtc_state. TODO I *think* this will more or less do the right thing.. althought I'm not 100% sure if, for example, we enter psr in a nonblock commit, and then leave psr in a !nonblock commit that overtakes the completion of the nonblock commit. Not sure if this sort of scenario can happen in practice. But not crashing is better than crashing, so I guess we should either take this patch or rever the self-refresh helpers until Sean can figure out a better solution.
Showing the changes to include (1 of 3 files). Show all
Unified · Split
| @@ -13,7 +13,8 @@ struct drm_crtc; · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | void drm_self_refresh_helper_alter_state(struct drm_atomic_state *state); |
| 15 | 15 | void drm_self_refresh_helper_update_avg_times(struct drm_atomic_state *state, |
| 16 | − unsigned int commit_time_ms); | |
| 16 | + unsigned int commit_time_ms, | |
| 17 | + unsigned int new_self_refresh_mask); | |
| 17 | 18 | |
| 18 | 19 | int drm_self_refresh_helper_init(struct drm_crtc *crtc); |
| 19 | 20 | void drm_self_refresh_helper_cleanup(struct drm_crtc *crtc); |