diff options
author | Tapani Pälli <tapani.palli@intel.com> | 2013-04-22 08:20:39 +0300 |
---|---|---|
committer | Tapani Pälli <tapani.palli@intel.com> | 2013-05-03 09:38:41 +0300 |
commit | df57ea903b701669b315a48311c1535f64f5d37a (patch) | |
tree | 418a913a9393066ae0b68fa3fff5513c8728a5ec /gralloc_drm.h | |
parent | 0bf69ed26eaffe5bbf58b9548063144c96e8ac64 (diff) | |
download | external_drm_gralloc-df57ea903b701669b315a48311c1535f64f5d37a.zip external_drm_gralloc-df57ea903b701669b315a48311c1535f64f5d37a.tar.gz external_drm_gralloc-df57ea903b701669b315a48311c1535f64f5d37a.tar.bz2 |
gralloc: cleanup, use ALIGN macro
Change-Id: I029aafe5a99393a4c0f7ff87f422317621fada12
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Diffstat (limited to 'gralloc_drm.h')
-rw-r--r-- | gralloc_drm.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gralloc_drm.h b/gralloc_drm.h index 8554cf7..4694185 100644 --- a/gralloc_drm.h +++ b/gralloc_drm.h @@ -31,6 +31,8 @@ extern "C" { #endif +#define ALIGN(val, align) (((val) + (align) - 1) & ~((align) - 1)) + struct gralloc_drm_t; struct gralloc_drm_bo_t; @@ -109,8 +111,8 @@ static inline void gralloc_drm_align_geometry(int format, int *width, int *heigh break; } - *width = (*width + align_w - 1) & ~(align_w - 1); - *height = (*height + align_h - 1) & ~(align_h - 1); + *width = ALIGN(*width, align_w); + *height = ALIGN(*height, align_h); if (extra_height_div) *height += *height / extra_height_div; |