Don't destroy current FB if drmModeAddFB fails

It would probably result in a black screen.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
Michel Dänzer
2017-02-07 18:43:56 +09:00
committed by Michel Dänzer
parent 481394e3c9
commit 1351e48efe

View File

@@ -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;
}