mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
fix: reorder members in BufferObject class
Related-To: HSD-13011781488 Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
fd34df899c
commit
6af9856e33
@@ -515,7 +515,7 @@ bool DrmAllocation::setMemPrefetch(Drm *drm, SubDeviceIdsVec &subDeviceIds) {
|
||||
}
|
||||
} else {
|
||||
auto bo = this->getBO();
|
||||
if (bo->isChunked) {
|
||||
if (bo->isChunked()) {
|
||||
auto drm = bo->peekDrm();
|
||||
success = prefetchBOWithChunking(const_cast<Drm *>(drm));
|
||||
} else {
|
||||
|
||||
@@ -81,7 +81,7 @@ BufferObject::BufferObject(uint32_t rootDeviceIndex, Drm *drm, uint64_t patIndex
|
||||
: BufferObject(rootDeviceIndex, drm, patIndex, BufferObjectHandleWrapper{handle}, size, maxOsContextCount) {}
|
||||
|
||||
BufferObject::BufferObject(uint32_t rootDeviceIndex, Drm *drm, uint64_t patIndex, BufferObjectHandleWrapper &&handle, size_t size, size_t maxOsContextCount)
|
||||
: drm(drm), refCount(1), rootDeviceIndex(rootDeviceIndex), handle(std::move(handle)), size(size) {
|
||||
: drm(drm), handle(std::move(handle)), size(size), refCount(1), rootDeviceIndex(rootDeviceIndex) {
|
||||
|
||||
auto ioctlHelper = drm->getIoctlHelper();
|
||||
this->tilingMode = ioctlHelper->getDrmParamValue(DrmParam::tilingNone);
|
||||
|
||||
@@ -223,9 +223,11 @@ class BufferObject {
|
||||
static constexpr int gpuHangDetected{-7171};
|
||||
|
||||
uint32_t getOsContextId(OsContext *osContext);
|
||||
std::vector<std::array<bool, EngineLimits::maxHandleCount>> bindInfo;
|
||||
|
||||
bool isChunked = false;
|
||||
const auto &getBindInfo() const { return bindInfo; }
|
||||
|
||||
void setChunked(bool chunked) { this->chunked = chunked; }
|
||||
bool isChunked() const { return this->chunked; }
|
||||
|
||||
protected:
|
||||
MOCKABLE_VIRTUAL MemoryOperationsStatus evictUnusedAllocations(bool waitForCompletion, bool isLockNeeded);
|
||||
@@ -233,35 +235,34 @@ class BufferObject {
|
||||
void printBOBindingResult(OsContext *osContext, uint32_t vmHandleId, bool bind, int retVal);
|
||||
|
||||
Drm *drm = nullptr;
|
||||
bool perContextVmsUsed = false;
|
||||
std::atomic<uint32_t> refCount;
|
||||
uint32_t rootDeviceIndex = std::numeric_limits<uint32_t>::max();
|
||||
uint32_t tilingMode;
|
||||
BufferObjectHandleWrapper handle; // i915 gem object handle
|
||||
void *lockedAddress = nullptr; // CPU side virtual address
|
||||
|
||||
bool isReused = false;
|
||||
bool boHandleShared = false;
|
||||
|
||||
bool allowCapture = false;
|
||||
bool requiresImmediateBinding = false;
|
||||
bool requiresExplicitResidency = false;
|
||||
void *lockedAddress = nullptr; // CPU side virtual address
|
||||
bool requiresLocked = false;
|
||||
|
||||
BOType boType = BOType::legacy;
|
||||
uint64_t size;
|
||||
uint64_t size = 0;
|
||||
uint64_t unmapSize = 0;
|
||||
uint64_t patIndex = CommonConstants::unsupportedPatIndex;
|
||||
uint64_t userptr = 0u;
|
||||
CacheRegion cacheRegion = CacheRegion::defaultRegion;
|
||||
CachePolicy cachePolicy = CachePolicy::writeBack;
|
||||
StackVec<uint32_t, 2> bindExtHandles;
|
||||
bool colourWithBind = false;
|
||||
|
||||
size_t colourChunk = 0;
|
||||
std::vector<uint64_t> bindAddresses;
|
||||
|
||||
private:
|
||||
uint64_t gpuAddress = 0llu;
|
||||
|
||||
std::vector<uint64_t> bindAddresses;
|
||||
std::vector<std::array<bool, EngineLimits::maxHandleCount>> bindInfo;
|
||||
StackVec<uint32_t, 2> bindExtHandles;
|
||||
BOType boType = BOType::legacy;
|
||||
std::atomic<uint32_t> refCount;
|
||||
uint32_t rootDeviceIndex = std::numeric_limits<uint32_t>::max();
|
||||
uint32_t tilingMode = 0;
|
||||
CachePolicy cachePolicy = CachePolicy::writeBack;
|
||||
CacheRegion cacheRegion = CacheRegion::defaultRegion;
|
||||
|
||||
bool colourWithBind = false;
|
||||
bool perContextVmsUsed = false;
|
||||
bool boHandleShared = false;
|
||||
bool allowCapture = false;
|
||||
bool requiresImmediateBinding = false;
|
||||
bool requiresExplicitResidency = false;
|
||||
bool requiresLocked = false;
|
||||
bool chunked = false;
|
||||
bool isReused = false;
|
||||
};
|
||||
} // namespace NEO
|
||||
|
||||
@@ -2024,7 +2024,7 @@ bool DrmMemoryManager::createDrmChunkedAllocation(Drm *drm, DrmAllocation *alloc
|
||||
|
||||
allocation->getBufferObjectToModify(0) = bo;
|
||||
|
||||
bo->isChunked = 1;
|
||||
bo->setChunked(true);
|
||||
|
||||
storageInfo.isChunked = true;
|
||||
storageInfo.numOfChunks = numOfChunks;
|
||||
@@ -2480,7 +2480,7 @@ GraphicsAllocation *DrmMemoryManager::createSharedUnifiedMemoryAllocation(const
|
||||
|
||||
bo->setAddress(castToUint64(currentAddress));
|
||||
|
||||
bo->isChunked = useChunking;
|
||||
bo->setChunked(useChunking);
|
||||
|
||||
bos.push_back(bo.release());
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ MemoryOperationsStatus DrmMemoryOperationsHandlerBind::makeResidentWithinOsConte
|
||||
bo = drmAllocation->getBO();
|
||||
}
|
||||
|
||||
if (!bo->bindInfo[bo->getOsContextId(osContext)][drmIterator]) {
|
||||
if (!bo->getBindInfo()[bo->getOsContextId(osContext)][drmIterator]) {
|
||||
bo->requireExplicitLockedMemory(drmAllocation->isLockedMemory());
|
||||
int result = drmAllocation->makeBOsResident(osContext, drmIterator, nullptr, true);
|
||||
if (result) {
|
||||
|
||||
Reference in New Issue
Block a user