Add gralloc flags to support HW driver

We were not setting the right gralloc flags with
USAGE_IO_INPUT.  This CL allows the driver to add flags
and always sets the RS bit.


Change-Id: I1807bc071da201923b6e0e714d7ab49ff0d2ef51

Conflicts:
	rsAllocation.cpp
diff --git a/rsGrallocConsumer.cpp b/rsGrallocConsumer.cpp
index ea333cc..7850277 100644
--- a/rsGrallocConsumer.cpp
+++ b/rsGrallocConsumer.cpp
@@ -30,11 +30,16 @@
 namespace android {
 namespace renderscript {
 
-GrallocConsumer::GrallocConsumer(Allocation *a, const sp<IGraphicBufferConsumer>& bq) :
+GrallocConsumer::GrallocConsumer(Allocation *a, const sp<IGraphicBufferConsumer>& bq, int flags) :
     ConsumerBase(bq, true)
 {
     mAlloc = a;
-    mConsumer->setConsumerUsageBits(GRALLOC_USAGE_SW_READ_OFTEN);
+    if (flags == 0) {
+        flags = GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_RENDERSCRIPT;
+    } else {
+        flags |= GRALLOC_USAGE_RENDERSCRIPT;
+    }
+    mConsumer->setConsumerUsageBits(flags);
     mConsumer->setMaxAcquiredBufferCount(2);
 
     uint32_t y = a->mHal.drvState.lod[0].dimY;