summaryrefslogtreecommitdiff
path: root/hw/xfree86
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2019-07-15 14:35:49 +0200
committerHans de Goede <hdegoede@redhat.com>2019-08-09 10:50:55 +0200
commit12821852f0d82ecef686262382c84b2c1625a99f (patch)
tree8eacc98ed4e1cba97fb031bbe14370c4926b7d8f /hw/xfree86
parent078277e4d92f05a90c4715d61b89b9d9d38d68ea (diff)
modesetting: Avoid duplicate error messages on present-flip errors
Currently on present-flip failures we log 2 messages for each failure, 1 from ms_do_pageflip and then another one from ms_present_flip which is the caller of ms_do_pageflip. This commit adds a log_prefix argument to ms_do_pageflip so that its log messages can show if it is a DRI2 or a Present flip which fails and removes the redundant error message from ms_present_flip. 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/dri2.c3
-rw-r--r--hw/xfree86/drivers/modesetting/driver.h3
-rw-r--r--hw/xfree86/drivers/modesetting/pageflip.c12
-rw-r--r--hw/xfree86/drivers/modesetting/present.c10
4 files changed, 16 insertions, 12 deletions
diff --git a/hw/xfree86/drivers/modesetting/dri2.c b/hw/xfree86/drivers/modesetting/dri2.c
index 29ffc24da..e4d7cdd67 100644
--- a/hw/xfree86/drivers/modesetting/dri2.c
+++ b/hw/xfree86/drivers/modesetting/dri2.c
@@ -496,7 +496,8 @@ ms_dri2_schedule_flip(ms_dri2_frame_event_ptr info)
if (ms_do_pageflip(screen, back_priv->pixmap, event,
drmmode_crtc->vblank_pipe, FALSE,
ms_dri2_flip_handler,
- ms_dri2_flip_abort)) {
+ ms_dri2_flip_abort,
+ "DRI2-flip")) {
ms->drmmode.dri2_flipping = TRUE;
return TRUE;
}
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index da25a4c0e..7511de6d3 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -177,7 +177,8 @@ Bool ms_do_pageflip(ScreenPtr screen,
int ref_crtc_vblank_pipe,
Bool async,
ms_pageflip_handler_proc pageflip_handler,
- ms_pageflip_abort_proc pageflip_abort);
+ ms_pageflip_abort_proc pageflip_abort,
+ const char *log_prefix);
#endif
diff --git a/hw/xfree86/drivers/modesetting/pageflip.c b/hw/xfree86/drivers/modesetting/pageflip.c
index 9667f132d..88a2f687c 100644
--- a/hw/xfree86/drivers/modesetting/pageflip.c
+++ b/hw/xfree86/drivers/modesetting/pageflip.c
@@ -231,7 +231,8 @@ ms_do_pageflip(ScreenPtr screen,
int ref_crtc_vblank_pipe,
Bool async,
ms_pageflip_handler_proc pageflip_handler,
- ms_pageflip_abort_proc pageflip_abort)
+ ms_pageflip_abort_proc pageflip_abort,
+ const char *log_prefix)
{
#ifndef GLAMOR_HAS_GBM
return FALSE;
@@ -250,7 +251,8 @@ ms_do_pageflip(ScreenPtr screen,
if (!new_front_bo.gbm) {
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "Failed to get GBM bo for flip to new front.\n");
+ "%s: Failed to get GBM BO for flip to new front.\n",
+ log_prefix);
return FALSE;
}
@@ -258,7 +260,7 @@ ms_do_pageflip(ScreenPtr screen,
if (!flipdata) {
drmmode_bo_destroy(&ms->drmmode, &new_front_bo);
xf86DrvMsg(scrn->scrnIndex, X_ERROR,
- "Failed to allocate flipdata.\n");
+ "%s: Failed to allocate flipdata.\n", log_prefix);
return FALSE;
}
@@ -336,8 +338,8 @@ error_undo:
}
error_out:
- xf86DrvMsg(scrn->scrnIndex, X_WARNING, "Page flip failed: %s\n",
- strerror(errno));
+ xf86DrvMsg(scrn->scrnIndex, X_WARNING, "%s: Page flip failed: %s\n",
+ log_prefix, strerror(errno));
drmmode_bo_destroy(&ms->drmmode, &new_front_bo);
/* if only the local reference - free the structure,
* else drop the local reference and return */
diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index b87ba265f..7c4f0c43d 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -336,10 +336,9 @@ ms_present_flip(RRCrtcPtr crtc,
event->unflip = FALSE;
ret = ms_do_pageflip(screen, pixmap, event, drmmode_crtc->vblank_pipe, !sync_flip,
- ms_present_flip_handler, ms_present_flip_abort);
- if (!ret)
- xf86DrvMsg(scrn->scrnIndex, X_ERROR, "present flip failed\n");
- else
+ ms_present_flip_handler, ms_present_flip_abort,
+ "Present-flip");
+ if (ret)
ms->drmmode.present_flipping = TRUE;
return ret;
@@ -367,7 +366,8 @@ ms_present_unflip(ScreenPtr screen, uint64_t event_id)
if (ms_present_check_unflip(NULL, screen->root, pixmap, TRUE, NULL) &&
ms_do_pageflip(screen, pixmap, event, -1, FALSE,
- ms_present_flip_handler, ms_present_flip_abort)) {
+ ms_present_flip_handler, ms_present_flip_abort,
+ "Present-unflip")) {
return;
}