Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d1a2a84e authored by Valerie Hau's avatar Valerie Hau Committed by android-build-merger
Browse files

Merge "Revert "Call into validateBufferSize and getTransportSize"" into qt-dev am: a7904cd3

am: c04e71b8

Change-Id: If8b2475a1033ffd271a1634d89f756c5db607e92
parents edbd0867 c04e71b8
Loading
Loading
Loading
Loading
+17 −31
Original line number Original line Diff line number Diff line
@@ -34,40 +34,27 @@ using V2_0::Error;
template <typename Hal>
template <typename Hal>
class Gralloc0HalImpl : public V2_0::passthrough::detail::Gralloc0HalImpl<Hal> {
class Gralloc0HalImpl : public V2_0::passthrough::detail::Gralloc0HalImpl<Hal> {
   public:
   public:
     Error validateBufferSize(const native_handle_t* bufferHandle,
    Error validateBufferSize(const native_handle_t* /*bufferHandle*/,
                              const IMapper::BufferDescriptorInfo& descriptorInfo,
                             const IMapper::BufferDescriptorInfo& /*descriptorInfo*/,
                              uint32_t stride) override {
                             uint32_t /*stride*/) override {
         if (!mModule->validateBufferSize) {
        // need a gralloc0 extension to really validate
        return Error::NONE;
        return Error::NONE;
    }
    }


         int32_t ret = mModule->validateBufferSize(
                 mModule, bufferHandle, descriptorInfo.width, descriptorInfo.height,
                 static_cast<int32_t>(descriptorInfo.format),
                 static_cast<uint64_t>(descriptorInfo.usage), stride);
         return static_cast<Error>(ret);
     }
    Error getTransportSize(const native_handle_t* bufferHandle, uint32_t* outNumFds,
    Error getTransportSize(const native_handle_t* bufferHandle, uint32_t* outNumFds,
                           uint32_t* outNumInts) override {
                           uint32_t* outNumInts) override {
         if (!mModule->getTransportSize) {
        // need a gralloc0 extension to get the transport size
        *outNumFds = bufferHandle->numFds;
        *outNumFds = bufferHandle->numFds;
        *outNumInts = bufferHandle->numInts;
        *outNumInts = bufferHandle->numInts;
        return Error::NONE;
        return Error::NONE;
    }
    }


         int32_t ret = mModule->getTransportSize(mModule, bufferHandle, outNumFds, outNumInts);
         return static_cast<Error>(ret);
    }

    Error createDescriptor_2_1(const IMapper::BufferDescriptorInfo& descriptorInfo,
    Error createDescriptor_2_1(const IMapper::BufferDescriptorInfo& descriptorInfo,
                               BufferDescriptor* outDescriptor) override {
                               BufferDescriptor* outDescriptor) override {
        return createDescriptor(
        return createDescriptor(
            V2_0::IMapper::BufferDescriptorInfo{
            V2_0::IMapper::BufferDescriptorInfo{
                        descriptorInfo.width,
                descriptorInfo.width, descriptorInfo.height, descriptorInfo.layerCount,
                        descriptorInfo.height,
                static_cast<common::V1_0::PixelFormat>(descriptorInfo.format), descriptorInfo.usage,
                        descriptorInfo.layerCount,
                        static_cast<common::V1_0::PixelFormat>(descriptorInfo.format),
                        descriptorInfo.usage,
            },
            },
            outDescriptor);
            outDescriptor);
    }
    }
@@ -75,7 +62,6 @@ class Gralloc0HalImpl : public V2_0::passthrough::detail::Gralloc0HalImpl<Hal> {
   private:
   private:
    using BaseType2_0 = V2_0::passthrough::detail::Gralloc0HalImpl<Hal>;
    using BaseType2_0 = V2_0::passthrough::detail::Gralloc0HalImpl<Hal>;
    using BaseType2_0::createDescriptor;
    using BaseType2_0::createDescriptor;
    using BaseType2_0::mModule;
};
};


}  // namespace detail
}  // namespace detail