From 028412faa7bb1d276e1dcdbe485c920acf73a719 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Sat, 31 Aug 2013 20:58:48 +0100 Subject: [PATCH] intel-virtual-output: Third time lucky for computing the correct stride? Aligning a 16-bpp image to a 32-byte boundary is tricky, apparently. Or at least I make it look so. Signed-off-by: Chris Wilson --- tools/virtual.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/virtual.c b/tools/virtual.c index 00342c9e..acd7eabc 100644 --- a/tools/virtual.c +++ b/tools/virtual.c @@ -513,7 +513,7 @@ static int stride_for_depth(int width, int depth) { if (depth == 24) depth = 32; - return (width * depth + 31) / 8; + return ((width * depth + 7) / 8 + 3) & ~3; } static void init_image(struct clone *clone)