Skip to content

Commit

Permalink
[Decode] Add xe drm init entry
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
Jexu committed Jan 11, 2024
1 parent 8b608ae commit 527edea
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion media_softlet/linux/common/os/i915/mos_bufmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -5381,6 +5384,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;
}
Expand Down Expand Up @@ -5508,6 +5517,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;
}

0 comments on commit 527edea

Please sign in to comment.