diff --git a/src/gfxstream/guest/android/GrallocEmulated.cpp b/src/gfxstream/guest/android/GrallocEmulated.cpp index 101a68169ae..5f93d7cba79 100644 --- a/src/gfxstream/guest/android/GrallocEmulated.cpp +++ b/src/gfxstream/guest/android/GrallocEmulated.cpp @@ -414,6 +414,8 @@ EmulatedGralloc::~EmulatedGralloc() { delete mDevice; } +GrallocType EmulatedGralloc::getGrallocType() { return GRALLOC_TYPE_EMULATED; } + uint32_t EmulatedGralloc::createColorBuffer(void*, int width, int height, uint32_t glFormat) { auto drmFormat = GlFormatToDrmFormat(glFormat); if (!drmFormat) { diff --git a/src/gfxstream/guest/android/GrallocEmulated.h b/src/gfxstream/guest/android/GrallocEmulated.h index 686510cf513..70a5f5019fb 100644 --- a/src/gfxstream/guest/android/GrallocEmulated.h +++ b/src/gfxstream/guest/android/GrallocEmulated.h @@ -67,6 +67,8 @@ class EmulatedGralloc : public Gralloc { public: EmulatedGralloc(VirtGpuDevice* device); ~EmulatedGralloc(); + + GrallocType getGrallocType() override; uint32_t createColorBuffer(void*, int width, int height, uint32_t glFormat) override; int allocate(uint32_t width, uint32_t height, uint32_t format, uint64_t usage, diff --git a/src/gfxstream/guest/android/GrallocGoldfish.cpp b/src/gfxstream/guest/android/GrallocGoldfish.cpp index 6962ab4c108..723279590a9 100644 --- a/src/gfxstream/guest/android/GrallocGoldfish.cpp +++ b/src/gfxstream/guest/android/GrallocGoldfish.cpp @@ -26,6 +26,8 @@ uint32_t GoldfishGralloc::createColorBuffer(void* rcEnc, int width, int height, return rc->rcCreateColorBuffer(rc, width, height, glformat); } +GrallocType GoldfishGralloc::getGrallocType() { return GRALLOC_TYPE_GOLDFISH; } + int GoldfishGralloc::allocate(uint32_t width, uint32_t height, uint32_t format, uint64_t usage, AHardwareBuffer** outputAhb) { struct AHardwareBuffer_Desc desc = { diff --git a/src/gfxstream/guest/android/GrallocGoldfish.h b/src/gfxstream/guest/android/GrallocGoldfish.h index 2c83afcadfe..508fc49b73a 100644 --- a/src/gfxstream/guest/android/GrallocGoldfish.h +++ b/src/gfxstream/guest/android/GrallocGoldfish.h @@ -20,6 +20,7 @@ namespace gfxstream { class GoldfishGralloc : public Gralloc { public: + GrallocType getGrallocType() override; uint32_t createColorBuffer(void* rcEnc, int width, int height, uint32_t glformat) override; int allocate(uint32_t width, uint32_t height, uint32_t format, uint64_t usage, diff --git a/src/gfxstream/guest/android/GrallocMinigbm.cpp b/src/gfxstream/guest/android/GrallocMinigbm.cpp index be62a2bc206..979c7e76028 100644 --- a/src/gfxstream/guest/android/GrallocMinigbm.cpp +++ b/src/gfxstream/guest/android/GrallocMinigbm.cpp @@ -112,6 +112,8 @@ bool getVirtioGpuResourceInfo(int fd, native_handle_t const* handle, } // namespace +GrallocType MinigbmGralloc::getGrallocType() { return GRALLOC_TYPE_MINIGBM; } + uint32_t MinigbmGralloc::createColorBuffer(void*, int width, int height, uint32_t glformat) { // Only supported format for pbuffers in gfxstream should be RGBA8 const uint32_t kVirglFormatRGBA = 67; // VIRGL_FORMAT_R8G8B8A8_UNORM; diff --git a/src/gfxstream/guest/android/GrallocMinigbm.h b/src/gfxstream/guest/android/GrallocMinigbm.h index 2542d0d3c41..1abd5ab7e01 100644 --- a/src/gfxstream/guest/android/GrallocMinigbm.h +++ b/src/gfxstream/guest/android/GrallocMinigbm.h @@ -20,6 +20,8 @@ namespace gfxstream { class MinigbmGralloc : public Gralloc { public: + GrallocType getGrallocType() override; + uint32_t createColorBuffer(void* rcEnc, int width, int height, uint32_t glformat) override; int allocate(uint32_t width, uint32_t height, uint32_t format, uint64_t usage,