History

drm/atomic: fix self-refresh helpers crtc state dereference

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.

Rob Clark committed 7 years ago

Commit 86de88c1 parent b330f393 files · +27 −9Browse files

Showing the changes to include (1 of 3 files). Show all

Unified · Split

include/drm/drm_self_refresh_helper.h+2−1
@@ -13,7 +13,8 @@ struct drm_crtc; · 12 unmodified lines
1313
1414 void drm_self_refresh_helper_alter_state(struct drm_atomic_state *state);
1515 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);
1718
1819 int drm_self_refresh_helper_init(struct drm_crtc *crtc);
1920 void drm_self_refresh_helper_cleanup(struct drm_crtc *crtc);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t