xf86-video-intel: 2 commits - src/sna/sna_display.c src/sna/sna_display_fake.c tools/virtual.c
Chris Wilson
ickle at kemper.freedesktop.org
Mon Nov 25 08:57:46 PST 2013
src/sna/sna_display.c | 22 +++++++++++++++++-----
src/sna/sna_display_fake.c | 22 +++++++++++++++++-----
tools/virtual.c | 35 ++++++++++++++++++++++++++++++++---
3 files changed, 66 insertions(+), 13 deletions(-)
New commits:
commit 5580df729f4d3b2498a6dae19dac938f06bf602d
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Nov 25 16:55:47 2013 +0000
intel-virtual-output: Include transforms when computing required fb size
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=71846
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/tools/virtual.c b/tools/virtual.c
index 54550f9..4e1eca4 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -861,6 +861,34 @@ static void clone_update(struct clone *clone)
clone->rr_update = 0;
}
+static int mode_height(const XRRModeInfo *mode, Rotation rotation)
+{
+ switch (rotation & 0xf) {
+ case RR_Rotate_0:
+ case RR_Rotate_180:
+ return mode->height;
+ case RR_Rotate_90:
+ case RR_Rotate_270:
+ return mode->width;
+ default:
+ return 0;
+ }
+}
+
+static int mode_width(const XRRModeInfo *mode, Rotation rotation)
+{
+ switch (rotation & 0xf) {
+ case RR_Rotate_0:
+ case RR_Rotate_180:
+ return mode->width;
+ case RR_Rotate_90:
+ case RR_Rotate_270:
+ return mode->height;
+ default:
+ return 0;
+ }
+}
+
static int context_update(struct context *ctx)
{
Display *dpy = ctx->display->dpy;
@@ -971,17 +999,18 @@ static int context_update(struct context *ctx)
DBG(("%s: source %s enabled (%d, %d)x(%d, %d)\n",
DisplayString(clone->dst.dpy), output->name,
output->x, output->y,
- output->mode.width, output->mode.height));
+ mode_width(&output->mode, output->rotation),
+ mode_height(&output->mode, output->rotation)));
if (output->x < x1)
x1 = output->x;
if (output->y < y1)
y1 = output->y;
- v = (int)output->x + output->mode.width;
+ v = (int)output->x + mode_width(&output->mode, output->rotation);
if (v > x2)
x2 = v;
- v = (int)output->y + output->mode.height;
+ v = (int)output->y + mode_height(&output->mode, output->rotation);
if (v > y2)
y2 = v;
}
commit ded23af3cdf68ab94446b8774d6bc4d52b21907a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Mon Nov 25 16:49:58 2013 +0000
sna: Include reflections when logging mode changes
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 3cf669d..165b9e9 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 8d24af0..cecedaa 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;
}
More information about the xorg-commit
mailing list