libgralloc: Add Perform function to get the stride.
- Introduce a new class to Get the Adreno computed stride information.
This class has been added to allow adreno library computed strides to
be propagated to the allocation function as well as those clients
requesting it.
- Add a new Perform function to get the stride. The width and the format
can be passed from the calling functions (like EGL) to get the stride of
the buffer.
Change-Id: I4c2b4a02deff327f0ea5558c478997527fe9d3cf
diff --git a/libgralloc/mapper.cpp b/libgralloc/mapper.cpp
index 4f28877..27761be 100644
--- a/libgralloc/mapper.cpp
+++ b/libgralloc/mapper.cpp
@@ -369,6 +369,14 @@
res = 0;
}
break;
+ case GRALLOC_MODULE_PERFORM_GET_STRIDE:
+ {
+ int width = va_arg(args, int);
+ int format = va_arg(args, int);
+ int *stride = va_arg(args, int *);
+ *stride = AdrenoMemInfo::getInstance().getStride(width, format);
+ res = 0;
+ } break;
#endif
default:
break;