Use drm_abort_one in drm_queue_handler

At this point, we've already established that e->handler is NULL, no
need to check again in drm_queue_handle_one. This also makes it clearer
what's happening.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Michel Dänzer
2018-11-05 18:07:54 +01:00
committed by Michel Daenzer
parent 426f9a4965
commit eda571222f

View File

@@ -72,6 +72,19 @@ amdgpu_drm_queue_handle_one(struct amdgpu_drm_queue_entry *e)
free(e);
}
/*
* Abort one queued DRM entry, removing it
* from the list, calling the abort function and
* freeing the memory
*/
static void
amdgpu_drm_abort_one(struct amdgpu_drm_queue_entry *e)
{
xorg_list_del(&e->list);
e->abort(e->crtc, e->data);
free(e);
}
static void
amdgpu_drm_queue_handler(struct xorg_list *signalled, unsigned int frame,
unsigned int sec, unsigned int usec, void *user_ptr)
@@ -82,7 +95,7 @@ amdgpu_drm_queue_handler(struct xorg_list *signalled, unsigned int frame,
xorg_list_for_each_entry_safe(e, tmp, &amdgpu_drm_queue, list) {
if (e->seq == seq) {
if (!e->handler) {
amdgpu_drm_queue_handle_one(e);
amdgpu_drm_abort_one(e);
break;
}
@@ -173,19 +186,6 @@ amdgpu_drm_queue_alloc(xf86CrtcPtr crtc, ClientPtr client,
return e->seq;
}
/*
* Abort one queued DRM entry, removing it
* from the list, calling the abort function and
* freeing the memory
*/
static void
amdgpu_drm_abort_one(struct amdgpu_drm_queue_entry *e)
{
xorg_list_del(&e->list);
e->abort(e->crtc, e->data);
free(e);
}
/*
* Abort drm queue entries for a client
*