From 0a9943e8a4e14773265080d9547ba40ab6ccb44b Mon Sep 17 00:00:00 2001 From: Jonathan Gray Date: Mon, 26 Oct 2020 13:32:01 +0000 Subject: backport commits to not crash when accel is disabled c0eb5dbd Don't crash X server if GPU acceleration is not available 4d84cf43 Handle NULL fb_ptr in pixmap_get_fb prompted by a report to bugs@ from Jean-Louis ABRAHAM ok matthieu@ --- driver/xf86-video-ati/src/radeon.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'driver') diff --git a/driver/xf86-video-ati/src/radeon.h b/driver/xf86-video-ati/src/radeon.h index 2c9134667..e4a2ba66f 100644 --- a/driver/xf86-video-ati/src/radeon.h +++ b/driver/xf86-video-ati/src/radeon.h @@ -790,8 +790,8 @@ static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_buffer *bo static inline struct radeon_buffer *radeon_get_pixmap_bo(PixmapPtr pPix) { -#ifdef USE_GLAMOR RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pPix->drawable.pScreen)); +#ifdef USE_GLAMOR if (info->use_glamor) { struct radeon_pixmap *priv; @@ -799,7 +799,7 @@ static inline struct radeon_buffer *radeon_get_pixmap_bo(PixmapPtr pPix) return priv ? priv->bo : NULL; } else #endif - { + if (info->accelOn) { struct radeon_exa_pixmap_priv *driver_priv; driver_priv = exaGetPixmapDriverPrivate(pPix); return driver_priv ? driver_priv->bo : NULL; @@ -896,7 +896,7 @@ radeon_pixmap_get_fb(PixmapPtr pix) handle); } - return *fb_ptr; + return fb_ptr ? *fb_ptr : NULL; } -- cgit v1.2.3