Change type of residency task count to uint32_t

Move definitions of objectNotUsed and objectNotResident to GraphicsAllocation

Change-Id: I2aec604a865cc6c975e9d1121028cbdd35c0b18a
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2018-11-07 08:33:55 +00:00
committed by sys_ocldev
parent bd4ea652ec
commit 66492a53a4
19 changed files with 110 additions and 109 deletions

View File

@@ -58,11 +58,12 @@ CommandStreamReceiver::~CommandStreamReceiver() {
}
void CommandStreamReceiver::makeResident(GraphicsAllocation &gfxAllocation) {
int submissionTaskCount = this->taskCount + 1;
if (gfxAllocation.getResidencyTaskCount(deviceIndex) < submissionTaskCount) {
auto submissionTaskCount = this->taskCount + 1;
bool isNotResident = !gfxAllocation.isResident(deviceIndex);
if (isNotResident || gfxAllocation.getResidencyTaskCount(deviceIndex) < submissionTaskCount) {
this->getResidencyAllocations().push_back(&gfxAllocation);
gfxAllocation.updateTaskCount(submissionTaskCount, deviceIndex);
if (!gfxAllocation.isResident(deviceIndex)) {
if (isNotResident) {
this->totalMemoryUsed += gfxAllocation.getUnderlyingBufferSize();
}
}
@@ -105,7 +106,7 @@ void CommandStreamReceiver::makeResidentHostPtrAllocation(GraphicsAllocation *gf
void CommandStreamReceiver::waitForTaskCountAndCleanAllocationList(uint32_t requiredTaskCount, uint32_t allocationUsage) {
auto address = getTagAddress();
if (address && requiredTaskCount != ObjectNotUsed) {
if (address) {
while (*address < requiredTaskCount)
;
}

View File

@@ -34,7 +34,7 @@ FlushStamp CommandStreamReceiverWithAUBDump<BaseCSR>::flush(BatchBuffer &batchBu
template <typename BaseCSR>
void CommandStreamReceiverWithAUBDump<BaseCSR>::makeNonResident(GraphicsAllocation &gfxAllocation) {
int residencyTaskCount = gfxAllocation.getResidencyTaskCount(this->deviceIndex);
uint32_t residencyTaskCount = gfxAllocation.getResidencyTaskCount(this->deviceIndex);
BaseCSR::makeNonResident(gfxAllocation);
gfxAllocation.updateResidencyTaskCount(residencyTaskCount, this->deviceIndex);
if (aubCSR) {