Commit c69b37e8 authored by Hans de Goede's avatar Hans de Goede
Browse files

modesetting: Only log 1 error for consecutive flip failures

Only log 1 error for consecutive flip failures, instead of filling the
log and the disk with errors for each attempted flip.

Despite our best efforts we may end up with a BO which gets refused
when we try to import it as a framebuffer, see e.g. :
https://bugs.freedesktop.org/show_bug.cgi?id=111306
This should not happen, but as the above bugs shows sometimes it does
and chances are it will happen again.

Note ideally we should check if the import is possible at
ms_present_check_flip time, like the amdgpu code is doing since:
xorg/driver/xf86-video-amdgpu!35


but that requires a chunk of refactoring work on the modesetting driver,
so for now this will have to do.
Reviewed-by: Michel Dänzer's avatarMichel Dänzer <michel.daenzer@amd.com>
Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
parent 3dc838f7
......@@ -123,6 +123,7 @@ typedef struct {
Bool dri2_flipping;
Bool present_flipping;
Bool flip_bo_import_failed;
Bool dri2_enable;
Bool present_enable;
......
......@@ -285,9 +285,16 @@ ms_do_pageflip(ScreenPtr screen,
new_front_bo.height = new_front->drawable.height;
if (drmmode_bo_import(&ms->drmmode, &new_front_bo,
&ms->drmmode.fb_id)) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: Import BO failed: %s\n",
log_prefix, strerror(errno));
if (!ms->drmmode.flip_bo_import_failed) {
xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: Import BO failed: %s\n",
log_prefix, strerror(errno));
ms->drmmode.flip_bo_import_failed = TRUE;
}
goto error_out;
} else {
if (ms->drmmode.flip_bo_import_failed &&
new_front != screen->GetScreenPixmap(screen))
ms->drmmode.flip_bo_import_failed = FALSE;
}
flags = DRM_MODE_PAGE_FLIP_EVENT;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment