1 #pragma once 2 3 #include <aidl/android/hardware/graphics/common/BufferUsage.h> 4 5 #include <cstdint> 6 7 namespace pixel::graphics { 8 9 using FrameworkUsage = aidl::android::hardware::graphics::common::BufferUsage; 10 11 #define MapUsage(f) f = static_cast<uint64_t>(FrameworkUsage::f) 12 13 enum Usage : uint64_t { 14 MapUsage(CPU_READ_MASK), 15 MapUsage(CPU_READ_NEVER), 16 MapUsage(CPU_READ_RARELY), 17 MapUsage(CPU_READ_OFTEN), 18 MapUsage(CPU_WRITE_MASK), 19 MapUsage(CPU_WRITE_NEVER), 20 MapUsage(CPU_WRITE_RARELY), 21 MapUsage(CPU_WRITE_OFTEN), 22 MapUsage(GPU_TEXTURE), 23 MapUsage(GPU_RENDER_TARGET), 24 MapUsage(COMPOSER_OVERLAY), 25 MapUsage(COMPOSER_CLIENT_TARGET), 26 MapUsage(PROTECTED), 27 MapUsage(COMPOSER_CURSOR), 28 MapUsage(VIDEO_ENCODER), 29 MapUsage(CAMERA_OUTPUT), 30 MapUsage(CAMERA_INPUT), 31 MapUsage(RENDERSCRIPT), 32 MapUsage(VIDEO_DECODER), 33 MapUsage(SENSOR_DIRECT_DATA), 34 MapUsage(GPU_DATA_BUFFER), 35 MapUsage(GPU_CUBE_MAP), 36 MapUsage(GPU_MIPMAP_COMPLETE), 37 MapUsage(HW_IMAGE_ENCODER), 38 MapUsage(FRONT_BUFFER), 39 MapUsage(VENDOR_MASK), 40 MapUsage(VENDOR_MASK_HI), 41 42 // Pixel specific usages 43 44 // Used for AION to allocate PLACEHOLDER buffers 45 PLACEHOLDER_BUFFER = 1ULL << 28, 46 47 NO_COMPRESSION = 1ULL << 29, 48 49 // Video IPs. These flags only make sense in combination with VIDEO_ENCODER/VIDEO_DECODER usage 50 // flags 51 MFC = 1ULL << 50, 52 BO = 1ULL << 51, 53 BW = BO, 54 55 // Used for the camera ISP image heap of the dual PD buffer. 56 TPU_INPUT = 1ULL << 62, 57 58 // Used to select specific heap for faceauth raw images used for evaluation 59 FACEAUTH_RAW_EVAL = 1ULL << 63, 60 }; 61 62 #undef MapUsage 63 64 } // namespace pixel::graphics 65