summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2019-08-08 21:56:59 +0200
committerHans de Goede <hdegoede@redhat.com>2019-08-09 10:51:12 +0200
commitc69b37e8da87c9f76dbf4add7340a77ea443c760 (patch)
treeecc08a8b1350c806c9c7eed521e40b909280b21b /hw/xfree86
parent3dc838f77d9a9417adf6a03cc82aa4e9337153a7 (diff)
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: https://gitlab.freedesktop.org/xorg/driver/xf86-video-amdgpu/merge_requests/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 <michel.daenzer@amd.com> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'hw/xfree86')
-rw-r--r--hw/xfree86/drivers/modesetting/drmmode_display.h1
-rw-r--r--hw/xfree86/drivers/modesetting/pageflip.c11
2 files changed, 10 insertions, 2 deletions
diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.h b/hw/xfree86/drivers/modesetting/drmmode_display.h
index 75c3195e4..2711a5776 100644
--- a/hw/xfree86/drivers/modesetting/drmmode_display.h
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.h
@@ -123,6 +123,7 @@ typedef struct {
Bool dri2_flipping;
Bool present_flipping;
+ Bool flip_bo_import_failed;
Bool dri2_enable;
Bool present_enable;
diff --git a/hw/xfree86/drivers/modesetting/pageflip.c b/hw/xfree86/drivers/modesetting/pageflip.c
index 830ec7599..cb11bd4f9 100644
--- a/hw/xfree86/drivers/modesetting/pageflip.c
+++ b/hw/xfree86/drivers/modesetting/pageflip.c
@@ -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;