mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 21:18:24 +08:00
Rename LocalMemoryHelper to IoctlHelper
Related-To: NEO-6472 This helper class is not used only for local memory. IoctlHelper is more appropriate. Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
816e12ed4f
commit
ce5f9c2214
@@ -7,7 +7,7 @@
|
||||
if(SUPPORT_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
|
||||
set(NEO_CORE_OS_INTERFACE_LINUX_LOCAL_DG1
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/local_memory_helper_dg1.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_dg1.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/drm_tip_helper.cpp
|
||||
)
|
||||
set_property(GLOBAL APPEND PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX_LOCAL_DG1})
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/local_memory_helper.h"
|
||||
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
||||
|
||||
#include "third_party/uapi/drm/i915_drm.h"
|
||||
|
||||
@@ -23,7 +23,7 @@ uint32_t createGemExtMemoryRegions(Drm *drm, void *data, uint32_t dataSize, size
|
||||
createExt.size = allocSize;
|
||||
createExt.extensions = reinterpret_cast<uintptr_t>(&extRegions);
|
||||
|
||||
auto ret = LocalMemoryHelper::ioctl(drm, DRM_IOCTL_I915_GEM_CREATE_EXT, &createExt);
|
||||
auto ret = IoctlHelper::ioctl(drm, DRM_IOCTL_I915_GEM_CREATE_EXT, &createExt);
|
||||
|
||||
handle = createExt.handle;
|
||||
return ret;
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
extern IoctlHelper *ioctlHelperFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
struct EnableProductIoctlHelperDg1 {
|
||||
EnableProductIoctlHelperDg1() {
|
||||
IoctlHelper *pIoctlHelper = IoctlHelperImpl<IGFX_DG1>::get();
|
||||
ioctlHelperFactory[IGFX_DG1] = pIoctlHelper;
|
||||
}
|
||||
};
|
||||
|
||||
static EnableProductIoctlHelperDg1 enableIoctlHelperDg1;
|
||||
} // namespace NEO
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/local_memory_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
extern LocalMemoryHelper *localMemoryHelperFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
struct EnableProductLocalMemoryHelperDg1 {
|
||||
EnableProductLocalMemoryHelperDg1() {
|
||||
LocalMemoryHelper *plocalMemHelper = LocalMemoryHelperImpl<IGFX_DG1>::get();
|
||||
localMemoryHelperFactory[IGFX_DG1] = plocalMemHelper;
|
||||
}
|
||||
};
|
||||
|
||||
static EnableProductLocalMemoryHelperDg1 enableLocalMemoryHelperDg1;
|
||||
} // namespace NEO
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/os_interface/linux/local_memory_helper.h"
|
||||
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
||||
|
||||
#include "third_party/uapi/dg1/drm/i915_drm.h"
|
||||
|
||||
@@ -19,7 +19,7 @@ extern bool isQueryDrmTip(uint8_t *dataQuery, int32_t length);
|
||||
extern std::unique_ptr<uint8_t[]> translateToDrmTip(uint8_t *dataQuery, int32_t &length);
|
||||
|
||||
template <>
|
||||
uint32_t LocalMemoryHelperImpl<gfxProduct>::createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle) {
|
||||
uint32_t IoctlHelperImpl<gfxProduct>::createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle) {
|
||||
printDebugString(DebugManager.flags.PrintBOCreateDestroyResult.get(), stdout, "Performing GEM_CREATE_EXT with { size: %lu", allocSize);
|
||||
|
||||
if (DebugManager.flags.PrintBOCreateDestroyResult.get()) {
|
||||
@@ -50,7 +50,7 @@ uint32_t LocalMemoryHelperImpl<gfxProduct>::createGemExt(Drm *drm, void *data, u
|
||||
createExt.size = allocSize;
|
||||
createExt.extensions = reinterpret_cast<uintptr_t>(&setparamRegion);
|
||||
|
||||
auto ret = LocalMemoryHelper::ioctl(drm, DRM_IOCTL_I915_GEM_CREATE_EXT, &createExt);
|
||||
auto ret = IoctlHelper::ioctl(drm, DRM_IOCTL_I915_GEM_CREATE_EXT, &createExt);
|
||||
|
||||
handle = createExt.handle;
|
||||
printDebugString(DebugManager.flags.PrintBOCreateDestroyResult.get(), stdout, "GEM_CREATE_EXT with EXT_SETPARAM has returned: %d BO-%u with size: %lu\n", ret, createExt.handle, createExt.size);
|
||||
@@ -58,7 +58,7 @@ uint32_t LocalMemoryHelperImpl<gfxProduct>::createGemExt(Drm *drm, void *data, u
|
||||
}
|
||||
|
||||
template <>
|
||||
std::unique_ptr<uint8_t[]> LocalMemoryHelperImpl<gfxProduct>::translateIfRequired(uint8_t *dataQuery, int32_t length) {
|
||||
std::unique_ptr<uint8_t[]> IoctlHelperImpl<gfxProduct>::translateIfRequired(uint8_t *dataQuery, int32_t length) {
|
||||
if (isQueryDrmTip(dataQuery, length)) {
|
||||
DEBUG_BREAK_IF(true);
|
||||
return std::unique_ptr<uint8_t[]>(dataQuery);
|
||||
@@ -67,5 +67,5 @@ std::unique_ptr<uint8_t[]> LocalMemoryHelperImpl<gfxProduct>::translateIfRequire
|
||||
return translateToDrmTip(data.get(), length);
|
||||
}
|
||||
|
||||
template class LocalMemoryHelperImpl<gfxProduct>;
|
||||
template class IoctlHelperImpl<gfxProduct>;
|
||||
} // namespace NEO
|
||||
@@ -7,7 +7,7 @@
|
||||
if(SUPPORT_XE_HP_SDV AND "${BRANCH_TYPE}" STREQUAL "")
|
||||
set(NEO_CORE_OS_INTERFACE_LINUX_LOCAL_XE_HP_SDV
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/local_memory_helper_xe_hp_sdv.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/ioctl_helper_xe_hp_sdv.cpp
|
||||
)
|
||||
set_property(GLOBAL APPEND PROPERTY NEO_CORE_OS_INTERFACE_LINUX ${NEO_CORE_OS_INTERFACE_LINUX_LOCAL_XE_HP_SDV})
|
||||
endif()
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
extern IoctlHelper *ioctlHelperFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
struct EnableProductIoctlHelperXeHpSdv {
|
||||
EnableProductIoctlHelperXeHpSdv() {
|
||||
IoctlHelper *pIoctlHelper = IoctlHelperImpl<IGFX_XE_HP_SDV>::get();
|
||||
ioctlHelperFactory[IGFX_XE_HP_SDV] = pIoctlHelper;
|
||||
}
|
||||
};
|
||||
|
||||
static EnableProductIoctlHelperXeHpSdv enableIoctlHelperXeHpSdv;
|
||||
} // namespace NEO
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/source/os_interface/linux/local_memory_helper.h"
|
||||
|
||||
namespace NEO {
|
||||
extern LocalMemoryHelper *localMemoryHelperFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
struct EnableProductLocalMemoryHelperXeHpSdv {
|
||||
EnableProductLocalMemoryHelperXeHpSdv() {
|
||||
LocalMemoryHelper *plocalMemHelper = LocalMemoryHelperImpl<IGFX_XE_HP_SDV>::get();
|
||||
localMemoryHelperFactory[IGFX_XE_HP_SDV] = plocalMemHelper;
|
||||
}
|
||||
};
|
||||
|
||||
static EnableProductLocalMemoryHelperXeHpSdv enableLocalMemoryHelperXeHpSdv;
|
||||
} // namespace NEO
|
||||
@@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/os_interface/linux/local_memory_helper.h"
|
||||
#include "shared/source/os_interface/linux/ioctl_helper.h"
|
||||
|
||||
#include "third_party/uapi/xe_hp_sdv/drm/i915_drm.h"
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace NEO {
|
||||
constexpr static auto gfxProduct = IGFX_XE_HP_SDV;
|
||||
|
||||
template <>
|
||||
uint32_t LocalMemoryHelperImpl<gfxProduct>::createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle) {
|
||||
uint32_t IoctlHelperImpl<gfxProduct>::createGemExt(Drm *drm, void *data, uint32_t dataSize, size_t allocSize, uint32_t &handle) {
|
||||
drm_i915_gem_create_ext_memory_regions memRegions;
|
||||
memRegions.num_regions = dataSize;
|
||||
memRegions.regions = reinterpret_cast<uintptr_t>(data);
|
||||
@@ -44,10 +44,10 @@ uint32_t LocalMemoryHelperImpl<gfxProduct>::createGemExt(Drm *drm, void *data, u
|
||||
}
|
||||
|
||||
template <>
|
||||
std::unique_ptr<uint8_t[]> LocalMemoryHelperImpl<gfxProduct>::translateIfRequired(uint8_t *dataQuery, int32_t length) {
|
||||
std::unique_ptr<uint8_t[]> IoctlHelperImpl<gfxProduct>::translateIfRequired(uint8_t *dataQuery, int32_t length) {
|
||||
return std::unique_ptr<uint8_t[]>(dataQuery);
|
||||
}
|
||||
|
||||
template class LocalMemoryHelperImpl<gfxProduct>;
|
||||
template class IoctlHelperImpl<gfxProduct>;
|
||||
|
||||
} // namespace NEO
|
||||
Reference in New Issue
Block a user