summaryrefslogtreecommitdiffstats
path: root/gralloc_drm_intel.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_intel.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_intel.c')
-rw-r--r--gralloc_drm_intel.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/gralloc_drm_intel.c b/gralloc_drm_intel.c
index 6185fd4..2bf9524 100644
--- a/gralloc_drm_intel.c
+++ b/gralloc_drm_intel.c
@@ -309,6 +309,11 @@ static drm_intel_bo *alloc_ibo(struct intel_info *info,
return NULL;
}
+ 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) {
unsigned long max_stride;
@@ -319,8 +324,7 @@ static drm_intel_bo *alloc_ibo(struct intel_info *info,
max_stride /= 2;
name = "gralloc-fb";
- aligned_width = (handle->width + 63) & ~63;
- aligned_height = handle->height;
+ aligned_width = (aligned_width + 63) & ~63;
flags = BO_ALLOC_FOR_RENDER;
*tiling = I915_TILING_X;
@@ -368,13 +372,11 @@ static drm_intel_bo *alloc_ibo(struct intel_info *info,
if (handle->usage & GRALLOC_USAGE_HW_TEXTURE) {
name = "gralloc-texture";
/* see 2D texture layout of DRI drivers */
- aligned_width = (handle->width + 3) & ~3;
- aligned_height = (handle->height + 1) & ~1;
+ aligned_width = (aligned_width + 3) & ~3;
+ aligned_height = (aligned_height + 1) & ~1;
}
else {
name = "gralloc-buffer";
- aligned_width = handle->width;
- aligned_height = handle->height;
}
if (handle->usage & GRALLOC_USAGE_HW_RENDER)