summaryrefslogtreecommitdiff
path: root/src/amdgpu_drm_queue.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-09-07 18:03:05 +0900
committerMichel Dänzer <michel.daenzer@amd.com>2016-09-07 18:03:05 +0900
commitd166d04f6951f6a48d7d5ce5d31bba857fe0cb06 (patch)
treecaf8674276d914a3466c95b07e08ac4d04f774d1 /src/amdgpu_drm_queue.c
parent6a1ba044c2b71081e6060d0c096917d6238f2145 (diff)
Add explicit AMDGPU_DRM_QUEUE_ERROR define
Should make the amdgpu_drm_queue_alloc error handling clearer, and gets rid of a compile warning about it returning NULL. (Ported from radeon commit a37af701768b12d86868a831a79f1e02ee4968cf) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/amdgpu_drm_queue.c')
-rw-r--r--src/amdgpu_drm_queue.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/amdgpu_drm_queue.c b/src/amdgpu_drm_queue.c
index 562a11a..e8810fd 100644
--- a/src/amdgpu_drm_queue.c
+++ b/src/amdgpu_drm_queue.c
@@ -92,10 +92,11 @@ amdgpu_drm_queue_alloc(xf86CrtcPtr crtc, ClientPtr client,
e = calloc(1, sizeof(struct amdgpu_drm_queue_entry));
if (!e)
- return NULL;
+ return AMDGPU_DRM_QUEUE_ERROR;
+
+ if (_X_UNLIKELY(amdgpu_drm_queue_seq == AMDGPU_DRM_QUEUE_ERROR))
+ amdgpu_drm_queue_seq++;
- if (!amdgpu_drm_queue_seq)
- amdgpu_drm_queue_seq = 1;
e->seq = amdgpu_drm_queue_seq++;
e->client = client;
e->crtc = crtc;