From: Michel Dänzer <michel.daenzer@xxxxxxx> RRReplaceScanoutPixmap may set randr_crtc->scanout_pixmap = NULL before we get here. (Inspired by xserver commit f4c37eeee7953df1fe0e3196eda452acf0078e61) Signed-off-by: Michel Dänzer <michel.daenzer at amd.com> --- src/drmmode_display.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 2cb5931..00a484b 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1144,11 +1144,18 @@ 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); - return TRUE; + 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); + return TRUE; + } } if (!drmmode_crtc_scanout_create(crtc, &drmmode_crtc->scanout[0], -- 2.10.1