2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2020-02-21 15:32:20 +08:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-02-21 15:32:20 +08:00
|
|
|
#include "scheduler_definitions.h"
|
|
|
|
|
2018-06-13 03:54:39 +08:00
|
|
|
uint GetPatchValueForSLMSize(uint slMsize) {
|
|
|
|
uint PatchValue;
|
|
|
|
if (slMsize == 0) {
|
|
|
|
PatchValue = 0;
|
|
|
|
} else {
|
|
|
|
uint count4KB = slMsize / 4096;
|
|
|
|
if (slMsize % 4096 != 0) {
|
|
|
|
count4KB++;
|
|
|
|
}
|
|
|
|
PatchValue = GetNextPowerof2(count4KB);
|
|
|
|
}
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-06-13 03:54:39 +08:00
|
|
|
return PatchValue;
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
//on BDW we have only 1 pipe control
|
2018-06-13 03:54:39 +08:00
|
|
|
void NOOPCSStallPipeControl(__global uint *secondaryBatchBuffer, uint dwordOffset, uint pipeControlOffset) {
|
2017-12-21 07:45:38 +08:00
|
|
|
dwordOffset += pipeControlOffset;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
}
|
|
|
|
|
2018-06-13 03:54:39 +08:00
|
|
|
void PutCSStallPipeControl(__global uint *secondaryBatchBuffer, uint dwordOffset, uint pipeControlOffset) {
|
2017-12-21 07:45:38 +08:00
|
|
|
dwordOffset += pipeControlOffset;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = PIPE_CONTROL_CSTALL_DWORD0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = PIPE_CONTROL_CSTALL_DWORD1;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
secondaryBatchBuffer[dwordOffset] = 0;
|
|
|
|
dwordOffset++;
|
|
|
|
}
|