diff options
-rw-r--r-- | src/radeon.h | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/src/radeon.h b/src/radeon.h index 74454c30..008a59f3 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -877,21 +877,22 @@ static inline struct drmmode_fb* radeon_pixmap_get_fb(PixmapPtr pix) { struct drmmode_fb **fb_ptr = radeon_pixmap_get_fb_ptr(pix); - - if (!fb_ptr) - return NULL; - - if (!*fb_ptr) { - uint32_t handle; - - if (radeon_get_pixmap_handle(pix, &handle)) { - ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen); - RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn); - - *fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd, pix->drawable.width, - pix->drawable.height, pix->devKind, - handle); - } + uint32_t handle; + + if (fb_ptr && *fb_ptr) + return *fb_ptr; + + if (radeon_get_pixmap_handle(pix, &handle)) { + ScrnInfoPtr scrn = xf86ScreenToScrn(pix->drawable.pScreen); + RADEONEntPtr pRADEONEnt = RADEONEntPriv(scrn); + + if (!fb_ptr) + fb_ptr = radeon_pixmap_get_fb_ptr(pix); + + *fb_ptr = radeon_fb_create(scrn, pRADEONEnt->fd, + pix->drawable.width, + pix->drawable.height, pix->devKind, + handle); } return *fb_ptr; |