diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-10-25 16:42:03 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-10-26 15:58:26 +0900 |
commit | 6c940446ddadf418ee4959e46fa552b6c1cf6704 (patch) | |
tree | 26ff54a0fcf89bfe46608c433fed9e0fe6228fe2 | |
parent | 61df12e2377cbb19a19ca9d5624df8959822da9f (diff) |
Always call PixmapStopDirtyTracking in drmmode_set_scanout_pixmap
Otherwise, we may leak screen->pixmap_dirty_list entries if
drmmode_set_scanout_pixmap is called repatedly with ppix != NULL, which
can happen from RRReplaceScanoutPixmap.
(Inspired by xserver commit b773a9c8126222e5fed2904d012fbf917a9f22fd)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r-- | src/drmmode_display.c | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/src/drmmode_display.c b/src/drmmode_display.c index 3db0a964..a5a34fdb 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1142,23 +1142,21 @@ drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; RADEONInfoPtr info = RADEONPTR(crtc->scrn); + ScreenPtr screen = crtc->scrn->pScreen; + PixmapDirtyUpdatePtr dirty; - if (!ppix) { - 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; + 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; - } + PixmapStopDirtyTracking(dirty->src, dirty->slave_dst); + drmmode_crtc_scanout_free(drmmode_crtc); + break; + } + if (!ppix) return TRUE; - } if (!drmmode_crtc_scanout_create(crtc, &drmmode_crtc->scanout[0], ppix->drawable.width, |