summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamkumar Radhakrishnan <ramkumar@codeaurora.org>2012-08-06 17:13:25 -0700
committerSteve Kondik <shade@chemlab.org>2012-08-16 10:56:49 -0700
commitfb756c481a7b309024c46cc8f50f0d84256355f2 (patch)
treed0841d24ef20960882674b160aa10c42f1d1c6b6
parentc7a8a0d8561a0c33a1f17e512a48a9e934a6bc17 (diff)
downloadhardware_libhardware-fb756c481a7b309024c46cc8f50f0d84256355f2.zip
hardware_libhardware-fb756c481a7b309024c46cc8f50f0d84256355f2.tar.gz
hardware_libhardware-fb756c481a7b309024c46cc8f50f0d84256355f2.tar.bz2
libhardware: Add allocSize hook function.
Add allocSize hook function to support the custom buffer sizes CRs-fixed: 379299 Change-Id: I676beeefbc0cd9437e728d2e30948349808abe99
-rw-r--r--include/hardware/gralloc.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/include/hardware/gralloc.h b/include/hardware/gralloc.h
index 2dbd1fa..0a68b52 100644
--- a/include/hardware/gralloc.h
+++ b/include/hardware/gralloc.h
@@ -207,6 +207,21 @@ typedef struct gralloc_module_t {
typedef struct alloc_device_t {
struct hw_device_t common;
+#ifdef QCOM_HARDWARE
+ /*
+ * (*allocSize)() Allocates a buffer in graphic memory with the requested
+ * bufferSize parameter and returns a buffer_handle_t and the stride in
+ * pixels to allow the implementation to satisfy hardware constraints on
+ * the width of a pixmap (eg: it may have to be multiple of 8 pixels).
+ * The CALLER TAKES OWNERSHIP of the buffer_handle_t.
+ *
+ * Returns 0 on success or -errno on error.
+ */
+ int (*allocSize)(struct alloc_device_t* dev,
+ int w, int h, int format, int usage,
+ buffer_handle_t* handle, int* stride, int bufferSize);
+#endif
+
/*
* (*alloc)() Allocates a buffer in graphic memory with the requested
* parameters and returns a buffer_handle_t and the stride in pixels to