mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "Revert "Call into validateBufferSize and getTransportSize"" into qt-dev
This commit is contained in:
@@ -34,48 +34,34 @@ 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(
|
Error getTransportSize(const native_handle_t* bufferHandle, uint32_t* outNumFds,
|
||||||
mModule, bufferHandle, descriptorInfo.width, descriptorInfo.height,
|
uint32_t* outNumInts) override {
|
||||||
static_cast<int32_t>(descriptorInfo.format),
|
// need a gralloc0 extension to get the transport size
|
||||||
static_cast<uint64_t>(descriptorInfo.usage), stride);
|
*outNumFds = bufferHandle->numFds;
|
||||||
return static_cast<Error>(ret);
|
*outNumInts = bufferHandle->numInts;
|
||||||
}
|
return Error::NONE;
|
||||||
Error getTransportSize(const native_handle_t* bufferHandle, uint32_t* outNumFds,
|
|
||||||
uint32_t* outNumInts) override {
|
|
||||||
if (!mModule->getTransportSize) {
|
|
||||||
*outNumFds = bufferHandle->numFds;
|
|
||||||
*outNumInts = bufferHandle->numInts;
|
|
||||||
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),
|
outDescriptor);
|
||||||
descriptorInfo.usage,
|
|
||||||
},
|
|
||||||
outDescriptor);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
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
|
||||||
|
|||||||
Reference in New Issue
Block a user