summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-08-14 21:19:10 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-08-14 21:19:10 +0100
commite461427ad3667554a01b5b74525a15d19538a8e5 (patch)
treee85091e1f5ffffaf64c930dd489a08b75581d070 /src
parent72ed21c694aecba1e91089479b2cb5f957548fec (diff)
sna: Add error message to explain modesetting failures due to allocation
Since this is an error path with a major user visible failure (the modeset fails), make sure that we log the reason. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_display.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 2cc8c426..e30984cf 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2066,8 +2066,11 @@ __sna_crtc_set_mode(xf86CrtcPtr crtc)
sna_crtc->fallback_shadow = false;
retry: /* Attach per-crtc pixmap or direct */
bo = sna_crtc_attach(crtc);
- if (bo == NULL)
- return FALSE;
+ if (bo == NULL) {
+ xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
+ "unable to attach scanout\n");
+ goto error;
+ }
kgem_bo_submit(&sna->kgem, bo);
@@ -2084,11 +2087,7 @@ retry: /* Attach per-crtc pixmap or direct */
xf86DrvMsg(crtc->scrn->scrnIndex, X_ERROR,
"failed to set mode: %s [%d]\n", strerror(err), err);
-
- sna_crtc->offset = saved_offset;
- sna_crtc->transform = saved_transform;
- sna_crtc->bo = saved_bo;
- return FALSE;
+ goto error;
}
bo->active_scanout++;
@@ -2106,6 +2105,12 @@ retry: /* Attach per-crtc pixmap or direct */
sna->mode.dirty = true;
return TRUE;
+
+error:
+ sna_crtc->offset = saved_offset;
+ sna_crtc->transform = saved_transform;
+ sna_crtc->bo = saved_bo;
+ return FALSE;
}
static Bool