diff options
author | Simon Shields <keepcalm444@gmail.com> | 2016-04-15 22:44:30 +1000 |
---|---|---|
committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2016-04-15 10:10:36 -0700 |
commit | 05326f499d5ce79a04eb58fdc2a5de80be34ace5 (patch) | |
tree | f891f56068bac1092d32807817a42df2d24dd5c3 | |
parent | fb599edb50596b5e79b295caa52fdcc131e972b5 (diff) | |
download | android_hardware_samsung-05326f499d5ce79a04eb58fdc2a5de80be34ace5.tar.gz android_hardware_samsung-05326f499d5ce79a04eb58fdc2a5de80be34ace5.tar.bz2 android_hardware_samsung-05326f499d5ce79a04eb58fdc2a5de80be34ace5.zip |
exynos4: gralloc: we have an ALIGN macro, use it
Change-Id: I1ef089b004d1d1e3f2ae525638954536ca881c7a
-rw-r--r-- | exynos4/hal/libgralloc_ump/alloc_device.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/exynos4/hal/libgralloc_ump/alloc_device.cpp b/exynos4/hal/libgralloc_ump/alloc_device.cpp index 467e6f7..9c9c7b4 100644 --- a/exynos4/hal/libgralloc_ump/alloc_device.cpp +++ b/exynos4/hal/libgralloc_ump/alloc_device.cpp @@ -372,8 +372,8 @@ static int alloc_device_alloc(alloc_device_t* dev, int w, int h, int format, format == OMX_COLOR_FormatYUV420SemiPlanar) { /* FIXME: there is no way to return the vstride */ int vstride; - stride = (w + 15) & ~15; - vstride = (h + 15) & ~15; + stride = EXYNOS4_ALIGN(w, 16); + vstride = EXYNOS4_ALIGN(h, 16); switch (format) { case HAL_PIXEL_FORMAT_YCbCr_420_SP: case HAL_PIXEL_FORMAT_YCbCr_420_SP_TILED: @@ -403,7 +403,6 @@ static int alloc_device_alloc(alloc_device_t* dev, int w, int h, int format, return -EINVAL; } } else { - int align = 8; int bpp = 0; switch (format) { case HAL_PIXEL_FORMAT_RGBA_8888: @@ -422,7 +421,7 @@ static int alloc_device_alloc(alloc_device_t* dev, int w, int h, int format, default: return -EINVAL; } - size_t bpr = (w*bpp + (align-1)) & ~(align-1); + size_t bpr = EXYNOS4_ALIGN((w*bpp), 8); size = bpr * h; stride = bpr / bpp; stride_raw = bpr; |