Skip to content

Commit 6dd948a

Browse files
performance: Pass residency container as const ptr
Related-To: NEO-13922 Signed-off-by: Lukasz Jobczyk <[email protected]>
1 parent f907c7d commit 6dd948a

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

shared/source/direct_submission/direct_submission_hw.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ class DirectSubmissionHw {
112112
MOCKABLE_VIRTUAL void deallocateResources();
113113
MOCKABLE_VIRTUAL bool makeResourcesResident(DirectSubmissionAllocations &allocations);
114114
virtual bool allocateOsResources() = 0;
115-
virtual bool submit(uint64_t gpuAddress, size_t size, ResidencyContainer *allocationsForResidency) = 0;
115+
virtual bool submit(uint64_t gpuAddress, size_t size, const ResidencyContainer *allocationsForResidency) = 0;
116116
virtual bool handleResidency() = 0;
117-
virtual void handleRingRestartForUllsLightResidency(ResidencyContainer *allocationsForResidency){};
117+
virtual void handleRingRestartForUllsLightResidency(const ResidencyContainer *allocationsForResidency){};
118118
void handleNewResourcesSubmission();
119119
bool isNewResourceHandleNeeded();
120120
size_t getSizeNewResourceHandler();
@@ -130,7 +130,7 @@ class DirectSubmissionHw {
130130
virtual bool dispatchMonitorFenceRequired(bool requireMonitorFence);
131131
virtual void getTagAddressValue(TagData &tagData) = 0;
132132
void unblockGpu();
133-
bool submitCommandBufferToGpu(bool needStart, uint64_t gpuAddress, size_t size, bool needWait, ResidencyContainer *allocationsForResidency);
133+
bool submitCommandBufferToGpu(bool needStart, uint64_t gpuAddress, size_t size, bool needWait, const ResidencyContainer *allocationsForResidency);
134134
bool copyCommandBufferIntoRing(BatchBuffer &batchBuffer);
135135

136136
void cpuCachelineFlush(void *ptr, size_t size);

shared/source/direct_submission/direct_submission_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ bool DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchCommandBuffer(BatchBuffe
10371037
}
10381038

10391039
template <typename GfxFamily, typename Dispatcher>
1040-
bool DirectSubmissionHw<GfxFamily, Dispatcher>::submitCommandBufferToGpu(bool needStart, uint64_t gpuAddress, size_t size, bool needWait, ResidencyContainer *allocationsForResidency) {
1040+
bool DirectSubmissionHw<GfxFamily, Dispatcher>::submitCommandBufferToGpu(bool needStart, uint64_t gpuAddress, size_t size, bool needWait, const ResidencyContainer *allocationsForResidency) {
10411041
if (needStart) {
10421042
this->ringStart = this->submit(gpuAddress, size, allocationsForResidency);
10431043
return this->ringStart;

shared/source/direct_submission/linux/drm_direct_submission.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@ class DrmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
2626

2727
protected:
2828
bool allocateOsResources() override;
29-
bool submit(uint64_t gpuAddress, size_t size, ResidencyContainer *allocationsForResidency) override;
29+
bool submit(uint64_t gpuAddress, size_t size, const ResidencyContainer *allocationsForResidency) override;
3030

3131
bool handleResidency() override;
32-
void handleRingRestartForUllsLightResidency(ResidencyContainer *allocationsForResidency) override;
32+
void handleRingRestartForUllsLightResidency(const ResidencyContainer *allocationsForResidency) override;
3333
void handleStopRingBuffer() override;
3434

3535
void ensureRingCompletion() override;

shared/source/direct_submission/linux/drm_direct_submission.inl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ bool DrmDirectSubmission<GfxFamily, Dispatcher>::allocateOsResources() {
131131
}
132132

133133
template <typename GfxFamily, typename Dispatcher>
134-
bool DrmDirectSubmission<GfxFamily, Dispatcher>::submit(uint64_t gpuAddress, size_t size, ResidencyContainer *allocationsForResidency) {
134+
bool DrmDirectSubmission<GfxFamily, Dispatcher>::submit(uint64_t gpuAddress, size_t size, const ResidencyContainer *allocationsForResidency) {
135135
auto bb = static_cast<DrmAllocation *>(this->ringCommandStream.getGraphicsAllocation())->getBO();
136136

137137
auto osContextLinux = static_cast<OsContextLinux *>(&this->osContext);
@@ -212,7 +212,7 @@ bool DrmDirectSubmission<GfxFamily, Dispatcher>::handleResidency() {
212212
}
213213

214214
template <typename GfxFamily, typename Dispatcher>
215-
void DrmDirectSubmission<GfxFamily, Dispatcher>::handleRingRestartForUllsLightResidency(ResidencyContainer *allocationsForResidency) {
215+
void DrmDirectSubmission<GfxFamily, Dispatcher>::handleRingRestartForUllsLightResidency(const ResidencyContainer *allocationsForResidency) {
216216
if (allocationsForResidency) {
217217
auto restartNeeded = (static_cast<DrmMemoryOperationsHandler *>(this->memoryOperationHandler)->obtainAndResetNewResourcesSinceLastRingSubmit() ||
218218
std::chrono::duration_cast<std::chrono::microseconds>(this->getCpuTimePoint() - this->lastUllsLightExecTimestamp) > std::chrono::microseconds{ullsLightTimeout});

shared/source/direct_submission/windows/wddm_direct_submission.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ class WddmDirectSubmission : public DirectSubmissionHw<GfxFamily, Dispatcher> {
2929

3030
protected:
3131
bool allocateOsResources() override;
32-
bool submit(uint64_t gpuAddress, size_t size, ResidencyContainer *allocationForResidency) override;
32+
bool submit(uint64_t gpuAddress, size_t size, const ResidencyContainer *allocationsForResidency) override;
3333

3434
bool handleResidency() override;
3535
void handleCompletionFence(uint64_t completionValue, MonitoredFence &fence);

shared/source/direct_submission/windows/wddm_direct_submission.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ bool WddmDirectSubmission<GfxFamily, Dispatcher>::allocateOsResources() {
9292
}
9393

9494
template <typename GfxFamily, typename Dispatcher>
95-
bool WddmDirectSubmission<GfxFamily, Dispatcher>::submit(uint64_t gpuAddress, size_t size, ResidencyContainer *allocationForResidency) {
95+
bool WddmDirectSubmission<GfxFamily, Dispatcher>::submit(uint64_t gpuAddress, size_t size, const ResidencyContainer *allocationsForResidency) {
9696
perfLogResidencyVariadicLog(wddm->getResidencyLogger(), "ULLS Submit to GPU\n");
9797
COMMAND_BUFFER_HEADER *pHeader = reinterpret_cast<COMMAND_BUFFER_HEADER *>(commandBufferHeader.get());
9898
pHeader->RequiresCoherency = false;

shared/test/common/mocks/mock_direct_submission_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ struct MockDirectSubmissionHw : public DirectSubmissionHw<GfxFamily, Dispatcher>
141141
return true;
142142
}
143143

144-
bool submit(uint64_t gpuAddress, size_t size, ResidencyContainer *allocationsForResidency) override {
144+
bool submit(uint64_t gpuAddress, size_t size, const ResidencyContainer *allocationsForResidency) override {
145145
submitGpuAddress = gpuAddress;
146146
submitSize = size;
147147
submitCount++;

0 commit comments

Comments
 (0)