gralloc: add support for HAL_PIXEL_FORMAT_BLOB am: b67bb8126a am: 63b05fc690
am: fa39cd7c8d
Change-Id: I2b8928480d75d6d9ec27a47da810243091381f35
diff --git a/gralloc/alloc_device.cpp b/gralloc/alloc_device.cpp
index d1377ff..89202ef 100644
--- a/gralloc/alloc_device.cpp
+++ b/gralloc/alloc_device.cpp
@@ -446,13 +446,26 @@
bpp = 2;
break;
+ case HAL_PIXEL_FORMAT_BLOB:
+ if (h != 1) {
+ AERR("Height for HAL_PIXEL_FORMAT_BLOB must be 1. h=%d", h);
+ return -EINVAL;
+ }
+ break;
+
default:
+ AERR("The format is not supported yet: format=%d\n", format);
return -EINVAL;
}
- size_t bpr = GRALLOC_ALIGN(w * bpp, 64);
- size = bpr * h;
- stride = bpr / bpp;
+ if (format == HAL_PIXEL_FORMAT_BLOB) {
+ stride = 0; /* No 'rows', it's effectively a long one dimensional array */
+ size = w;
+ }else{
+ size_t bpr = GRALLOC_ALIGN(w * bpp, 64);
+ size = bpr * h;
+ stride = bpr / bpp;
+ }
}
int err;