gfxstream: conditionally compile magma in Meson build
libdrm doesn't exist on all platforms. Fix this and conditionally
compile Magma until multi-platform Magma can be achieved.
BUG=299991018
TEST=meson -Ddecoders=gles,vulkan,composer amd64-build/
ninja -C amd64-build/
Change-Id: I08d17ef20bd3fed021fe32df9222db941f5485a4
diff --git a/host/RenderThread.cpp b/host/RenderThread.cpp
index ffddb50..489a340 100644
--- a/host/RenderThread.cpp
+++ b/host/RenderThread.cpp
@@ -298,7 +298,9 @@
tInfo.m_vkInfo.emplace();
}
+#if USE_MAGMA
tInfo.m_magmaInfo.emplace(mContextId);
+#endif
// This is the only place where we try loading from snapshot.
// But the context bind / restoration will be delayed after receiving
@@ -554,6 +556,7 @@
// try to process some of the command buffer using the Magma
// decoder
//
+#if USE_MAGMA
if (tInfo.m_magmaInfo && tInfo.m_magmaInfo->mMagmaDec)
{
last = tInfo.m_magmaInfo->mMagmaDec->decode(readBuf.buf(), readBuf.validData(),
@@ -563,6 +566,7 @@
progress = true;
}
}
+#endif
if (mRunInLimitedMode) {
sThreadRunLimiter.unlock();
diff --git a/host/RenderThreadInfo.h b/host/RenderThreadInfo.h
index 95c8444..341b0a2 100644
--- a/host/RenderThreadInfo.h
+++ b/host/RenderThreadInfo.h
@@ -23,9 +23,12 @@
#include "aemu/base/files/Stream.h"
#include "renderControl_dec/renderControl_dec.h"
#include "RenderThreadInfoGl.h"
-#include "RenderThreadInfoMagma.h"
#include "RenderThreadInfoVk.h"
+#if USE_MAGMA
+#include "RenderThreadInfoMagma.h"
+#endif
+
namespace gfxstream {
// A class used to model the state of each RenderThread related
@@ -54,7 +57,10 @@
std::optional<gl::RenderThreadInfoGl> m_glInfo;
std::optional<vk::RenderThreadInfoVk> m_vkInfo;
+
+#if USE_MAGMA
std::optional<RenderThreadInfoMagma> m_magmaInfo;
+#endif
// Whether this thread was used to perform composition.
bool m_isCompositionThread = false;