diff options
author | Jim Qu <Jim.Qu@amd.com> | 2018-04-17 19:11:16 +0800 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2018-04-18 10:42:51 +0200 |
commit | 9f6a8905611b5b1d8fcd31bebbc9af7ca1355cc3 (patch) | |
tree | c9938fc84057d82bf797a4e5d7ec11997c17814e /src | |
parent | c6f1559eba551a5a3bf374c7e7e875928f3b138d (diff) |
Wait for pending scanout update before calling drmmode_crtc_scanout_free
There is a case that when set screen from reverse to normal, the old
scanout damage is freed in modesetting before scanout update handler,
so it causes segment fault issue.
Signed-off-by: Jim Qu <Jim.Qu@amd.com>
[ Michel Dänzer: Only call drmmode_crtc_wait_pending_event before
drmmode_crtc_scanout_free is actually called, slightly tweak commit
message ]
Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 85970d1..2d1540d 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -952,9 +952,11 @@ done: if (drmmode_crtc->scanout[scanout_id].pixmap && fb != amdgpu_pixmap_get_fb(drmmode_crtc-> - scanout[scanout_id].pixmap)) + scanout[scanout_id].pixmap)) { + drmmode_crtc_wait_pending_event(drmmode_crtc, pAMDGPUEnt->fd, + drmmode_crtc->scanout_update_pending); drmmode_crtc_scanout_free(drmmode_crtc); - else if (!drmmode_crtc->tear_free) { + } else if (!drmmode_crtc->tear_free) { drmmode_crtc_scanout_destroy(drmmode, &drmmode_crtc->scanout[1]); } |