diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-10-19 18:55:33 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-10-25 16:32:44 +0900 |
commit | 61df12e2377cbb19a19ca9d5624df8959822da9f (patch) | |
tree | c8b12976264ce9aba6c3bd665c4f3e335249c99e /src | |
parent | 49cf3b5032a7ce40afe514b7092440e3e19e05aa (diff) |
Don't rely on randr_crtc->scanout_pixmap in drmmode_set_scanout_pixmap
RRReplaceScanoutPixmap may set randr_crtc->scanout_pixmap = NULL before
we get here.
(Inspired by xserver commit f4c37eeee7953df1fe0e3196eda452acf0078e61)
v2: Always return TRUE in the if (!ppix) block.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com> (v1)
Diffstat (limited to 'src')
-rw-r--r-- | src/drmmode_display.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 2cb59312..3db0a964 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1144,10 +1144,19 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) RADEONInfoPtr info = RADEONPTR(crtc->scrn); if (!ppix) { - if (crtc->randr_crtc->scanout_pixmap) - PixmapStopDirtyTracking(crtc->randr_crtc->scanout_pixmap, - drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap); - drmmode_crtc_scanout_free(drmmode_crtc); + ScreenPtr screen = crtc->scrn->pScreen; + PixmapDirtyUpdatePtr dirty; + + xorg_list_for_each_entry(dirty, &screen->pixmap_dirty_list, ent) { + if (dirty->slave_dst != + drmmode_crtc->scanout[drmmode_crtc->scanout_id].pixmap) + continue; + + PixmapStopDirtyTracking(dirty->src, dirty->slave_dst); + drmmode_crtc_scanout_free(drmmode_crtc); + break; + } + return TRUE; } |