diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-25 16:49:58 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-11-25 16:49:58 +0000 |
commit | ded23af3cdf68ab94446b8774d6bc4d52b21907a (patch) | |
tree | fed1f4b0cdf07de8ea5ef96491a5879a2c4cb90b | |
parent | 5fa1b0a2c5e5d3e7f25bca5b79925a956253a24f (diff) |
sna: Include reflections when logging mode changes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/sna_display.c | 22 | ||||
-rw-r--r-- | src/sna/sna_display_fake.c | 22 |
2 files changed, 34 insertions, 10 deletions
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 3cf669d1..165b9e91 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -1474,15 +1474,27 @@ static char *outputs_for_crtc(xf86CrtcPtr crtc, char *outputs, int max) static const char *rotation_to_str(Rotation rotation) { - switch (rotation) { + switch (rotation & RR_Rotate_All) { + case 0: case RR_Rotate_0: return "normal"; - case RR_Rotate_90: return "right"; + case RR_Rotate_90: return "left"; case RR_Rotate_180: return "inverted"; - case RR_Rotate_270: return "left"; + case RR_Rotate_270: return "right"; default: return "unknown"; } } +static const char *reflection_to_str(Rotation rotation) +{ + switch (rotation & RR_Reflect_All) { + case 0: return "none"; + case RR_Reflect_X: return "X axis"; + case RR_Reflect_Y: return "Y axis"; + case RR_Reflect_X | RR_Reflect_Y: return "X and Y axis"; + default: return "invalid"; + } +} + static Bool sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) @@ -1499,10 +1511,10 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, return FALSE; xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO, - "switch to mode %dx%d@%.1f on %s using pipe %d, position (%d, %d), rotation %s\n", + "switch to mode %dx%d@%.1f on %s using pipe %d, position (%d, %d), rotation %s, reflection %s\n", mode->HDisplay, mode->VDisplay, xf86ModeVRefresh(mode), outputs_for_crtc(crtc, outputs, sizeof(outputs)), sna_crtc->pipe, - x, y, rotation_to_str(rotation)); + x, y, rotation_to_str(rotation), reflection_to_str(rotation)); assert(mode->HDisplay <= sna->mode.kmode->max_width && mode->VDisplay <= sna->mode.kmode->max_height); diff --git a/src/sna/sna_display_fake.c b/src/sna/sna_display_fake.c index 8d24af0f..cecedaaa 100644 --- a/src/sna/sna_display_fake.c +++ b/src/sna/sna_display_fake.c @@ -59,15 +59,27 @@ static char *outputs_for_crtc(xf86CrtcPtr crtc, char *outputs, int max) static const char *rotation_to_str(Rotation rotation) { - switch (rotation) { + switch (rotation & RR_Rotate_All) { + case 0: case RR_Rotate_0: return "normal"; - case RR_Rotate_90: return "right"; + case RR_Rotate_90: return "left"; case RR_Rotate_180: return "inverted"; - case RR_Rotate_270: return "left"; + case RR_Rotate_270: return "right"; default: return "unknown"; } } +static const char *reflection_to_str(Rotation rotation) +{ + switch (rotation & RR_Reflect_All) { + case 0: return "none"; + case RR_Reflect_X: return "X axis"; + case RR_Reflect_Y: return "Y axis"; + case RR_Reflect_X | RR_Reflect_Y: return "X and Y axis"; + default: return "invalid"; + } +} + static Bool sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotation, int x, int y) @@ -75,10 +87,10 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode, char outputs[256]; xf86DrvMsg(crtc->scrn->scrnIndex, X_INFO, - "switch to mode %dx%d on %s, position (%d, %d), rotation %s\n", + "switch to mode %dx%d on %s, position (%d, %d), rotation %s, reflection %s\n", mode->HDisplay, mode->VDisplay, outputs_for_crtc(crtc, outputs, sizeof(outputs)), - x, y, rotation_to_str(rotation)); + x, y, rotation_to_str(rotation), reflection_to_str(rotation)); return TRUE; } |