summaryrefslogtreecommitdiff
path: root/src/amdgpu_pixmap.h
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-06-15 17:20:36 +0900
committerMichel Dänzer <michel@daenzer.net>2016-06-16 15:20:04 +0900
commitc315c00e44afc91a7c8e2eab5af836d9643ebb88 (patch)
tree080d2e3b6bf90eed2abc191d504d38e0140f967e /src/amdgpu_pixmap.h
parent74602c4221e3c84949fd69f690cbc66dcae384ea (diff)
Propagate failure from amdgpu_set_pixmap_bo
Preparation for the following fixes. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/amdgpu_pixmap.h')
-rw-r--r--src/amdgpu_pixmap.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/amdgpu_pixmap.h b/src/amdgpu_pixmap.h
index ecdd74d..9c51067 100644
--- a/src/amdgpu_pixmap.h
+++ b/src/amdgpu_pixmap.h
@@ -54,17 +54,17 @@ static inline void amdgpu_set_pixmap_private(PixmapPtr pixmap,
dixSetPrivate(&pixmap->devPrivates, &amdgpu_pixmap_index, priv);
}
-static inline void amdgpu_set_pixmap_bo(PixmapPtr pPix, struct amdgpu_buffer *bo)
+static inline Bool amdgpu_set_pixmap_bo(PixmapPtr pPix, struct amdgpu_buffer *bo)
{
struct amdgpu_pixmap *priv;
priv = amdgpu_get_pixmap_private(pPix);
if (priv == NULL && bo == NULL)
- return;
+ return TRUE;
if (priv) {
if (priv->bo == bo)
- return;
+ return TRUE;
if (priv->bo) {
amdgpu_bo_unref(&priv->bo);
@@ -81,13 +81,14 @@ static inline void amdgpu_set_pixmap_bo(PixmapPtr pPix, struct amdgpu_buffer *bo
if (!priv) {
priv = calloc(1, sizeof(struct amdgpu_pixmap));
if (!priv)
- goto out;
+ return FALSE;
}
amdgpu_bo_ref(bo);
priv->bo = bo;
}
-out:
+
amdgpu_set_pixmap_private(pPix, priv);
+ return TRUE;
}
static inline struct amdgpu_buffer *amdgpu_get_pixmap_bo(PixmapPtr pPix)