feature: support pci path contains card0

Some OpenCL application need to render libva surface
with drm display and use the same libva surface as
OpenCL kernel output. Such applicatoins need to
use /dev/dri/card0 instead of /dev/dri/renderD128
for getting the display fd.

Related-To: NEO-11714

Signed-off-by: Elaine, Wang <elaine.wang@intel.com>
This commit is contained in:
Elaine, Wang
2024-07-22 10:31:51 +00:00
committed by Compute-Runtime-Automation
parent c01a5c45c7
commit 28fa434541
2 changed files with 40 additions and 0 deletions

View File

@@ -48,6 +48,10 @@ std::optional<std::string> getPciPath(int deviceFd) {
auto pciPathPos = deviceLinkPath->find("/drm/render");
if (pciPathPos == std::string::npos) {
pciPathPos = deviceLinkPath->find("/drm/card");
}
if (pciPathPos == std::string::npos || pciPathPos < 12) {
return std::nullopt;
}