Loading libs/nativewindow/AHardwareBuffer.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -509,10 +509,6 @@ bool AHardwareBuffer_isValidDescription(const AHardwareBuffer_Desc* desc, bool l ALOGE_IF(log, "AHARDWAREBUFFER_USAGE_SENSOR_DIRECT_DATA requires AHARDWAREBUFFER_FORMAT_BLOB"); return false; } if (desc->usage & AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER) { ALOGE_IF(log, "AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER requires AHARDWAREBUFFER_FORMAT_BLOB"); return false; } } if ((desc->usage & (AHARDWAREBUFFER_USAGE_CPU_READ_MASK | AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK)) && Loading libs/ui/Gralloc2.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,15 @@ status_t Gralloc2Mapper::validateBufferDescriptorInfo( descriptorInfo->usage & ~validUsageBits); return BAD_VALUE; } // Gralloc2 implementations never understand non-BLOB with GPU_DATA_BUFFER // and do not reliably reject it. if (descriptorInfo->usage & BufferUsage::GPU_DATA_BUFFER && descriptorInfo->format != hardware::graphics::common::V1_1::PixelFormat::BLOB) { ALOGE("gralloc2 does not support non-BLOB pixel formats with GPU_DATA_BUFFER usage"); return BAD_VALUE; } return NO_ERROR; } Loading libs/ui/Gralloc3.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,15 @@ status_t Gralloc3Mapper::validateBufferDescriptorInfo( descriptorInfo->usage & ~validUsageBits); return BAD_VALUE; } // Gralloc3 implementations never understand non-BLOB with GPU_DATA_BUFFER // and do not reliably reject it. if (descriptorInfo->usage & BufferUsage::GPU_DATA_BUFFER && descriptorInfo->format != hardware::graphics::common::V1_2::PixelFormat::BLOB) { ALOGE("gralloc3 does not support non-BLOB pixel formats with GPU_DATA_BUFFER usage"); return BAD_VALUE; } return NO_ERROR; } Loading libs/ui/Gralloc4.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ using aidl::android::hardware::graphics::common::StandardMetadataType; using android::hardware::hidl_vec; using android::hardware::graphics::allocator::V4_0::IAllocator; using android::hardware::graphics::common::V1_2::BufferUsage; using android::hardware::graphics::common::V1_2::PixelFormat; using android::hardware::graphics::mapper::V4_0::BufferDescriptor; using android::hardware::graphics::mapper::V4_0::Error; using android::hardware::graphics::mapper::V4_0::IMapper; Loading Loading @@ -120,6 +121,16 @@ static status_t validateBufferDescriptorInfo(IMapper::BufferDescriptorInfo* desc descriptorInfo->usage & ~validUsageBits); return BAD_VALUE; } // Combinations that are only allowed with gralloc 4.1. // Previous grallocs must be protected from this. if (!hasIAllocatorAidl() && descriptorInfo->format != hardware::graphics::common::V1_2::PixelFormat::BLOB && descriptorInfo->usage & BufferUsage::GPU_DATA_BUFFER) { ALOGE("non-BLOB pixel format with GPU_DATA_BUFFER usage is not supported prior to gralloc 4.1"); return BAD_VALUE; } return NO_ERROR; } Loading Loading
libs/nativewindow/AHardwareBuffer.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -509,10 +509,6 @@ bool AHardwareBuffer_isValidDescription(const AHardwareBuffer_Desc* desc, bool l ALOGE_IF(log, "AHARDWAREBUFFER_USAGE_SENSOR_DIRECT_DATA requires AHARDWAREBUFFER_FORMAT_BLOB"); return false; } if (desc->usage & AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER) { ALOGE_IF(log, "AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER requires AHARDWAREBUFFER_FORMAT_BLOB"); return false; } } if ((desc->usage & (AHARDWAREBUFFER_USAGE_CPU_READ_MASK | AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK)) && Loading
libs/ui/Gralloc2.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -110,6 +110,15 @@ status_t Gralloc2Mapper::validateBufferDescriptorInfo( descriptorInfo->usage & ~validUsageBits); return BAD_VALUE; } // Gralloc2 implementations never understand non-BLOB with GPU_DATA_BUFFER // and do not reliably reject it. if (descriptorInfo->usage & BufferUsage::GPU_DATA_BUFFER && descriptorInfo->format != hardware::graphics::common::V1_1::PixelFormat::BLOB) { ALOGE("gralloc2 does not support non-BLOB pixel formats with GPU_DATA_BUFFER usage"); return BAD_VALUE; } return NO_ERROR; } Loading
libs/ui/Gralloc3.cpp +9 −0 Original line number Diff line number Diff line Loading @@ -101,6 +101,15 @@ status_t Gralloc3Mapper::validateBufferDescriptorInfo( descriptorInfo->usage & ~validUsageBits); return BAD_VALUE; } // Gralloc3 implementations never understand non-BLOB with GPU_DATA_BUFFER // and do not reliably reject it. if (descriptorInfo->usage & BufferUsage::GPU_DATA_BUFFER && descriptorInfo->format != hardware::graphics::common::V1_2::PixelFormat::BLOB) { ALOGE("gralloc3 does not support non-BLOB pixel formats with GPU_DATA_BUFFER usage"); return BAD_VALUE; } return NO_ERROR; } Loading
libs/ui/Gralloc4.cpp +11 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,7 @@ using aidl::android::hardware::graphics::common::StandardMetadataType; using android::hardware::hidl_vec; using android::hardware::graphics::allocator::V4_0::IAllocator; using android::hardware::graphics::common::V1_2::BufferUsage; using android::hardware::graphics::common::V1_2::PixelFormat; using android::hardware::graphics::mapper::V4_0::BufferDescriptor; using android::hardware::graphics::mapper::V4_0::Error; using android::hardware::graphics::mapper::V4_0::IMapper; Loading Loading @@ -120,6 +121,16 @@ static status_t validateBufferDescriptorInfo(IMapper::BufferDescriptorInfo* desc descriptorInfo->usage & ~validUsageBits); return BAD_VALUE; } // Combinations that are only allowed with gralloc 4.1. // Previous grallocs must be protected from this. if (!hasIAllocatorAidl() && descriptorInfo->format != hardware::graphics::common::V1_2::PixelFormat::BLOB && descriptorInfo->usage & BufferUsage::GPU_DATA_BUFFER) { ALOGE("non-BLOB pixel format with GPU_DATA_BUFFER usage is not supported prior to gralloc 4.1"); return BAD_VALUE; } return NO_ERROR; } Loading