Force Kmd Notify timeout for Windows machines running on battery

- This is to improve battery usage while waiting in busy loop on CPU
- New Kmd Notify helper to maintain dynamic parameters
- Ask OS about battery status on longer waits
- Pick different timeout when using battery and optimization is disabled

Change-Id: I5f9c8c5a9c635652aac27c707f2b55933947a7fb
This commit is contained in:
Dunajski, Bartosz
2018-04-10 10:26:59 +02:00
committed by sys_ocldev
parent 5fdd853506
commit acf97999f3
17 changed files with 397 additions and 105 deletions

View File

@ -76,6 +76,8 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
uint64_t generalStateBase,
uint64_t internalHeapBaseAddress);
void resetKmdNotifyHelper(KmdNotifyHelper *newHelper);
protected:
void programPreemption(LinearStream &csr, DispatchFlags &dispatchFlags);
void programL3(LinearStream &csr, DispatchFlags &dispatchFlags, uint32_t &newL3Config);
@ -90,7 +92,6 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
PIPE_CONTROL *addPipeControlCmd(LinearStream &commandStream);
uint64_t getScratchPatchAddress();
MOCKABLE_VIRTUAL void updateLastWaitForCompletionTimestamp();
static void emitNoop(LinearStream &commandStream, size_t bytesToUpdate);
@ -101,7 +102,7 @@ class CommandStreamReceiverHw : public CommandStreamReceiver {
const HardwareInfo &hwInfo;
CsrSizeRequestFlags csrSizeRequestFlags = {};
std::chrono::high_resolution_clock::time_point lastWaitForCompletionTimestamp;
std::unique_ptr<KmdNotifyHelper> kmdNotifyHelper;
};
template <typename GfxFamily>