mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Move drm wrappers to a separate file
Related-To: NEO-6852 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
9e7b2a77ea
commit
de465b1e6c
@ -9,6 +9,7 @@
|
||||
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/os_interface/linux/drm_neo.h"
|
||||
#include "shared/source/os_interface/linux/drm_wrappers.h"
|
||||
|
||||
#include "drm/i915_drm.h"
|
||||
|
||||
@ -18,36 +19,6 @@ uint32_t IoctlHelper::ioctl(Drm *drm, unsigned long request, void *arg) {
|
||||
return drm->ioctl(request, arg);
|
||||
}
|
||||
|
||||
static_assert(sizeof(GemCreate) == sizeof(drm_i915_gem_create));
|
||||
static_assert(offsetof(GemCreate, size) == offsetof(drm_i915_gem_create, size));
|
||||
static_assert(offsetof(GemCreate, handle) == offsetof(drm_i915_gem_create, handle));
|
||||
|
||||
static_assert(sizeof(GemUserPtr) == sizeof(drm_i915_gem_userptr));
|
||||
static_assert(offsetof(GemUserPtr, userPtr) == offsetof(drm_i915_gem_userptr, user_ptr));
|
||||
static_assert(offsetof(GemUserPtr, userSize) == offsetof(drm_i915_gem_userptr, user_size));
|
||||
static_assert(offsetof(GemUserPtr, flags) == offsetof(drm_i915_gem_userptr, flags));
|
||||
static_assert(offsetof(GemUserPtr, handle) == offsetof(drm_i915_gem_userptr, handle));
|
||||
|
||||
static_assert(sizeof(RegisterRead) == sizeof(drm_i915_reg_read));
|
||||
static_assert(offsetof(RegisterRead, offset) == offsetof(drm_i915_reg_read, offset));
|
||||
static_assert(offsetof(RegisterRead, value) == offsetof(drm_i915_reg_read, val));
|
||||
|
||||
static_assert(sizeof(GemSetTiling) == sizeof(drm_i915_gem_set_tiling));
|
||||
static_assert(offsetof(GemSetTiling, handle) == offsetof(drm_i915_gem_set_tiling, handle));
|
||||
static_assert(offsetof(GemSetTiling, tilingMode) == offsetof(drm_i915_gem_set_tiling, tiling_mode));
|
||||
static_assert(offsetof(GemSetTiling, stride) == offsetof(drm_i915_gem_set_tiling, stride));
|
||||
static_assert(offsetof(GemSetTiling, swizzleMode) == offsetof(drm_i915_gem_set_tiling, swizzle_mode));
|
||||
|
||||
static_assert(sizeof(GemGetTiling) == sizeof(drm_i915_gem_get_tiling));
|
||||
static_assert(offsetof(GemGetTiling, handle) == offsetof(drm_i915_gem_get_tiling, handle));
|
||||
static_assert(offsetof(GemGetTiling, tilingMode) == offsetof(drm_i915_gem_get_tiling, tiling_mode));
|
||||
static_assert(offsetof(GemGetTiling, swizzleMode) == offsetof(drm_i915_gem_get_tiling, swizzle_mode));
|
||||
static_assert(offsetof(GemGetTiling, physSwizzleMode) == offsetof(drm_i915_gem_get_tiling, phys_swizzle_mode));
|
||||
|
||||
bool GemGetTiling::isTilingDisabled() const { return I915_TILING_NONE == tilingMode; }
|
||||
|
||||
static_assert(sizeof(ExecObject) == sizeof(drm_i915_gem_exec_object2));
|
||||
|
||||
void IoctlHelper::fillExecObject(ExecObject &execObject, uint32_t handle, uint64_t gpuAddress, uint32_t drmContextId, bool bindInfo, bool isMarkedForCapture) {
|
||||
|
||||
auto &drmExecObject = *reinterpret_cast<drm_i915_gem_exec_object2 *>(execObject.data);
|
||||
@ -82,8 +53,6 @@ void IoctlHelper::logExecObject(const ExecObject &execObject, std::stringstream
|
||||
<< ", size: " << size << " }\n";
|
||||
}
|
||||
|
||||
static_assert(sizeof(ExecBuffer) == sizeof(drm_i915_gem_execbuffer2));
|
||||
|
||||
void IoctlHelper::fillExecBuffer(ExecBuffer &execBuffer, uintptr_t buffersPtr, uint32_t bufferCount, uint32_t startOffset, uint32_t size, uint64_t flags, uint32_t drmContextId) {
|
||||
auto &drmExecBuffer = *reinterpret_cast<drm_i915_gem_execbuffer2 *>(execBuffer.data);
|
||||
drmExecBuffer.buffers_ptr = buffersPtr;
|
||||
|
Reference in New Issue
Block a user