From 8c965232c330d25daf5d198ab2b02ba0a6e92490 Mon Sep 17 00:00:00 2001 From: "Xu, Zhengguo" Date: Mon, 25 Dec 2023 13:25:03 +0800 Subject: [PATCH] [Decode] Add xe drm init entry Query the drm device firstly and init specific drm implement dynamically Note: this is still need to add build option '-DENABLE_NEW_KMD=ON' to enable xe drm. Signed-off-by: Xu, Zhengguo --- media_softlet/linux/common/os/i915/mos_bufmgr.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/media_softlet/linux/common/os/i915/mos_bufmgr.c b/media_softlet/linux/common/os/i915/mos_bufmgr.c index b623d0129df..cd420180b05 100644 --- a/media_softlet/linux/common/os/i915/mos_bufmgr.c +++ b/media_softlet/linux/common/os/i915/mos_bufmgr.c @@ -60,6 +60,9 @@ #include "libdrm_lists.h" #include "mos_bufmgr.h" #include "mos_bufmgr_priv.h" +#ifdef ENABLE_NEW_KMD +#include "mos_bufmgr_xe.h" +#endif #include "string.h" #include "i915_drm.h" @@ -5430,6 +5433,12 @@ mos_bufmgr_gem_init(int fd, int batch_size, int *device_type) { return mos_bufmgr_gem_init_i915(fd, batch_size); } +#ifdef ENABLE_NEW_KMD + else if (DEVICE_TYPE_XE == type) + { + return mos_bufmgr_gem_init_xe(fd, batch_size); + } +#endif return nullptr; } @@ -5557,6 +5566,11 @@ int mos_get_device_id(int fd, uint32_t *deviceId) { return mos_get_dev_id_i915(fd, deviceId); } - +#ifdef ENABLE_NEW_KMD + else if (DEVICE_TYPE_XE == device_type) + { + return mos_get_dev_id_xe(fd, deviceId); + } +#endif return -ENODEV; }