xf86-video-amdgpu: Branch 'master' - 2 commits
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Aug 31 17:05:26 UTC 2018
src/amdgpu_drm_queue.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
New commits:
commit 26770be44b89b83bf39c28f2fe284c8cb92ed0c0
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Aug 29 18:49:19 2018 +0200
Don't use xorg_list_for_each_entry_safe for signalled flips
drm_wait_pending_flip can get called from drm_handle_event, in which
case xorg_list_for_each_entry_safe can end up processing the same entry
in both. To avoid this, just process the first list entry until the list
is empty.
diff --git a/src/amdgpu_drm_queue.c b/src/amdgpu_drm_queue.c
index f9db81c..ba841d1 100644
--- a/src/amdgpu_drm_queue.c
+++ b/src/amdgpu_drm_queue.c
@@ -257,8 +257,11 @@ amdgpu_drm_handle_event(int fd, drmEventContext *event_context)
r = drmHandleEvent(fd, event_context);
- xorg_list_for_each_entry_safe(e, tmp, &amdgpu_drm_flip_signalled, list)
+ while (!xorg_list_is_empty(&amdgpu_drm_flip_signalled)) {
+ e = xorg_list_first_entry(&amdgpu_drm_flip_signalled,
+ struct amdgpu_drm_queue_entry, list);
amdgpu_drm_queue_handle_one(e);
+ }
xorg_list_for_each_entry_safe(e, tmp, &amdgpu_drm_vblank_signalled, list) {
drmmode_crtc_private_ptr drmmode_crtc = e->crtc->driver_private;
@@ -277,12 +280,15 @@ void amdgpu_drm_wait_pending_flip(xf86CrtcPtr crtc)
{
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
AMDGPUEntPtr pAMDGPUEnt = AMDGPUEntPriv(crtc->scrn);
- struct amdgpu_drm_queue_entry *e, *tmp;
+ struct amdgpu_drm_queue_entry *e;
drmmode_crtc->wait_flip_nesting_level++;
- xorg_list_for_each_entry_safe(e, tmp, &amdgpu_drm_flip_signalled, list)
+ while (!xorg_list_is_empty(&amdgpu_drm_flip_signalled)) {
+ e = xorg_list_first_entry(&amdgpu_drm_flip_signalled,
+ struct amdgpu_drm_queue_entry, list);
amdgpu_drm_queue_handle_one(e);
+ }
while (drmmode_crtc->flip_pending
&& amdgpu_drm_handle_event(pAMDGPUEnt->fd,
commit 7eea3e2cd74eed22e982319144e18ae5b1087b78
Author: Michel Dänzer <michel.daenzer at amd.com>
Date: Wed Aug 29 18:41:19 2018 +0200
Always delete entry from list in drm_queue_handler
We left entries without a handler hook in the list, so the list could
keep taking longer to process and use up more memory.
diff --git a/src/amdgpu_drm_queue.c b/src/amdgpu_drm_queue.c
index b13d280..f9db81c 100644
--- a/src/amdgpu_drm_queue.c
+++ b/src/amdgpu_drm_queue.c
@@ -82,7 +82,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) {
- e->abort(e->crtc, e->data);
+ amdgpu_drm_queue_handle_one(e);
break;
}
More information about the xorg-commit
mailing list