Skip to content

Commit 8924024

Browse files
refactor: use Drm::queryGttSize in DrmMemoryManager
Related-To: NEO-6852 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent e2441e0 commit 8924024

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

shared/source/os_interface/linux/drm_engine_mapper.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
#include "shared/source/helpers/engine_node_helper.h"
1212
#include "shared/source/os_interface/linux/drm_wrappers.h"
1313

14-
#include "drm/i915_drm.h"
15-
1614
namespace NEO {
1715

1816
DrmParam DrmEngineMapper::engineNodeMap(aub_stream::EngineType engineType) {

shared/source/os_interface/linux/drm_memory_manager.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -954,12 +954,10 @@ GraphicsAllocation *DrmMemoryManager::createGraphicsAllocationFromExistingStorag
954954
uint64_t DrmMemoryManager::getSystemSharedMemory(uint32_t rootDeviceIndex) {
955955
uint64_t hostMemorySize = MemoryConstants::pageSize * (uint64_t)(sysconf(_SC_PHYS_PAGES));
956956

957-
GemContextParam getContextParam = {};
958-
getContextParam.param = I915_CONTEXT_PARAM_GTT_SIZE;
959-
[[maybe_unused]] auto ret = getDrm(rootDeviceIndex).ioctl(DrmIoctl::GemContextGetparam, &getContextParam);
960-
DEBUG_BREAK_IF(ret != 0);
957+
uint64_t gpuMemorySize = 0u;
961958

962-
uint64_t gpuMemorySize = getContextParam.value;
959+
[[maybe_unused]] auto ret = getDrm(rootDeviceIndex).queryGttSize(gpuMemorySize);
960+
DEBUG_BREAK_IF(ret != 0);
963961

964962
return std::min(hostMemorySize, gpuMemorySize);
965963
}

0 commit comments

Comments
 (0)