refactor: simplify isDcFlushAllowed implementation

Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
Zbigniew Zdanowicz
2024-03-14 10:15:48 +00:00
committed by Compute-Runtime-Automation
parent ef7dbc99f1
commit 8fe1a460f8
8 changed files with 15 additions and 13 deletions

View File

@@ -86,6 +86,8 @@ struct Gen11 {
}
};
static constexpr bool isDcFlushAllowed = true;
static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), "");
};
struct Gen11Family : public Gen11 {

View File

@@ -85,6 +85,8 @@ struct Gen12Lp {
}
};
static constexpr bool isDcFlushAllowed = true;
static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), "");
};
struct Gen12LpFamily : public Gen12Lp {

View File

@@ -87,6 +87,8 @@ struct Gen8 {
}
};
static constexpr bool isDcFlushAllowed = true;
static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), "");
};
struct Gen8Family : public Gen8 {

View File

@@ -86,6 +86,8 @@ struct Gen9 {
}
};
static constexpr bool isDcFlushAllowed = true;
static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), "");
};

View File

@@ -393,7 +393,8 @@ bool ProductHelperHw<gfxProduct>::isKmdMigrationSupported() const {
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::isDcFlushAllowed() const {
auto dcFlushAllowed = true;
using GfxProduct = typename HwMapper<gfxProduct>::GfxProduct;
bool dcFlushAllowed = GfxProduct::isDcFlushAllowed;
if (debugManager.flags.AllowDcFlush.get() != -1) {
dcFlushAllowed = debugManager.flags.AllowDcFlush.get();

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2021-2023 Intel Corporation
* Copyright (C) 2021-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -67,6 +67,8 @@ struct PVC : public XeHpcCoreFamily {
return (revId <= 0x3);
}
static constexpr uint32_t pvcSteppingBits = 0b111;
static constexpr bool isDcFlushAllowed = false;
};
class PvcHwConfig : public PVC {

View File

@@ -16,17 +16,6 @@ bool ProductHelperHw<gfxProduct>::isDirectSubmissionSupported(ReleaseHelper *rel
return true;
}
template <>
bool ProductHelperHw<gfxProduct>::isDcFlushAllowed() const {
auto dcFlushAllowed = false;
if (debugManager.flags.AllowDcFlush.get() != -1) {
dcFlushAllowed = debugManager.flags.AllowDcFlush.get();
}
return dcFlushAllowed;
}
template <>
void ProductHelperHw<gfxProduct>::adjustSamplerState(void *sampler, const HardwareInfo &hwInfo) const {
using SAMPLER_STATE = typename XeHpcCoreFamily::SAMPLER_STATE;

View File

@@ -92,6 +92,8 @@ struct XeHpgCore {
}
};
static constexpr bool isDcFlushAllowed = true;
static_assert(sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor) == sizeof(DataPortBindlessSurfaceExtendedMessageDescriptor::packed), "");
};