Implement query in Linux_InitContext
Change-Id: I88c36211005d03189517762d2384931347fcffab
diff --git a/media_driver/linux/common/os/mos_os_specific.c b/media_driver/linux/common/os/mos_os_specific.c
index d730a61..2a0d691 100644
--- a/media_driver/linux/common/os/mos_os_specific.c
+++ b/media_driver/linux/common/os/mos_os_specific.c
@@ -65,6 +65,10 @@
#include "memory_policy_manager.h"
+#if defined(USE_MAGMA)
+#include "magma_fd.h"
+#endif
+
//!
//! \brief DRM VMAP patch
//!
@@ -1453,7 +1457,7 @@
}
}
-#if !defined(ANDROID) && !defined(__Fuchsia__)
+#if !defined(ANDROID)
{
drm_i915_getparam_t gp;
int32_t ret = -1;
@@ -1468,7 +1472,17 @@
eStatus = MOS_STATUS_INVALID_PARAMETER;
goto finish;
}
+#if defined(USE_MAGMA)
+ {
+ uint32_t unsigned_value;
+ if (query_magma_fd(pContext->fd, gp.param, &unsigned_value)) {
+ ret = 0;
+ value = unsigned_value;
+ }
+ }
+#else
ret = drmIoctl(pContext->fd, DRM_IOCTL_I915_GETPARAM, &gp);
+#endif
if (ret == 0 && value != 0)
{
pContext->bKMDHasVCS2 = true;
@@ -1483,9 +1497,6 @@
eStatus = CreateIPC(pContext);
MOS_CHK_STATUS_SAFE(eStatus);
}
-#else
- //TODO(fxbug.dev/78281) - remove
- fprintf(stderr, "%s:%d Linux_InitContext not implemented\n", __FILE__, __LINE__);
#endif
pContext->pTranscryptedKernels = nullptr;