summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYongqin Liu <yongqin.liu@linaro.org>2017-12-06 01:09:43 +0800
committerJohn Stultz <john.stultz@linaro.org>2018-03-30 11:05:54 -0700
commit6e403d08fb9f10f09c4f635988d4af09ca8431b1 (patch)
tree825da5343a2403d84e91826a2179b0fdff0f0aa9
parent21ad5be341701a645b69bf3292bcc7835673bc29 (diff)
downloadhikey-6e403d08fb9f10f09c4f635988d4af09ca8431b1.tar.gz
gralloc: add support for HAL_PIXEL_FORMAT_BLOB
so that we could have CtsNativeHardwareTestCases pass Test: manually cts with hikey Change-Id: Ia5b3fec3f11f3c0e94e4d5208bb9d04ef872e2ad Signed-off-by: Yongqin Liu <yongqin.liu@linaro.org>
-rw-r--r--gralloc/alloc_device.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/gralloc/alloc_device.cpp b/gralloc/alloc_device.cpp
index ddd41940..33c3a097 100644
--- a/gralloc/alloc_device.cpp
+++ b/gralloc/alloc_device.cpp
@@ -497,13 +497,26 @@ static int alloc_device_alloc(alloc_device_t *dev, int w, int h, int format, int
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;