Return 48Bit addressing based on I915_CONTEXT_PARAM_GTT_SIZE

Change-Id: I54dcce1708d0e7d2280da1b4acb06ee1a1da6c7f
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
Mateusz Hoppe
2019-04-23 15:42:33 +02:00
committed by sys_ocldev
parent 70c0a9f52d
commit 016d6eda4b
3 changed files with 28 additions and 14 deletions

View File

@@ -7,6 +7,7 @@
#include "drm_neo.h"
#include "runtime/memory_manager/memory_constants.h"
#include "runtime/os_interface/os_inc_base.h"
#include "runtime/utilities/directory.h"
@@ -126,9 +127,14 @@ std::string Drm::getSysFsPciPath(int deviceID) {
}
bool Drm::is48BitAddressRangeSupported() {
int value = 0;
auto ret = getParamIoctl(I915_PARAM_HAS_ALIASING_PPGTT, &value);
return (ret == 0) && (value == 3);
drm_i915_gem_context_param contextParam = {0};
contextParam.param = I915_CONTEXT_PARAM_GTT_SIZE;
auto ret = ioctl(DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM, &contextParam);
if (ret == 0) {
return contextParam.value == MemoryConstants::max64BitAppAddress + 1;
}
return true;
}
void Drm::checkPreemptionSupport() {