summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-11-08 13:53:48 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-11-08 13:53:48 +0000
commitfa40286e2f12a4757d1b9bcbe1f1d7c5170bd7da (patch)
tree0b037ecabd632b7125c810f80df5bd2b9c932aaa /tools
parent83c33a1f436c947ab3d9289a9c57d92f964e9541 (diff)
intel-virtual-output: Tighten bad_visual() checks
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools')
-rw-r--r--tools/virtual.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/virtual.c b/tools/virtual.c
index b03a14db..8049d2f2 100644
--- a/tools/virtual.c
+++ b/tools/virtual.c
@@ -1475,24 +1475,29 @@ static int record_mouse(struct context *ctx)
static int bad_visual(Visual *visual, int depth)
{
- DBG(("%s? depth=%d, visual: bits_per_rgb=%d, red_mask=%08x, green_mask=%08x, blue_mask=%08\n",
+ DBG(("%s? depth=%d, visual: class=%d, bits_per_rgb=%d, red_mask=%08x, green_mask=%08x, blue_mask=%08x\n",
__func__, depth,
+ visual->class,
visual->bits_per_rgb,
visual->red_mask,
visual->green_mask,
visual->blue_mask));
+
+ if (!(visual->class == TrueColor || visual->class == DirectColor))
+ return 1;
+
switch (depth) {
- case 16: return (visual->bits_per_rgb != 6 ||
+ case 16: return (/* visual->bits_per_rgb != 6 || */
visual->red_mask != 0x1f << 11 ||
visual->green_mask != 0x3f << 5 ||
visual->blue_mask != 0x1f << 0);
- case 24: return (visual->bits_per_rgb != 8 ||
+ case 24: return (/* visual->bits_per_rgb != 8 || */
visual->red_mask != 0xff << 16 ||
visual->green_mask != 0xff << 8 ||
visual->blue_mask != 0xff << 0);
- default: return 0;
+ default: return 1;
}
}