diff options
author | Sumit Semwal <sumit.semwal@linaro.org> | 2017-12-07 23:00:49 +0530 |
---|---|---|
committer | John Stultz <john.stultz@linaro.org> | 2017-12-08 15:25:49 -0800 |
commit | 4f9a685b0a6d7791bddae2e59a0e3975c595f4d5 (patch) | |
tree | a991057ced0fc661c6e3084e95d64975a23096c4 /gralloc960/gralloc_module_ion.cpp | |
parent | 75f4cc26aa9a8d721b52d4286235c0ad881cacba (diff) | |
download | hikey-4f9a685b0a6d7791bddae2e59a0e3975c595f4d5.tar.gz |
hikey: gralloc960 Update for new ION interface
4.12+ kernels have an updated ION interface; this adapts hikey's gralloc
to work seemlessly with both old and new kernels' interfaces.
Currently supports only system heaps.
Change-Id: Ice26d05f65bb4dfcc5ce2ae3bbcbbab4e9a3723a
Signed-off-by: Sumit Semwal <sumit.semwal@linaro.org>
[jstultz: Build fixes]
Signed-off-by: John Stultz <john.stultz@linaro.org>
Diffstat (limited to 'gralloc960/gralloc_module_ion.cpp')
-rw-r--r-- | gralloc960/gralloc_module_ion.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/gralloc960/gralloc_module_ion.cpp b/gralloc960/gralloc_module_ion.cpp index d91902c8..9d3c4c8e 100644 --- a/gralloc960/gralloc_module_ion.cpp +++ b/gralloc960/gralloc_module_ion.cpp @@ -27,6 +27,7 @@ #include "gralloc_priv.h" #include "alloc_device.h" #include "framebuffer_device.h" +#include "ion_4.12.h" #include <linux/ion.h> #include <ion/ion.h> @@ -110,13 +111,15 @@ void gralloc_backend_sync(private_handle_t* hnd) { case private_handle_t::PRIV_FLAGS_USES_ION: hw_module_t * pmodule = NULL; - private_module_t *m=NULL; if (hw_get_module(GRALLOC_HARDWARE_MODULE_ID, (const hw_module_t **)&pmodule) == 0) { - if(!(hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION_DMA_HEAP)) + private_module_t *m = reinterpret_cast<private_module_t *>(pmodule); + if (m->gralloc_legacy_ion) { - m = reinterpret_cast<private_module_t *>(pmodule); - ion_sync_fd(m->ion_client, hnd->share_fd); + if(!(hnd->flags & private_handle_t::PRIV_FLAGS_USES_ION_DMA_HEAP)) + { + ion_sync_fd(m->ion_client, hnd->share_fd); + } } } else |