gralloc: add support for HAL_PIXEL_FORMAT_BLOB
am: 6e403d08fb
Change-Id: I540f0e446ebd6cb458d183fd587428bf61274bb1
diff --git a/gralloc/alloc_device.cpp b/gralloc/alloc_device.cpp
index ddd4194..33c3a09 100644
--- a/gralloc/alloc_device.cpp
+++ b/gralloc/alloc_device.cpp
@@ -497,13 +497,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;