mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 21:42:53 +08:00
Linux: pass adapter BDF to GmmLib
Resolves: NEO-5785 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
dfb935fdcf
commit
1823054e08
@@ -558,4 +558,21 @@ Drm::~Drm() {
|
||||
this->printIoctlStatistics();
|
||||
}
|
||||
|
||||
ADAPTER_BDF Drm::getAdapterBDF() const {
|
||||
|
||||
ADAPTER_BDF adapterBDF{};
|
||||
constexpr int pciBusInfoTokensNum = 3;
|
||||
|
||||
uint32_t bus, device, function;
|
||||
|
||||
if (std::sscanf(hwDeviceId->getPciPath(), "%02x:%02x.%01x", &bus, &device, &function) != pciBusInfoTokensNum) {
|
||||
return {};
|
||||
}
|
||||
adapterBDF.Bus = bus;
|
||||
adapterBDF.Function = function;
|
||||
adapterBDF.Device = device;
|
||||
|
||||
return adapterBDF;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/gmm_helper/gmm_lib.h"
|
||||
#include "shared/source/helpers/basic_math.h"
|
||||
#include "shared/source/os_interface/linux/cache_info.h"
|
||||
#include "shared/source/os_interface/linux/engine_info.h"
|
||||
@@ -95,6 +96,7 @@ class Drm {
|
||||
|
||||
MOCKABLE_VIRTUAL void checkPreemptionSupport();
|
||||
inline int getFileDescriptor() const { return hwDeviceId->getFileDescriptor(); }
|
||||
ADAPTER_BDF getAdapterBDF() const;
|
||||
int createDrmVirtualMemory(uint32_t &drmVmId);
|
||||
void destroyDrmVirtualMemory(uint32_t drmVmId);
|
||||
uint32_t createDrmContext(uint32_t drmVmId, bool isDirectSubmission);
|
||||
|
||||
Reference in New Issue
Block a user