xf86-video-ati: Branch 'master' - 4 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Sep 11 13:50:40 UTC 2018


 src/radeon_drm_queue.c |   15 +++++++++++----
 src/radeon_kms.c       |    5 +++--
 2 files changed, 14 insertions(+), 6 deletions(-)

New commits:
commit 2d58830c3feafc54dccc0b7bf761a466437d4a09
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Sep 5 18:23:29 2018 +0200

    Fix uninitialized use of local variable pitch in radeon_setup_kernel_mem
    
    Fixes server reset.
    
    Pointed out by clang:
    
    ../../src/radeon_kms.c:2721:9: warning: variable 'pitch' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
        if (!info->front_buffer) {
            ^~~~~~~~~~~~~~~~~~~
    ../../src/radeon_kms.c:2765:27: note: uninitialized use occurs here
        pScrn->displayWidth = pitch / cpp;
                              ^~~~~

diff --git a/src/radeon_kms.c b/src/radeon_kms.c
index a2477681..ae69f335 100644
--- a/src/radeon_kms.c
+++ b/src/radeon_kms.c
@@ -2760,10 +2760,11 @@ static Bool radeon_setup_kernel_mem(ScreenPtr pScreen)
 	    if (tiling_flags)
 		radeon_bo_set_tiling(info->front_buffer->bo.radeon, tiling_flags, pitch);
 	}
-    }
 
-    pScrn->displayWidth = pitch / cpp;
+	pScrn->displayWidth = pitch / cpp;
+    }
 
+    pitch = pScrn->displayWidth * cpp;
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Front buffer size: %dK\n",
 	       pitch * pScrn->virtualY / 1024);
     radeon_kms_update_vram_limit(pScrn, pitch * pScrn->virtualY);
commit 5d5d883496842da84d9418e91cb13454751da625
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Fri Sep 7 18:16:22 2018 +0200

    Bail early from drm_wait_pending_flip if there's no pending flip
    
    No need to process any events in that case.
    
    (Ported from amdgpu commit ca5eb9894fff153c0a1df7bdc4a4745713309e27)

diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c
index bf1650ea..ea78e8e2 100644
--- a/src/radeon_drm_queue.c
+++ b/src/radeon_drm_queue.c
@@ -284,7 +284,8 @@ void radeon_drm_wait_pending_flip(xf86CrtcPtr crtc)
 
     drmmode_crtc->wait_flip_nesting_level++;
 
-    while (!xorg_list_is_empty(&radeon_drm_flip_signalled)) {
+    while (drmmode_crtc->flip_pending &&
+	   !xorg_list_is_empty(&radeon_drm_flip_signalled)) {
 	e = xorg_list_first_entry(&radeon_drm_flip_signalled,
 				  struct radeon_drm_queue_entry, list);
 	radeon_drm_queue_handle_one(e);
commit 4c7d5e50a5e469a541bc463cecb505fe850c0824
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Sep 5 11:29:43 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.
    
    (Ported from amdgpu commit 26770be44b89b83bf39c28f2fe284c8cb92ed0c0)

diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c
index 61a2f5ce..bf1650ea 100644
--- a/src/radeon_drm_queue.c
+++ b/src/radeon_drm_queue.c
@@ -257,8 +257,11 @@ radeon_drm_handle_event(int fd, drmEventContext *event_context)
 
     r = drmHandleEvent(fd, event_context);
 
-    xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_flip_signalled, list)
+    while (!xorg_list_is_empty(&radeon_drm_flip_signalled)) {
+	e = xorg_list_first_entry(&radeon_drm_flip_signalled,
+				  struct radeon_drm_queue_entry, list);
 	radeon_drm_queue_handle_one(e);
+    }
 
     xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_vblank_signalled, list) {
 	drmmode_crtc_private_ptr drmmode_crtc = e->crtc->driver_private;
@@ -277,12 +280,15 @@ void radeon_drm_wait_pending_flip(xf86CrtcPtr crtc)
 {
     drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
     RADEONEntPtr pRADEONEnt = RADEONEntPriv(crtc->scrn);
-    struct radeon_drm_queue_entry *e, *tmp;
+    struct radeon_drm_queue_entry *e;
 
     drmmode_crtc->wait_flip_nesting_level++;
 
-    xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_flip_signalled, list)
+    while (!xorg_list_is_empty(&radeon_drm_flip_signalled)) {
+	e = xorg_list_first_entry(&radeon_drm_flip_signalled,
+				  struct radeon_drm_queue_entry, list);
 	radeon_drm_queue_handle_one(e);
+    }
 
     while (drmmode_crtc->flip_pending
 	   && radeon_drm_handle_event(pRADEONEnt->fd,
commit 87b9a3e516d19dd1b89a64f6cac990fae53fc1b3
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Wed Sep 5 11:27:25 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.
    
    (Ported from amdgpu commit 7eea3e2cd74eed22e982319144e18ae5b1087b78)

diff --git a/src/radeon_drm_queue.c b/src/radeon_drm_queue.c
index 857278fd..61a2f5ce 100644
--- a/src/radeon_drm_queue.c
+++ b/src/radeon_drm_queue.c
@@ -82,7 +82,7 @@ radeon_drm_queue_handler(struct xorg_list *signalled, unsigned int frame,
     xorg_list_for_each_entry_safe(e, tmp, &radeon_drm_queue, list) {
 	if (e->seq == seq) {
 	    if (!e->handler) {
-		e->abort(e->crtc, e->data);
+		radeon_drm_queue_handle_one(e);
 		break;
 	    }
 


More information about the xorg-commit mailing list