[PATCH v2 5/8] modesetting: Properly clean up w/ PRIME syncing

Alex Goins agoins at nvidia.com
Tue Jan 5 13:56:03 PST 2016


With PRIME synchronization, there is a second scanout buffer,
scanout_pixmap_back, that needs to be cleaned up when destroying scanout
pixmaps. PRIME synchronization currently shouldn't apply to reverse PRIME,
so only apply to scanout_pixmap_cpu().

v1: Initial commit
v2: Unchanged

Signed-off-by: Alex Goins <agoins at nvidia.com>
---
 hw/xfree86/drivers/modesetting/drmmode_display.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c
index 0d34ca1..3bbf0d3 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -630,6 +630,12 @@ drmmode_set_scanout_pixmap_cpu(xf86CrtcPtr crtc, PixmapPtr ppix)
         if (crtc->randr_crtc->scanout_pixmap) {
             ppriv = msGetPixmapPriv(drmmode, crtc->randr_crtc->scanout_pixmap);
             drmModeRmFB(drmmode->fd, ppriv->fb_id);
+
+            if (crtc->randr_crtc->scanout_pixmap_back) {
+                ppriv = msGetPixmapPriv(drmmode,
+                                        crtc->randr_crtc->scanout_pixmap_back);
+                drmModeRmFB(drmmode->fd, ppriv->fb_id);
+            }
         }
         if (drmmode_crtc->slave_damage) {
             DamageUnregister(drmmode_crtc->slave_damage);
-- 
1.9.1



More information about the xorg-devel mailing list