summaryrefslogtreecommitdiff
path: root/src/amdgpu_drm_queue.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2016-03-18 17:07:47 +0900
committerMichel Dänzer <michel@daenzer.net>2016-03-23 18:58:05 +0900
commita58bfa98208cc092014d3f36a08714eb1e0d8814 (patch)
treee72fb8d0d960e875afb09b0f217229a6ced31a09 /src/amdgpu_drm_queue.c
parente4888df6e32bb817bf0d6166a22b19c14e189a84 (diff)
drm_queue: Don't abort events immediately from amdgpu_drm_abort_client
Keep them around until the DRM event arrives, but then call the abort functions instead of the handler functions. This is a prerequisite for the following fix. (Ported from radeon commit 3989766edde85d1abe7024577b98fc9b007bc02a) Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/amdgpu_drm_queue.c')
-rw-r--r--src/amdgpu_drm_queue.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/amdgpu_drm_queue.c b/src/amdgpu_drm_queue.c
index 9bec658..b5aead2 100644
--- a/src/amdgpu_drm_queue.c
+++ b/src/amdgpu_drm_queue.c
@@ -64,8 +64,12 @@ amdgpu_drm_queue_handler(int fd, unsigned int frame, unsigned int sec,
xorg_list_for_each_entry_safe(e, tmp, &amdgpu_drm_queue, list) {
if (e == user_data) {
xorg_list_del(&e->list);
- e->handler(e->scrn, frame,
- (uint64_t)sec * 1000000 + usec, e->data);
+ if (e->handler)
+ e->handler(e->scrn, frame,
+ (uint64_t)sec * 1000000 + usec,
+ e->data);
+ else
+ e->abort(e->scrn, e->data);
free(e);
break;
}
@@ -115,15 +119,19 @@ amdgpu_drm_abort_one(struct amdgpu_drm_queue_entry *e)
/*
* Abort drm queue entries for a client
+ *
+ * NOTE: This keeps the entries in the list until the DRM event arrives,
+ * but then it calls the abort functions instead of the handler
+ * functions.
*/
void
amdgpu_drm_abort_client(ClientPtr client)
{
- struct amdgpu_drm_queue_entry *e, *tmp;
+ struct amdgpu_drm_queue_entry *e;
- xorg_list_for_each_entry_safe(e, tmp, &amdgpu_drm_queue, list) {
+ xorg_list_for_each_entry(e, &amdgpu_drm_queue, list) {
if (e->client == client)
- amdgpu_drm_abort_one(e);
+ e->handler = NULL;
}
}