Padding before aligning adds 15 unneeded lines. Also check that the
extra line is needed (i.e., the alignment didn't add padding of its
own).
Change-Id: Iefbf5f26d8f346ba487195a5973693ae871f843f
Signed-off-by: Greg Hackmann <ghackmann@google.com>
return -EINVAL;
}
bpr = ALIGN(w*bpp, 16);
- vstride = ALIGN(h+1, 16);
- size = bpr * vstride;
+ vstride = ALIGN(h, 16);
+ if (vstride == h)
+ size = bpr * (vstride + 1);
+ else
+ size = bpr * vstride;
*stride = bpr / bpp;
size = ALIGN(size, PAGE_SIZE);