Lines Matching refs:usage

184 bool CpuCanAccess(uint64_t usage) {  in CpuCanAccess()  argument
185 return CpuCanRead(usage) || CpuCanWrite(usage); in CpuCanAccess()
188 bool CpuCanRead(uint64_t usage) { in CpuCanRead() argument
189 if (usage & BufferUsage::CPU_READ_MASK) { in CpuCanRead()
196 bool CpuCanWrite(uint64_t usage) { in CpuCanWrite() argument
197 if (usage & BufferUsage::CPU_WRITE_MASK) { in CpuCanWrite()
205 uint32_t GetDataAlignment(int format, uint64_t usage) { in GetDataAlignment() argument
211 if (usage & BufferUsage::PROTECTED) { in GetDataAlignment()
212 if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) { in GetDataAlignment()
222 bool IsGPUFlagSupported(uint64_t usage) { in IsGPUFlagSupported() argument
224 if ((usage & BufferUsage::GPU_MIPMAP_COMPLETE)) { in IsGPUFlagSupported()
229 if ((usage & BufferUsage::GPU_CUBE_MAP)) { in IsGPUFlagSupported()
269 uint64_t usage = info.usage; in GetSize() local
271 if (!IsGPUFlagSupported(usage)) { in GetSize()
272 ALOGE("Unsupported GPU usage flags present 0x%" PRIx64, usage); in GetSize()
276 if (IsUBwcEnabled(format, usage)) { in GetSize()
365 auto align = GetDataAlignment(format, usage); in GetSize()
379 if (CanUseAdrenoForSize(buffer_type, info.usage)) { in GetBufferSizeAndDimensions()
457 uint64_t usage = hnd->usage; in GetYUVPlaneInfo() local
472 BufferInfo info(buffer_dim.sliceWidth, buffer_dim.sliceHeight, format, usage); in GetYUVPlaneInfo()
614 bool IsUBwcPISupported(int format, uint64_t usage) { in IsUBwcPISupported() argument
615 if (usage & BufferUsage::COMPOSER_OVERLAY || !(usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI)) { in IsUBwcPISupported()
623 if ((usage & BufferUsage::GPU_TEXTURE) || (usage & BufferUsage::GPU_RENDER_TARGET)) { in IsUBwcPISupported()
625 return AdrenoMemInfo::GetInstance()->IsPISupportedByGPU(format, usage); in IsUBwcPISupported()
636 bool IsUBwcEnabled(int format, uint64_t usage) { in IsUBwcEnabled() argument
645 if (((usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC) || in IsUBwcEnabled()
646 (usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI) || in IsUBwcEnabled()
647 (usage & BufferUsage::COMPOSER_CLIENT_TARGET)) in IsUBwcEnabled()
651 if ((usage & BufferUsage::GPU_TEXTURE) || (usage & BufferUsage::GPU_RENDER_TARGET)) { in IsUBwcEnabled()
658 if (enable && !(CpuCanAccess(usage))) { in IsUBwcEnabled()
857 uint64_t usage = info.usage; in GetAlignedWidthAndHeight() local
860 bool ubwc_enabled = IsUBwcEnabled(format, usage); in GetAlignedWidthAndHeight()
1061 uint64_t adreno_usage = info.usage; in GetGpuResourceSizeAndDimensions()
1064 int is_ubwc_enabled = IsUBwcEnabled(info.format, info.usage); in GetGpuResourceSizeAndDimensions()
1088 bool CanUseAdrenoForSize(int buffer_type, uint64_t usage) { in CanUseAdrenoForSize() argument
1093 if ((usage & BufferUsage::PROTECTED) && ((usage & BufferUsage::CAMERA_OUTPUT) || in CanUseAdrenoForSize()
1094 (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY))) { in CanUseAdrenoForSize()
1109 bool UseUncached(int format, uint64_t usage) { in UseUncached() argument
1110 if ((usage & GRALLOC_USAGE_PRIVATE_UNCACHED) || (usage & BufferUsage::PROTECTED)) { in UseUncached()
1115 if ((usage & BufferUsage::CPU_READ_MASK) == static_cast<uint64_t>(BufferUsage::CPU_READ_RARELY)) { in UseUncached()
1120 if ((usage & BufferUsage::CPU_WRITE_MASK) == in UseUncached()
1125 if ((usage & BufferUsage::SENSOR_DIRECT_DATA) || (usage & BufferUsage::GPU_DATA_BUFFER)) { in UseUncached()
1129 if (format && IsUBwcEnabled(format, usage)) { in UseUncached()
1136 uint64_t GetHandleFlags(int format, uint64_t usage) { in GetHandleFlags() argument
1139 if (usage & BufferUsage::VIDEO_ENCODER) { in GetHandleFlags()
1143 if (usage & BufferUsage::CAMERA_OUTPUT) { in GetHandleFlags()
1147 if (usage & BufferUsage::CAMERA_INPUT) { in GetHandleFlags()
1151 if (usage & BufferUsage::COMPOSER_OVERLAY) { in GetHandleFlags()
1155 if (usage & BufferUsage::GPU_TEXTURE) { in GetHandleFlags()
1159 if (usage & GRALLOC_USAGE_PRIVATE_SECURE_DISPLAY) { in GetHandleFlags()
1163 if (IsUBwcEnabled(format, usage)) { in GetHandleFlags()
1164 if (IsUBwcPISupported(format, usage)) { in GetHandleFlags()
1171 if (usage & (BufferUsage::CPU_READ_MASK | BufferUsage::CPU_WRITE_MASK)) { in GetHandleFlags()
1175 if ((usage & (BufferUsage::VIDEO_ENCODER | BufferUsage::VIDEO_DECODER | in GetHandleFlags()
1180 if (!UseUncached(format, usage)) { in GetHandleFlags()
1187 int GetImplDefinedFormat(uint64_t usage, int format) { in GetImplDefinedFormat() argument
1194 if ((usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC || usage & GRALLOC_USAGE_PRIVATE_ALLOC_UBWC_PI) in GetImplDefinedFormat()
1197 } else if (usage & BufferUsage::VIDEO_ENCODER) { in GetImplDefinedFormat()
1198 if (usage & GRALLOC_USAGE_PRIVATE_VIDEO_NV21_ENCODER) { in GetImplDefinedFormat()
1200 } else if (usage & GRALLOC_USAGE_PRIVATE_HEIF) { in GetImplDefinedFormat()
1207 } else if (usage & BufferUsage::CAMERA_INPUT) { in GetImplDefinedFormat()
1208 if (usage & BufferUsage::CAMERA_OUTPUT) { in GetImplDefinedFormat()
1214 } else if (usage & BufferUsage::CAMERA_OUTPUT) { in GetImplDefinedFormat()
1220 } else if (usage & BufferUsage::COMPOSER_OVERLAY) { in GetImplDefinedFormat()
1233 int GetCustomFormatFlags(int format, uint64_t usage, in GetCustomFormatFlags() argument
1235 *custom_format = GetImplDefinedFormat(usage, format); in GetCustomFormatFlags()
1236 *priv_flags = GetHandleFlags(*custom_format, usage); in GetCustomFormatFlags()
1238 if (usage & GRALLOC_USAGE_PROTECTED) { in GetCustomFormatFlags()