diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-25 15:33:13 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-25 15:33:13 +0000 |
commit | 98efd7f5d94586f8d7c5b2e9c5515f4b37149b08 (patch) | |
tree | 1767d2e718fd1baec721373825939fc309cf1c8c /src/sna/sna_display_fake.c | |
parent | 42f325a87c336211ebb3ebcafc9130eff10cee93 (diff) |
sna: Log mode switches on virtual outputs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_display_fake.c')
-rw-r--r-- | src/sna/sna_display_fake.c | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c index 29426b76..8d24af0f 100644 --- a/src/sna/sna_display_fake.c +++ b/src/sna/sna_display_fake.c @@ -38,10 +38,48 @@ sna_crtc_dpms(xf86CrtcPtr crtc, int mode) { } +static char *outputs_for_crtc(xf86CrtcPtr crtc, char *outputs, int max) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + int len, i; + + for (i = len = 0; i < config->num_output; i++) { + xf86OutputPtr output = config->output[i]; + + if (output->crtc != crtc) + continue; + + len += snprintf(outputs+len, max-len, "%s, ", output->name); + } + assert(len >= 2); + outputs[len-2] = '\0'; + + return outputs; +} + +static const char *rotation_to_str(Rotation rotation) +{ + switch (rotation) { + case RR_Rotate_0: return "normal"; + case RR_Rotate_90: return "right"; + case RR_Rotate_180: return "inverted"; + case RR_Rotate_270: return "left"; + default: return "unknown"; + } +} + static Bool sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) { + char outputs[256]; + + xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO, + "switch to mode %dx%d on %s, position (%d, %d), rotation %s\n", + mode->HDisplay, mode->VDisplay, + outputs_for_crtc(crtc, outputs, sizeof(outputs)), + x, y, rotation_to_str(rotation)); + return TRUE; } |