[PATCH xf86-video-amdgpu 3/6] Don't destroy current FB if drmModeAddFB fails

Michel Dänzer michel at daenzer.net
Thu Mar 2 09:17:57 UTC 2017


From: Michel Dänzer <michel.daenzer at amd.com>

It would probably result in a black screen.

(Ported from radeon commit 1351e48efe7a2c28eab447e16f36a00fbd02ae48)

Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>
---
 src/drmmode_display.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/src/drmmode_display.c b/src/drmmode_display.c
index bc7b9c33..463759b9 100644
--- a/src/drmmode_display.c
+++ b/src/drmmode_display.c
@@ -2679,7 +2679,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(pAMDGPUEnt->fd, drmmode->fb_id);
 		drmmode->fb_id = flipdata->old_fb_id;
 	}
-- 
2.11.0



More information about the amd-gfx mailing list