refactor: use Drm::queryGttSize in DrmMemoryManager
Related-To: NEO-6852 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
parent
e2441e0d75
commit
8924024a27
|
@ -11,8 +11,6 @@
|
|||
#include "shared/source/helpers/engine_node_helper.h"
|
||||
#include "shared/source/os_interface/linux/drm_wrappers.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
DrmParam DrmEngineMapper::engineNodeMap(aub_stream::EngineType engineType) {
|
||||
|
|
|
@ -954,12 +954,10 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromExistingStorag
|
|||
uint64_t DrmMemoryManager::getSystemSharedMemory(uint32_t rootDeviceIndex) {
|
||||
uint64_t hostMemorySize = MemoryConstants::pageSize * (uint64_t)(sysconf(_SC_PHYS_PAGES));
|
||||
|
||||
GemContextParam getContextParam = {};
|
||||
getContextParam.param = I915_CONTEXT_PARAM_GTT_SIZE;
|
||||
[[maybe_unused]] auto ret = getDrm(rootDeviceIndex).ioctl(DrmIoctl::GemContextGetparam, &getContextParam);
|
||||
DEBUG_BREAK_IF(ret != 0);
|
||||
uint64_t gpuMemorySize = 0u;
|
||||
|
||||
uint64_t gpuMemorySize = getContextParam.value;
|
||||
[[maybe_unused]] auto ret = getDrm(rootDeviceIndex).queryGttSize(gpuMemorySize);
|
||||
DEBUG_BREAK_IF(ret != 0);
|
||||
|
||||
return std::min(hostMemorySize, gpuMemorySize);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue