mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Return zero as scratch required GSBA when no scratch allocation present
Change-Id: Idc59b6d0193b7310d9330432df8ccf300a93a912 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
b64210d3db
commit
52dc359511
@ -49,9 +49,13 @@ void ScratchSpaceControllerBase::createScratchSpaceAllocation() {
|
||||
}
|
||||
|
||||
uint64_t ScratchSpaceControllerBase::calculateNewGSH() {
|
||||
uint64_t gsh = 0;
|
||||
if (scratchAllocation) {
|
||||
auto &hwHelper = HwHelper::get(executionEnvironment.getHardwareInfo()->platform.eRenderCoreFamily);
|
||||
auto scratchSpaceOffsetFor64bit = hwHelper.getScratchSpaceOffsetFor64bit();
|
||||
return scratchAllocation->getGpuAddress() - scratchSpaceOffsetFor64bit;
|
||||
gsh = scratchAllocation->getGpuAddress() - scratchSpaceOffsetFor64bit;
|
||||
}
|
||||
return gsh;
|
||||
}
|
||||
uint64_t ScratchSpaceControllerBase::getScratchPatchAddress() {
|
||||
//for 32 bit scratch space pointer is being programmed in Media VFE State and is relative to 0 as General State Base Address
|
||||
|
@ -256,6 +256,14 @@ HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsRequiredThenCorrectAddre
|
||||
EXPECT_TRUE(UnitTestHelper<FamilyType>::evaluateGshAddressForScratchSpace((expectedScratchAddress - MemoryConstants::pageSize), scratchController->calculateNewGSH()));
|
||||
}
|
||||
|
||||
HWTEST_F(CommandStreamReceiverHwTest, WhenScratchSpaceIsNotRequiredThenGshAddressZeroIsReturned) {
|
||||
auto commandStreamReceiver = std::make_unique<MockCsrHw<FamilyType>>(*pDevice->executionEnvironment);
|
||||
auto scratchController = commandStreamReceiver->getScratchSpaceController();
|
||||
|
||||
EXPECT_EQ(nullptr, scratchController->getScratchSpaceAllocation());
|
||||
EXPECT_EQ(0u, scratchController->calculateNewGSH());
|
||||
}
|
||||
|
||||
struct BcsTests : public CommandStreamReceiverHwTest {
|
||||
void SetUp() override {
|
||||
CommandStreamReceiverHwTest::SetUp();
|
||||
|
Reference in New Issue
Block a user