From b65a3f83ccf8d17cea46fe5af1bc348ad5d4467f Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 27 Oct 2011 18:01:23 +0800 Subject: add support for YUV formats --- gralloc_drm_intel.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'gralloc_drm_intel.c') 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) -- cgit v1.1