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

Michel Dänzer daenzer at kemper.freedesktop.org
Wed Feb 8 07:31:44 UTC 2017


 src/drmmode_display.c |    7 +++++--
 src/radeon_dri2.c     |    4 ++--
 2 files changed, 7 insertions(+), 4 deletions(-)

New commits:
commit 1351e48efe7a2c28eab447e16f36a00fbd02ae48
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Tue Feb 7 18:43:56 2017 +0900

    Don't destroy current FB if drmModeAddFB fails
    
    It would probably result in a black screen.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 9f78720..2258e7a 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2895,7 +2895,8 @@ flip_error:
 		   strerror(errno));
 
 error:
-	if (flipdata && flipdata->flip_count <= 1) {
+	if (flipdata && flipdata->flip_count <= 1 &&
+	    drmmode->fb_id != flipdata->old_fb_id) {
 		drmModeRmFB(drmmode->fd, drmmode->fb_id);
 		drmmode->fb_id = flipdata->old_fb_id;
 	}
commit 481394e3c9f9f7d88bb66fe9ae8834c87952a8ab
Author: Michel Dänzer <michel.daenzer at amd.com>
Date:   Tue Feb 7 18:39:05 2017 +0900

    Fix flip event data leak if calloc or drmModeAddFB fails
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index 0fb0d77..9f78720 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2904,8 +2904,10 @@ error:
 		radeon_drm_abort_entry(drm_queue_seq);
 	else if (crtc)
 		drmmode_flip_abort(crtc, flipdata);
-	else if (flipdata && flipdata->flip_count <= 1)
+	else {
+		abort(NULL, data);
 		free(flipdata);
+	}
 
 	xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n",
 		   strerror(errno));
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c
index 860ff29..d0dcf89 100644
--- a/src/radeon_dri2.c
+++ b/src/radeon_dri2.c
@@ -579,9 +579,9 @@ xf86CrtcPtr radeon_dri2_drawable_crtc(DrawablePtr pDraw, Bool consider_disabled)
 static void
 radeon_dri2_flip_event_abort(xf86CrtcPtr crtc, void *event_data)
 {
-    RADEONInfoPtr info = RADEONPTR(crtc->scrn);
+    if (crtc)
+	RADEONPTR(crtc->scrn)->drmmode.dri2_flipping = FALSE;
 
-    info->drmmode.dri2_flipping = FALSE;
     free(event_data);
 }
 


More information about the xorg-commit mailing list