summaryrefslogtreecommitdiffstats
path: root/gralloc_drm_radeon.c
diff options
context:
space:
mode:
authorChia-I Wu <olvaffe@gmail.com>2011-10-27 18:01:23 +0800
committerChia-I Wu <olvaffe@gmail.com>2011-10-27 18:40:45 +0800
commitb65a3f83ccf8d17cea46fe5af1bc348ad5d4467f (patch)
treecee2a030ca46c2c485703d98452c21f4574ab83b /gralloc_drm_radeon.c
parent51966409ebae46df92720a0658090771e399be4f (diff)
downloadexternal_drm_gralloc-b65a3f83ccf8d17cea46fe5af1bc348ad5d4467f.zip
external_drm_gralloc-b65a3f83ccf8d17cea46fe5af1bc348ad5d4467f.tar.gz
external_drm_gralloc-b65a3f83ccf8d17cea46fe5af1bc348ad5d4467f.tar.bz2
add support for YUV formats
Diffstat (limited to 'gralloc_drm_radeon.c')
-rw-r--r--gralloc_drm_radeon.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gralloc_drm_radeon.c b/gralloc_drm_radeon.c
index c8cfb8c..8d27bf9 100644
--- a/gralloc_drm_radeon.c
+++ b/gralloc_drm_radeon.c
@@ -201,16 +201,17 @@ static struct radeon_bo *radeon_alloc(struct radeon_info *info,
tiling = radeon_get_tiling(info, handle);
domain = RADEON_GEM_DOMAIN_VRAM;
+ aligned_width = handle->width;
+ aligned_height = handle->height;
+ gralloc_drm_align_geometry(handle->format,
+ &aligned_width, &aligned_height);
+
if (handle->usage & (GRALLOC_USAGE_HW_FB | GRALLOC_USAGE_HW_TEXTURE)) {
- aligned_width = ALIGN(handle->width,
+ aligned_width = ALIGN(aligned_width,
radeon_get_pitch_align(info, cpp, tiling));
- aligned_height = ALIGN(handle->height,
+ aligned_height = ALIGN(aligned_height,
radeon_get_height_align(info, tiling));
}
- else {
- aligned_width = handle->width;
- aligned_height = handle->height;
- }
if (!(handle->usage & (GRALLOC_USAGE_HW_FB |
GRALLOC_USAGE_HW_RENDER)) &&