[PATCH xf86-video-ati 1/4] EXA: Handle NULL BO pointer in radeon_set_pixmap_bo

Michel Dänzer michel at daenzer.net
Fri Aug 24 09:02:41 UTC 2018


From: Michel Dänzer <michel.daenzer at amd.com>

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/radeon.h | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/src/radeon.h b/src/radeon.h
index 1a1edb1ba..b1d5f5af4 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -772,11 +772,15 @@ static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_buffer *bo
 	    radeon_buffer_unref(&driver_priv->bo);
 	    drmmode_fb_reference(pRADEONEnt->fd, &driver_priv->fb, NULL);
 
-	    radeon_buffer_ref(bo);
 	    driver_priv->bo = bo;
 
-	    radeon_bo_get_tiling(bo->bo.radeon, &driver_priv->tiling_flags,
-				 &pitch);
+	    if (bo) {
+		radeon_buffer_ref(bo);
+		radeon_bo_get_tiling(bo->bo.radeon, &driver_priv->tiling_flags,
+				     &pitch);
+	    } else
+		driver_priv->tiling_flags = 0;
+
 	    return TRUE;
 	}
 
-- 
2.18.0



More information about the amd-gfx mailing list