fix: Copy tiled 1D array per array element with BLT

Related-To: NEO-14147, HSD-14024424096, HSD-14024424178
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
Maciej Plewka
2025-03-07 15:32:42 +00:00
committed by Compute-Runtime-Automation
parent e644b09433
commit c5e1fcf313
8 changed files with 344 additions and 3 deletions

View File

@@ -8,6 +8,8 @@
#include "shared/source/helpers/blit_properties.h"
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/gmm_helper/gmm.h"
#include "shared/source/gmm_helper/resource_info.h"
#include "shared/source/helpers/timestamp_packet.h"
#include "shared/source/memory_manager/surface.h"
@@ -179,5 +181,43 @@ bool BlitProperties::isImageOperation() const {
blitDirection == BlitterConstants::BlitDirection::imageToHostPtr ||
blitDirection == BlitterConstants::BlitDirection::imageToImage;
}
bool BlitProperties::isSrc1DTiledArray() const {
if (srcAllocation->getDefaultGmm()) {
return is1DTiledArray(srcAllocation->getDefaultGmm()->gmmResourceInfo.get());
}
return false;
}
bool BlitProperties::isDst1DTiledArray() const {
if (dstAllocation->getDefaultGmm()) {
return is1DTiledArray(dstAllocation->getDefaultGmm()->gmmResourceInfo.get());
}
return false;
}
bool BlitProperties::is1DTiledArray(GmmResourceInfo *resInfo) const {
auto resourceType = resInfo->getResourceType();
auto isArray = resInfo->getArraySize() > 1;
auto isTiled = resInfo->getResourceFlags()->Info.Tile4 || resInfo->getResourceFlags()->Info.Tile64;
if (resourceType == GMM_RESOURCE_TYPE::RESOURCE_1D && isTiled && isArray) {
return true;
}
return false;
}
void BlitProperties::transform1DArrayTo2DArrayIfNeeded() {
if (this->isSrc1DTiledArray() || this->isDst1DTiledArray()) {
this->srcSize.z = this->srcSize.y;
this->srcSize.y = 1;
this->dstSize.z = this->dstSize.y;
this->dstSize.y = 1;
this->srcOffset.z = this->srcOffset.y;
this->srcOffset.y = 0;
this->dstOffset.z = this->dstOffset.y;
this->dstOffset.y = 0;
this->copySize.z = this->copySize.y;
this->copySize.y = 1;
}
}
} // namespace NEO

View File

@@ -21,6 +21,7 @@ class TagNodeBase;
class TimestampPacketContainer;
class GraphicsAllocation;
class CommandStreamReceiver;
class GmmResourceInfo;
enum class BlitSyncMode {
none = 0,
@@ -66,6 +67,12 @@ struct BlitProperties {
TimestampPacketContainer &kernelTimestamps, const CsrDependencies &depsFromEvents,
CommandStreamReceiver &gpguCsr, CommandStreamReceiver &bcsCsr);
bool isImageOperation() const;
bool isSrc1DTiledArray() const;
bool isDst1DTiledArray() const;
bool is1DTiledArray(GmmResourceInfo *resInfo) const;
void transform1DArrayTo2DArrayIfNeeded();
BlitSyncProperties blitSyncProperties = {};
CsrDependencies csrDependencies;
TagNodeBase *multiRootDeviceEventSync = nullptr;
@@ -95,8 +102,6 @@ struct BlitProperties {
GMM_YUV_PLANE_ENUM dstPlane = GMM_YUV_PLANE_ENUM::GMM_NO_PLANE;
GMM_YUV_PLANE_ENUM srcPlane = GMM_YUV_PLANE_ENUM::GMM_NO_PLANE;
bool isSystemMemoryPoolUsed = false;
bool isImageOperation() const;
};
} // namespace NEO