summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-02-12 15:47:00 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2014-02-12 15:56:45 +0000
commitdda57f2e28e01ea254cb2aba9e0846b755c4175a (patch)
tree210caf9b2f63e613f54c00bcc67525116d664496 /tools
parent94e5ca3d5ab33c8e9b86a4f60c712da72df15b3d (diff)
intel-virtual-output: Fix checking for no change in output modes
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtual.c20
1 files changed, 17 insertions, 3 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index 5952186f..6fa1c998 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -475,6 +475,8 @@ static int clone_update_modes__randr(struct clone *clone)
if (to_info == NULL)
goto err;
+ DBG(("%s: dst.rr_crtc=%ld, now %ld\n",
+ __func__, (long)clone->dst.rr_crtc, (long)from_info->crtc));
if (clone->dst.rr_crtc == from_info->crtc) {
for (i = 0; i < to_info->nmode; i++) {
XRRModeInfo *mode, *old;
@@ -482,6 +484,11 @@ static int clone_update_modes__randr(struct clone *clone)
mode = lookup_mode(to_res, to_info->modes[i]);
if (mode == NULL)
break;
+
+ DBG(("%s(%s-%s): lookup mode %s\n", __func__,
+ DisplayString(clone->src.dpy), clone->src.name,
+ mode->name));
+
for (j = 0; j < from_info->nmode; j++) {
old = lookup_mode(from_res, from_info->modes[j]);
if (old && mode_equal(mode, old)) {
@@ -489,8 +496,12 @@ static int clone_update_modes__randr(struct clone *clone)
break;
}
}
- if (mode)
+ if (mode) {
+ DBG(("%s(%s-%s): unknown mode %s\n", __func__,
+ DisplayString(clone->src.dpy), clone->src.name,
+ mode->name));
break;
+ }
}
if (i == from_info->nmode && i == to_info->nmode) {
DBG(("%s(%s-%s): no change in output\n", __func__,
@@ -982,7 +993,7 @@ static int context_update(struct context *ctx)
changed |= output->y != c->y;
output->y = c->y;
- changed |= output->mode.id != mode;
+ changed |= output->mode.id != c->mode;
mode = c->mode;
XRRFreeCrtcInfo(c);
} else {
@@ -993,6 +1004,9 @@ static int context_update(struct context *ctx)
output->rr_crtc = o->crtc;
XRRFreeOutputInfo(o);
+ DBG(("%s-%s crtc changed? %d\n",
+ DisplayString(ctx->clones[n].dst.display->dpy), ctx->clones[n].dst.name, changed));
+
if (mode) {
if (output->mode.id != mode) {
for (i = 0; i < res->nmode; i++) {
@@ -1007,7 +1021,7 @@ static int context_update(struct context *ctx)
output->mode.id = 0;
}
- DBG(("%s-%s changed? %d\n",
+ DBG(("%s-%s output changed? %d\n",
DisplayString(ctx->clones[n].dst.display->dpy), ctx->clones[n].dst.name, changed));
if (changed)