summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel.daenzer@amd.com>2017-08-09 13:02:34 +0900
committerMichel Dänzer <michel@daenzer.net>2017-08-17 16:05:26 +0900
commit3e24770b1b472fc15df56d06f5f04778c9db63dd (patch)
treeb87f9082f8d7a10599596c305676a571853e2101
parent36ce7920136c0d723c9397a84e7dd5926a9c7943 (diff)
Use xorg_list_append for the DRM event list
We were adding entries at the start of the list, i.e. the list was ordered from most recently added to least recently added. However, the corresponding DRM events are generally expected to arrive in the same order as they are queued, which means that radeon_drm_queue_alloc would generally have to traverse the whole list to find the entry corresponding to an arrived event. Fix this by adding entries at the end of the list. Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--src/radeon_drm_queue.c2
-rw-r--r--src/radeon_list.h7
2 files changed, 8 insertions, 1 deletions
diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c
index 31f24350..37fdafeb 100644
--- a/src/radeon_drm_queue.c
+++ b/src/radeon_drm_queue.c
@@ -105,7 +105,7 @@ radeon_drm_queue_alloc(xf86CrtcPtr crtc, ClientPtr client,
e->handler = handler;
e->abort = abort;
- xorg_list_add(&e->list, &radeon_drm_queue);
+ xorg_list_append(&e->list, &radeon_drm_queue);
return e->seq;
}
diff --git a/src/radeon_list.h b/src/radeon_list.h
index a0038c96..f9e4ff73 100644
--- a/src/radeon_list.h
+++ b/src/radeon_list.h
@@ -35,6 +35,13 @@
#define xorg_list_del list_del
#define xorg_list_for_each_entry list_for_each_entry
#define xorg_list_for_each_entry_safe list_for_each_entry_safe
+
+static inline void
+xorg_list_append(struct list *entry, struct list *head)
+{
+ __list_add(entry, head->prev, head);
+}
+
#endif
#endif /* _RADEON_LIST_H_ */