mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Add enum values for memory classes
Related-To: NEO-6852, NEO-6999 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c74ebfd32e
commit
64029eee20
@@ -14,8 +14,6 @@
|
||||
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace NEO {
|
||||
@@ -283,7 +281,7 @@ bool DrmAllocation::setMemAdvise(Drm *drm, MemAdviseFlags flags) {
|
||||
auto bo = bufferObjects[handleId];
|
||||
if (bo != nullptr) {
|
||||
if (flags.device_preferred_location) {
|
||||
region.memoryClass = I915_MEMORY_CLASS_DEVICE;
|
||||
region.memoryClass = ioctlHelper->getDrmParamValue(DrmParam::MemoryClassDevice);
|
||||
region.memoryInstance = handleId;
|
||||
} else {
|
||||
region.memoryClass = -1;
|
||||
@@ -304,10 +302,11 @@ bool DrmAllocation::setMemAdvise(Drm *drm, MemAdviseFlags flags) {
|
||||
bool DrmAllocation::setMemPrefetch(Drm *drm, uint32_t subDeviceId) {
|
||||
bool success = true;
|
||||
auto ioctlHelper = drm->getIoctlHelper();
|
||||
auto memoryClassDevice = ioctlHelper->getDrmParamValue(DrmParam::MemoryClassDevice);
|
||||
|
||||
for (auto bo : bufferObjects) {
|
||||
if (bo != nullptr) {
|
||||
auto region = static_cast<uint32_t>((I915_MEMORY_CLASS_DEVICE << 16u) | subDeviceId);
|
||||
auto region = static_cast<uint32_t>((memoryClassDevice << 16u) | subDeviceId);
|
||||
success &= ioctlHelper->setVmPrefetch(drm, bo->peekAddress(), bo->peekSize(), region);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -917,7 +917,7 @@ bool Drm::queryEngineInfo(bool isSysmanEnabled) {
|
||||
auto tileCount = 0u;
|
||||
std::vector<DistanceInfo> distanceInfos;
|
||||
for (const auto ®ion : memoryRegions) {
|
||||
if (I915_MEMORY_CLASS_DEVICE == region.region.memoryClass) {
|
||||
if (ioctlHelper->getDrmParamValue(DrmParam::MemoryClassDevice) == region.region.memoryClass) {
|
||||
tileCount++;
|
||||
DistanceInfo distanceInfo{};
|
||||
distanceInfo.region = region.region;
|
||||
|
||||
@@ -11,10 +11,6 @@
|
||||
#include "shared/source/os_interface/linux/drm_neo.h"
|
||||
#include "shared/source/os_interface/linux/drm_wrappers.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class DrmNullDevice : public Drm {
|
||||
|
||||
@@ -240,6 +240,8 @@ enum class DrmParam {
|
||||
ExecDefault,
|
||||
ExecNoReloc,
|
||||
ExecRender,
|
||||
MemoryClassDevice,
|
||||
MemoryClassSystem,
|
||||
ParamChipsetId,
|
||||
ParamRevision,
|
||||
ParamHasExecSoftpin,
|
||||
|
||||
@@ -204,6 +204,10 @@ int IoctlHelper::getDrmParamValueBase(DrmParam drmParam) const {
|
||||
return I915_EXEC_NO_RELOC;
|
||||
case DrmParam::ExecRender:
|
||||
return I915_EXEC_RENDER;
|
||||
case DrmParam::MemoryClassDevice:
|
||||
return I915_MEMORY_CLASS_DEVICE;
|
||||
case DrmParam::MemoryClassSystem:
|
||||
return I915_MEMORY_CLASS_SYSTEM;
|
||||
case DrmParam::ParamChipsetId:
|
||||
return I915_PARAM_CHIPSET_ID;
|
||||
case DrmParam::ParamRevision:
|
||||
|
||||
Reference in New Issue
Block a user