summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Herring <robherring2@gmail.com>2016-10-25 16:52:01 -0500
committerGitHub <noreply@github.com>2016-10-25 16:52:01 -0500
commit78e8025473ceed0317ca1a065df66c105d778643 (patch)
tree3efcf37b72709abb573487438895d2f3bc0b4a26
parentc51c10f68da33a0cee0f6db3145e371b33bed163 (diff)
parent7c5db467ba9385c36a65f3180e1b2b74a0373374 (diff)
downloadgbm_gralloc-78e8025473ceed0317ca1a065df66c105d778643.tar.gz
gbm_gralloc-78e8025473ceed0317ca1a065df66c105d778643.tar.xz
Merge pull request #2 from robertfoss/master
GRALLOC_MODULE_PERFORM_GET_USAGE stub and compiler warning fix
-rw-r--r--gralloc.cpp11
-rw-r--r--gralloc_drm.h7
2 files changed, 17 insertions, 1 deletions
diff --git a/gralloc.cpp b/gralloc.cpp
index 809862d..d8f2abd 100644
--- a/gralloc.cpp
+++ b/gralloc.cpp
@@ -99,13 +99,14 @@ static int gbm_mod_perform(const struct gralloc_module_t *mod, int op, ...)
struct gbm_module_t *dmod = (struct gbm_module_t *) mod;
va_list args;
int err;
+ uint32_t uop = static_cast<uint32_t>(op);
err = gbm_init(dmod);
if (err)
return err;
va_start(args, op);
- switch (op) {
+ switch (uop) {
case GRALLOC_MODULE_PERFORM_GET_DRM_FD:
{
int *fd = va_arg(args, int *);
@@ -113,6 +114,14 @@ static int gbm_mod_perform(const struct gralloc_module_t *mod, int op, ...)
err = 0;
}
break;
+ /* TODO: This is a stub and should be implemented fully */
+ case GRALLOC_MODULE_PERFORM_GET_USAGE:
+ {
+ int *buffer_usage = va_arg(args, int *);
+ *buffer_usage = 0;
+ err = 0;
+ }
+ break;
default:
err = -EINVAL;
break;
diff --git a/gralloc_drm.h b/gralloc_drm.h
index e4b528f..4ba7d7b 100644
--- a/gralloc_drm.h
+++ b/gralloc_drm.h
@@ -30,6 +30,13 @@ extern "C" {
enum {
GRALLOC_MODULE_PERFORM_GET_DRM_FD = 0x40000002,
+
+ /* perform(const struct gralloc_module_t *mod,
+ * int op,
+ * buffer_handle_t buffer,
+ * int *usage);
+ */
+ GRALLOC_MODULE_PERFORM_GET_USAGE = 0xffeeff03,
};
#ifdef __cplusplus