mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Add helper method for ForceOtherHVALIGN4 flag
Change-Id: I3823792b44459fabd3b4576ba80b6e5c6d7a3887 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
7912b9fa94
commit
51d0219f65
@ -115,6 +115,8 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo) {
|
||||
break;
|
||||
}
|
||||
|
||||
auto &hwHelper = HwHelper::get(GmmHelper::getInstance()->getHardwareInfo()->platform.eRenderCoreFamily);
|
||||
|
||||
resourceParams.NoGfxMemory = 1; // dont allocate, only query for params
|
||||
|
||||
resourceParams.Usage = GMM_RESOURCE_USAGE_TYPE::GMM_RESOURCE_USAGE_OCL_IMAGE;
|
||||
@ -124,7 +126,7 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo) {
|
||||
resourceParams.BaseHeight = imageHeight;
|
||||
resourceParams.Depth = imageDepth;
|
||||
resourceParams.ArraySize = imageCount;
|
||||
resourceParams.Flags.Wa.__ForceOtherHVALIGN4 = 1;
|
||||
resourceParams.Flags.Wa.__ForceOtherHVALIGN4 = hwHelper.hvAlign4Required();
|
||||
resourceParams.MaxLod = imgInfo.baseMipLevel + imgInfo.mipCount;
|
||||
if (imgInfo.imgDesc->image_row_pitch && imgInfo.imgDesc->mem_object) {
|
||||
resourceParams.OverridePitch = (uint32_t)imgInfo.imgDesc->image_row_pitch;
|
||||
@ -132,7 +134,6 @@ void Gmm::setupImageResourceParams(ImageInfo &imgInfo) {
|
||||
}
|
||||
|
||||
applyAuxFlagsForImage(imgInfo);
|
||||
auto &hwHelper = HwHelper::get(GmmHelper::getInstance()->getHardwareInfo()->platform.eRenderCoreFamily);
|
||||
if (!hwHelper.supportsYTiling() && resourceParams.Flags.Info.TiledY == 1) {
|
||||
resourceParams.Flags.Info.Linear = 0;
|
||||
resourceParams.Flags.Info.TiledY = 0;
|
||||
|
@ -42,6 +42,7 @@ class HwHelper {
|
||||
virtual bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual const AubMemDump::LrcaHelper &getCsTraits(aub_stream::EngineType engineType) const = 0;
|
||||
virtual bool supportsYTiling() const = 0;
|
||||
virtual bool hvAlign4Required() const = 0;
|
||||
virtual bool obtainRenderBufferCompressionPreference(const size_t size) const = 0;
|
||||
virtual void checkResourceCompatibility(Buffer *buffer, cl_int &errorCode) = 0;
|
||||
static bool renderCompressedBuffersSupported(const HardwareInfo &hwInfo);
|
||||
@ -129,6 +130,8 @@ class HwHelperHw : public HwHelper {
|
||||
|
||||
bool supportsYTiling() const override;
|
||||
|
||||
bool hvAlign4Required() const override;
|
||||
|
||||
bool obtainRenderBufferCompressionPreference(const size_t size) const override;
|
||||
|
||||
void checkResourceCompatibility(Buffer *buffer, cl_int &errorCode) override;
|
||||
|
@ -39,6 +39,11 @@ bool HwHelperHw<GfxFamily>::supportsYTiling() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::hvAlign4Required() const {
|
||||
return true;
|
||||
}
|
||||
|
||||
template <typename GfxFamily>
|
||||
bool HwHelperHw<GfxFamily>::timestampPacketWriteSupported() const {
|
||||
return false;
|
||||
|
@ -161,6 +161,8 @@ TEST_F(GmmTests, validImageTypeQuery) {
|
||||
EXPECT_GT(imgInfo.qPitch, 0u);
|
||||
}
|
||||
|
||||
auto &hwHelper = HwHelper::get(GmmHelper::getInstance()->getHardwareInfo()->platform.eRenderCoreFamily);
|
||||
|
||||
EXPECT_EQ(queryGmm->resourceParams.Type, GMM_RESOURCE_TYPE::RESOURCE_3D);
|
||||
EXPECT_EQ(queryGmm->resourceParams.NoGfxMemory, 1u);
|
||||
|
||||
@ -172,7 +174,7 @@ TEST_F(GmmTests, validImageTypeQuery) {
|
||||
EXPECT_EQ(queryGmm->resourceParams.BaseHeight, 17u);
|
||||
EXPECT_EQ(queryGmm->resourceParams.Depth, 17u);
|
||||
EXPECT_EQ(queryGmm->resourceParams.ArraySize, 1u);
|
||||
EXPECT_EQ(queryGmm->resourceParams.Flags.Wa.__ForceOtherHVALIGN4, 1u);
|
||||
EXPECT_EQ(!!queryGmm->resourceParams.Flags.Wa.__ForceOtherHVALIGN4, hwHelper.hvAlign4Required());
|
||||
}
|
||||
|
||||
TEST_F(GmmTests, givenWidthWhenCreatingResourceThenSetWidth64Field) {
|
||||
|
@ -17,3 +17,8 @@ void testDefaultImplementationOfSetupHardwareCapabilities(HwHelper &hwHelper, co
|
||||
EXPECT_EQ(16384u, hwCaps.image3DMaxWidth);
|
||||
EXPECT_TRUE(hwCaps.isStatelesToStatefullWithOffsetSupported);
|
||||
}
|
||||
|
||||
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenAskedForHvAlign4RequiredThenReturnTrue) {
|
||||
auto &hwHelper = HwHelper::get(pDevice->getHardwareInfo().platform.eRenderCoreFamily);
|
||||
EXPECT_TRUE(hwHelper.hvAlign4Required());
|
||||
}
|
||||
|
Reference in New Issue
Block a user