From a6b6e8ba026acedef6336b17adf06aebddd5f22f Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 6 May 2016 10:46:14 +1000 Subject: prime: clean up slave bo properly. (v3) This is an ABI break, in that we now pass NULL to a function that hasn't accepted it before. Alex Goins had a different patch for this but it wasn't symmetrical, it freed something in a very different place than it allocated it, this attempts to retain symmetry in the releasing of the backing bo. v2: use a new toplevel API, though it still passes NULL to something that wasn't expecting it. v3: pass -1 instead of 0. Signed-off-by: Dave Airlie Tested-by: Hans de Goede Reviewed-by: Hans de Goede Reviewed-by: Alex Goins --- dix/pixmap.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'dix/pixmap.c') diff --git a/dix/pixmap.c b/dix/pixmap.c index 11d83fe00..49267a19b 100644 --- a/dix/pixmap.c +++ b/dix/pixmap.c @@ -132,6 +132,13 @@ FreePixmap(PixmapPtr pPixmap) free(pPixmap); } +void PixmapUnshareSlavePixmap(PixmapPtr slave_pixmap) +{ + int ihandle = -1; + ScreenPtr pScreen = slave_pixmap->drawable.pScreen; + pScreen->SetSharedPixmapBacking(slave_pixmap, ((void *)(long)ihandle)); +} + PixmapPtr PixmapShareToSlave(PixmapPtr pixmap, ScreenPtr slave) { PixmapPtr spix; -- cgit v1.2.3