From 5a6ff3a367c8736fef6af23608866248c2fec43e Mon Sep 17 00:00:00 2001 From: koron393 Date: Tue, 7 May 2019 03:01:14 +0900 Subject: msm8974-common: libshim_camera: Apply revert patches to Marshmallow * Fix build. * Revert GraphicBuffer method to Marshmallow (for 23.5.A.1.291 blobs). * Apply module loading changes. * TODO: Remove unneeded sources. Change-Id: Ifce6a23840bd8c6170e0b8a714233d7b5e99acb4 --- libshims/include/ui/GraphicBuffer.h | 14 ++++++++++++-- libshims/include/ui/GraphicBufferAllocator.h | 4 +++- 2 files changed, 15 insertions(+), 3 deletions(-) (limited to 'libshims/include/ui') diff --git a/libshims/include/ui/GraphicBuffer.h b/libshims/include/ui/GraphicBuffer.h index cc38982..7b4fac8 100644 --- a/libshims/include/ui/GraphicBuffer.h +++ b/libshims/include/ui/GraphicBuffer.h @@ -31,6 +31,7 @@ #include #include +struct ANativeWindowBuffer; namespace android { @@ -126,13 +127,18 @@ public: // These functions are deprecated because they only take 32 bits of usage GraphicBuffer(const native_handle_t* handle, HandleWrapMethod method, uint32_t width, uint32_t height, - PixelFormat format, uint32_t layerCount, + PixelFormat format, uint32_t usage, uint32_t stride) : GraphicBuffer(handle, method, width, height, format, layerCount, static_cast(usage), stride) {} GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, - uint32_t inLayerCount, uint32_t inUsage, uint32_t inStride, + uint32_t inUsage, uint32_t inStride, native_handle_t* inHandle, bool keepOwnership); + GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, + uint32_t inUsage); + // create a buffer from an existing ANativeWindowBuffer + GraphicBuffer(ANativeWindowBuffer* buffer, bool keepOwnership); + GraphicBuffer(uint32_t inWidth, uint32_t inHeight, PixelFormat inFormat, uint32_t inUsage, std::string requestorName = ""); @@ -236,6 +242,10 @@ private: GraphicBufferMapper& mBufferMapper; ssize_t mInitCheck; + // If we're wrapping another buffer then this reference will make sure it + // doesn't get freed. + sp mWrappedBuffer; + // numbers of fds/ints in native_handle_t to flatten uint32_t mTransportNumFds; uint32_t mTransportNumInts; diff --git a/libshims/include/ui/GraphicBufferAllocator.h b/libshims/include/ui/GraphicBufferAllocator.h index 14a865e..546fb4b 100644 --- a/libshims/include/ui/GraphicBufferAllocator.h +++ b/libshims/include/ui/GraphicBufferAllocator.h @@ -32,6 +32,8 @@ #include #include +#include + namespace android { namespace Gralloc2 { @@ -75,7 +77,7 @@ private: GraphicBufferAllocator(); ~GraphicBufferAllocator(); - GraphicBufferMapper& mMapper; + alloc_device_t *mAllocDev; const std::unique_ptr mAllocator; }; -- cgit v1.2.3