mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2025-12-26 14:40:12 +01:00
drm: Refactor some debug statements
These have the same form, and we're about to add a few more with the same form again, so make a helper function. This sweeps up the one weird one that printed [view] while failing [state]. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
87776413ba
commit
57ad320d86
1 changed files with 22 additions and 12 deletions
|
|
@ -860,6 +860,23 @@ lower_solid_views_to_background_region(struct drm_output *output,
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
debug_propose_fail(struct drm_output *output,
|
||||||
|
enum drm_output_propose_state_mode mode,
|
||||||
|
const char *reason)
|
||||||
|
{
|
||||||
|
struct drm_device *device = output->device;
|
||||||
|
struct drm_backend *b = device->backend;
|
||||||
|
const char *mode_str = drm_propose_state_mode_to_string(mode);
|
||||||
|
|
||||||
|
drm_debug(b, "\t\t[state] cannot propose %s "
|
||||||
|
"for output %s (%lu): %s\n",
|
||||||
|
mode_str,
|
||||||
|
output->base.name,
|
||||||
|
(unsigned long) output->base.id,
|
||||||
|
reason);
|
||||||
|
}
|
||||||
|
|
||||||
static struct drm_output_state *
|
static struct drm_output_state *
|
||||||
drm_output_propose_state(struct weston_output *output_base,
|
drm_output_propose_state(struct weston_output *output_base,
|
||||||
struct drm_pending_state *pending_state,
|
struct drm_pending_state *pending_state,
|
||||||
|
|
@ -916,22 +933,16 @@ drm_output_propose_state(struct weston_output *output_base,
|
||||||
(scanout_fb->type != BUFFER_GBM_SURFACE &&
|
(scanout_fb->type != BUFFER_GBM_SURFACE &&
|
||||||
scanout_fb->type != BUFFER_PIXMAN_DUMB &&
|
scanout_fb->type != BUFFER_PIXMAN_DUMB &&
|
||||||
scanout_fb->type != BUFFER_DMABUF_BACKEND)) {
|
scanout_fb->type != BUFFER_DMABUF_BACKEND)) {
|
||||||
drm_debug(b, "\t\t[state] cannot propose mixed mode: "
|
debug_propose_fail(output, mode,
|
||||||
"for output %s (%lu): no previous renderer "
|
"no previous renderer fb");
|
||||||
"fb\n",
|
|
||||||
output->base.name,
|
|
||||||
(unsigned long) output->base.id);
|
|
||||||
drm_output_state_free(state);
|
drm_output_state_free(state);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (scanout_fb->width != output_base->current_mode->width ||
|
if (scanout_fb->width != output_base->current_mode->width ||
|
||||||
scanout_fb->height != output_base->current_mode->height) {
|
scanout_fb->height != output_base->current_mode->height) {
|
||||||
drm_debug(b, "\t\t[state] cannot propose mixed mode "
|
debug_propose_fail(output, mode,
|
||||||
"for output %s (%lu): previous fb has "
|
"previous fb has different size");
|
||||||
"different size\n",
|
|
||||||
output->base.name,
|
|
||||||
(unsigned long) output->base.id);
|
|
||||||
drm_output_state_free(state);
|
drm_output_state_free(state);
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
@ -1158,8 +1169,7 @@ drm_output_propose_state(struct weston_output *output_base,
|
||||||
/* Check to see if this state will actually work. */
|
/* Check to see if this state will actually work. */
|
||||||
ret = drm_pending_state_test(state->pending_state);
|
ret = drm_pending_state_test(state->pending_state);
|
||||||
if (ret != 0) {
|
if (ret != 0) {
|
||||||
drm_debug(b, "\t\t[view] failing state generation: "
|
debug_propose_fail(output, mode, "atomic test not OK");
|
||||||
"atomic test not OK\n");
|
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue