diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2016-10-26 16:15:42 +0900 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2016-10-27 11:01:55 +0900 |
commit | 9c4416422f2d07dbfa7c0b18beb1353f122fc1a1 (patch) | |
tree | 5f85cf9bd24cc9762aaf483b278b421082e4c9c1 /src | |
parent | 0a91f11c03400e3f92a2b048505f39e7de7e87fc (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)
(Ported from radeon commit 6c940446ddadf418ee4959e46fa552b6c1cf6704)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src')
-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 5f0fdb0..9dfef40 100644 --- a/src/drmmode_display.c +++ b/src/drmmode_display.c @@ -1103,23 +1103,21 @@ static Bool drmmode_set_scanout_pixmap(xf86CrtcPtr crtc, PixmapPtr ppix) { drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private; AMDGPUInfoPtr info = AMDGPUPTR(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, |