[PATCH v5 08/13] modesetting: Fix mmap leak in scanout_pixmap_cpu
Alex Goins
agoins at nvidia.com
Wed Apr 13 04:17:55 UTC 2016
drmmode_set_target_scanout_pixmap_cpu() uses drmmode_map_slave_bo(), which maps
a dumb bo. However, when cleaning up scanout pixmaps, it never destroys it,
leading to a leak of mapped memory. With enough modesets, this can result in an
insane amount of memory being mapped. Add dumb_bo_destroy() of the backing bo as
part of the cleanup process.
v1: Initial commit
v2: Unchanged
v3: Refactor to do dumb_bo_destroy as part of teardown_scanout_pixmap
v4: Unchanged
v5: Refactor for previous target change
Signed-off-by: Alex Goins <agoins at nvidia.com>
---
hw/xfree86/drivers/modesetting/drmmode_display.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index e10dc95..7ff75a5 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -870,6 +870,7 @@ drmmode_set_target_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix,
if (*target) {
ppriv = msGetPixmapPriv(drmmode, *target);
drmModeRmFB(drmmode->fd, ppriv->fb_id);
+ dumb_bo_destroy(drmmode->fd, ppriv->backing_bo);
if (ppriv->slave_damage) {
DamageUnregister(ppriv->slave_damage);
ppriv->slave_damage = NULL;
--
1.9.1
More information about the xorg-devel
mailing list