author | Pengcheng Chen <pengcheng.chen@amlogic.com> | 2017-04-18 04:56:40 (GMT) |
---|---|---|
committer | Pengcheng Chen <pengcheng.chen@amlogic.com> | 2017-04-18 07:32:10 (GMT) |
commit | 9d659f00be66e60d4fd3feb8c7e7fca7f02a6807 (patch) | |
tree | 816855496deec5d8af0c0694222fb5f3ef402146 | |
parent | 6b94eedc3833041103232d240da2f53a06d43bba (diff) | |
download | gralloc-9d659f00be66e60d4fd3feb8c7e7fca7f02a6807.zip gralloc-9d659f00be66e60d4fd3feb8c7e7fca7f02a6807.tar.gz gralloc-9d659f00be66e60d4fd3feb8c7e7fca7f02a6807.tar.bz2 |
PD#138714 gralloc: add FBIOGET_OSD_DMABUF for kernel 4.9 remove FBIOGET_DMABUF
Change-Id: I8bf17cc1d2dbfd6da405a540697afcb2214ad644
Signed-off-by: Pengcheng Chen <pengcheng.chen@amlogic.com>
-rw-r--r-- | alloc_ion.cpp | 18 | ||||
-rw-r--r-- | gralloc_priv.h | 1 |
2 files changed, 15 insertions, 4 deletions
diff --git a/alloc_ion.cpp b/alloc_ion.cpp index 0392f1d..a449bb0 100644 --- a/alloc_ion.cpp +++ b/alloc_ion.cpp @@ -230,13 +230,23 @@ int alloc_backend_alloc_framebuffer(private_module_t* m, private_handle_t* hnd, } else { - AINF("FBIOGET_DMABUF ioctl failed(%d). See gralloc_priv.h and the integration manual for vendor framebuffer integration", res); + AINF("FBIOGET_DMABUF ioctl failed(%d). try FBIOGET_OSD_DMABUF", res); + res = ioctl( m_fb->framebuffer->fd, FBIOGET_OSD_DMABUF, &fb_dma_buf ); + if (res == 0) + { + hnd->share_fd = fb_dma_buf.fd; + return 0; + } + else + { + AINF("FBIOGET_OSD_DMABUF ioctl failed(%d). See gralloc_priv.h and the integration manual for vendor framebuffer integration", res); #if MALI_ARCHITECTURE_UTGARD - /* On Utgard we do not have a strict requirement of DMA-BUF integration */ - return 0; + /* On Utgard we do not have a strict requirement of DMA-BUF integration */ + return 0; #else - return -1; + return -1; #endif + } } #else return 0; diff --git a/gralloc_priv.h b/gralloc_priv.h index b11eed2..7c09a3f 100644 --- a/gralloc_priv.h +++ b/gralloc_priv.h @@ -79,6 +79,7 @@ struct fb_dmabuf_export __u32 flags; }; #define FBIOGET_DMABUF _IOR('F', 0x21, struct fb_dmabuf_export) +#define FBIOGET_OSD_DMABUF 0x46fc #endif /* the max string size of GRALLOC_HARDWARE_GPU0 & GRALLOC_HARDWARE_FB0 |