11/*
2- * Copyright (C) 2017-2020 Intel Corporation
2+ * Copyright (C) 2017-2021 Intel Corporation
33 *
44 * SPDX-License-Identifier: MIT
55 *
@@ -58,7 +58,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface *(&surfaces)[surfaceCount
5858 const cl_event *eventWaitList,
5959 cl_event *event) {
6060 BuiltInOwnershipWrapper builtInLock;
61- MemObjsForAuxTranslation memObjsForAuxTranslation ;
61+ KernelObjsForAuxTranslation kernelObjsForAuxTranslation ;
6262 MultiDispatchInfo multiDispatchInfo (kernel);
6363
6464 if (DebugManager.flags .ForceDispatchScheduler .get ()) {
@@ -69,9 +69,9 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface *(&surfaces)[surfaceCount
6969 if (kernel->isAuxTranslationRequired ()) {
7070 auto &builder = BuiltInDispatchBuilderOp::getBuiltinDispatchInfoBuilder (EBuiltInOps::AuxTranslation, getClDevice ());
7171 builtInLock.takeOwnership (builder);
72- kernel->fillWithBuffersForAuxTranslation (memObjsForAuxTranslation , rootDeviceIndex);
73- multiDispatchInfo.setMemObjsForAuxTranslation (memObjsForAuxTranslation );
74- if (!memObjsForAuxTranslation .empty ()) {
72+ kernel->fillWithKernelObjsForAuxTranslation (kernelObjsForAuxTranslation , rootDeviceIndex);
73+ multiDispatchInfo.setKernelObjsForAuxTranslation (kernelObjsForAuxTranslation );
74+ if (!kernelObjsForAuxTranslation .empty ()) {
7575 dispatchAuxTranslationBuiltin (multiDispatchInfo, AuxTranslationDirection::AuxToNonAux);
7676 }
7777 }
@@ -89,7 +89,7 @@ void CommandQueueHw<GfxFamily>::enqueueHandler(Surface *(&surfaces)[surfaceCount
8989 }
9090 }
9191 if (kernel->isAuxTranslationRequired ()) {
92- if (!memObjsForAuxTranslation .empty ()) {
92+ if (!kernelObjsForAuxTranslation .empty ()) {
9393 UNRECOVERABLE_IF (kernel->isParentKernel );
9494 dispatchAuxTranslationBuiltin (multiDispatchInfo, AuxTranslationDirection::NonAuxToAux);
9595 }
@@ -479,23 +479,31 @@ void CommandQueueHw<GfxFamily>::processDispatchForBlitAuxTranslation(const Multi
479479 const EventsRequest &eventsRequest, bool queueBlocked) {
480480 auto rootDeviceIndex = getDevice ().getRootDeviceIndex ();
481481 auto nodesAllocator = getGpgpuCommandStreamReceiver ().getTimestampPacketAllocator ();
482- auto numBuffers = multiDispatchInfo.getMemObjsForAuxTranslation ()->size ();
483- blitPropertiesContainer.resize (numBuffers * 2 );
482+ auto numKernelObjs = multiDispatchInfo.getKernelObjsForAuxTranslation ()->size ();
483+ blitPropertiesContainer.resize (numKernelObjs * 2 );
484484
485485 auto bufferIndex = 0 ;
486- for (auto &buffer : *multiDispatchInfo.getMemObjsForAuxTranslation ()) {
486+ for (auto &kernelObj : *multiDispatchInfo.getKernelObjsForAuxTranslation ()) {
487+ GraphicsAllocation *allocation = nullptr ;
488+ if (kernelObj.type == KernelObjForAuxTranslation::Type::MEM_OBJ) {
489+ auto buffer = static_cast <Buffer *>(kernelObj.object );
490+ allocation = buffer->getGraphicsAllocation (rootDeviceIndex);
491+ } else {
492+ DEBUG_BREAK_IF (kernelObj.type != KernelObjForAuxTranslation::Type::GFX_ALLOC);
493+ allocation = static_cast <GraphicsAllocation *>(kernelObj.object );
494+ }
487495 {
488496 // Aux to NonAux
489- blitPropertiesContainer[bufferIndex] = BlitProperties::constructPropertiesForAuxTranslation (AuxTranslationDirection::AuxToNonAux,
490- buffer-> getGraphicsAllocation (rootDeviceIndex) , getGpgpuCommandStreamReceiver ().getClearColorAllocation ());
497+ blitPropertiesContainer[bufferIndex] = BlitProperties::constructPropertiesForAuxTranslation (
498+ AuxTranslationDirection::AuxToNonAux, allocation , getGpgpuCommandStreamReceiver ().getClearColorAllocation ());
491499 auto auxToNonAuxNode = nodesAllocator->getTag ();
492500 timestampPacketDependencies.auxToNonAuxNodes .add (auxToNonAuxNode);
493501 }
494502
495503 {
496504 // NonAux to Aux
497- blitPropertiesContainer[bufferIndex + numBuffers ] = BlitProperties::constructPropertiesForAuxTranslation (AuxTranslationDirection::NonAuxToAux,
498- buffer-> getGraphicsAllocation (rootDeviceIndex) , getGpgpuCommandStreamReceiver ().getClearColorAllocation ());
505+ blitPropertiesContainer[bufferIndex + numKernelObjs ] = BlitProperties::constructPropertiesForAuxTranslation (
506+ AuxTranslationDirection::NonAuxToAux, allocation , getGpgpuCommandStreamReceiver ().getClearColorAllocation ());
499507 auto nonAuxToAuxNode = nodesAllocator->getTag ();
500508 timestampPacketDependencies.nonAuxToAuxNodes .add (nonAuxToAuxNode);
501509 }
0 commit comments