summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-25 15:33:13 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-25 15:33:13 +0000
commit98efd7f5d94586f8d7c5b2e9c5515f4b37149b08 (patch)
tree1767d2e718fd1baec721373825939fc309cf1c8c
parent42f325a87c336211ebb3ebcafc9130eff10cee93 (diff)
sna: Log mode switches on virtual outputs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/sna_display.c5
-rw-r--r--src/sna/sna_display_fake.c38
2 files changed, 40 insertions, 3 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 8982d6a4..3cf669d1 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -1499,10 +1499,9 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
return FALSE;
xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO,
- "switch to mode %dx%d@%.1f on pipe %d using %s, position (%d, %d), rotation %s\n",
+ "switch to mode %dx%d@%.1f on %s using pipe %d, position (%d, %d), rotation %s\n",
mode->HDisplay, mode->VDisplay, xf86ModeVRefresh(mode),
- sna_crtc->pipe,
- outputs_for_crtc(crtc, outputs, sizeof(outputs)),
+ outputs_for_crtc(crtc, outputs, sizeof(outputs)), sna_crtc->pipe,
x, y, rotation_to_str(rotation));
assert(mode->HDisplay <= sna->mode.kmode->max_width &&
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;
}