summaryrefslogtreecommitdiff
path: root/src/radeon.h
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-09-12 18:54:33 +0900
committerMichel Dänzer <michel@daenzer.net>2016-09-21 16:25:25 +0900
commit8523a733b6a5de6116a6332fefc871d4c32652d8 (patch)
treeda2201680ea4e4772c84760cdd7df281ddb97064 /src/radeon.h
parent53be26b00e83f871f0afd39caa5a7a1d6ec4aea1 (diff)
Propagate failure from radeon_set_pixmap_bo
(Ported from amdgpu commits c315c00e44afc91a7c8e2eab5af836d9643ebb88 and 0d42082108c264568e2aadd15ace70e72388bc65)
Diffstat (limited to 'src/radeon.h')
-rw-r--r--src/radeon.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/src/radeon.h b/src/radeon.h
index 590966fd..c914a585 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -678,7 +678,7 @@ static inline struct radeon_surface *radeon_get_pixmap_surface(PixmapPtr pPix)
uint32_t radeon_get_pixmap_tiling(PixmapPtr pPix);
-static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
+static inline Bool radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
{
#ifdef USE_GLAMOR
RADEONInfoPtr info = RADEONPTR(xf86ScreenToScrn(pPix->drawable.pScreen));
@@ -688,11 +688,11 @@ static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
priv = radeon_get_pixmap_private(pPix);
if (priv == NULL && bo == NULL)
- return;
+ return TRUE;
if (priv) {
if (priv->bo == bo)
- return;
+ return TRUE;
if (priv->bo)
radeon_bo_unref(priv->bo);
@@ -709,7 +709,7 @@ static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
if (!priv) {
priv = calloc(1, sizeof (struct radeon_pixmap));
if (!priv)
- goto out;
+ return FALSE;
}
radeon_bo_ref(bo);
@@ -717,8 +717,9 @@ static inline void radeon_set_pixmap_bo(PixmapPtr pPix, struct radeon_bo *bo)
radeon_bo_get_tiling(bo, &priv->tiling_flags, &pitch);
}
-out:
+
radeon_set_pixmap_private(pPix, priv);
+ return TRUE;
} else
#endif /* USE_GLAMOR */
{
@@ -735,7 +736,10 @@ out:
driver_priv->bo = bo;
radeon_bo_get_tiling(bo, &driver_priv->tiling_flags, &pitch);
+ return TRUE;
}
+
+ return FALSE;
}
}