2019-09-19 01:32:33 +08:00
|
|
|
/*
|
2023-02-02 00:23:01 +08:00
|
|
|
* Copyright (C) 2019-2023 Intel Corporation
|
2019-09-19 01:32:33 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-09-23 06:03:07 +08:00
|
|
|
#include "shared/source/command_stream/aub_command_stream_receiver_hw.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/command_stream/command_stream_receiver_hw.h"
|
2021-09-23 06:03:07 +08:00
|
|
|
#include "shared/source/command_stream/command_stream_receiver_with_aub_dump.h"
|
2023-02-02 00:23:01 +08:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/windows/gmm_callbacks.h"
|
2021-09-23 17:03:22 +08:00
|
|
|
#include "shared/source/os_interface/windows/wddm_device_command_stream.h"
|
2019-09-19 01:32:33 +08:00
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
long __stdcall DeviceCallbacks<GfxFamily>::notifyAubCapture(void *csrHandle, uint64_t gfxAddress, size_t gfxSize, bool allocate) {
|
|
|
|
auto csr = reinterpret_cast<CommandStreamReceiverHw<GfxFamily> *>(csrHandle);
|
|
|
|
|
2023-11-30 16:32:25 +08:00
|
|
|
if (debugManager.flags.SetCommandStreamReceiver.get() == CSR_HW_WITH_AUB) {
|
2019-09-19 01:32:33 +08:00
|
|
|
auto csrWithAub = static_cast<CommandStreamReceiverWithAUBDump<WddmCommandStreamReceiver<GfxFamily>> *>(csr);
|
|
|
|
auto aubCsr = static_cast<AUBCommandStreamReceiverHw<GfxFamily> *>(csrWithAub->aubCSR.get());
|
|
|
|
if (allocate) {
|
|
|
|
AllocationView externalAllocation(gfxAddress, gfxSize);
|
|
|
|
aubCsr->makeResidentExternal(externalAllocation);
|
|
|
|
} else {
|
|
|
|
aubCsr->makeNonResidentExternal(gfxAddress);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
int __stdcall TTCallbacks<GfxFamily>::writeL3Address(void *queueHandle, uint64_t l3GfxAddress, uint64_t regOffset) {
|
|
|
|
auto csr = reinterpret_cast<CommandStreamReceiverHw<GfxFamily> *>(queueHandle);
|
|
|
|
|
2020-04-28 22:48:23 +08:00
|
|
|
LriHelper<GfxFamily>::program(&csr->getCS(0),
|
|
|
|
static_cast<uint32_t>(regOffset & 0xFFFFFFFF),
|
|
|
|
static_cast<uint32_t>(l3GfxAddress & 0xFFFFFFFF),
|
|
|
|
true);
|
|
|
|
|
|
|
|
LriHelper<GfxFamily>::program(&csr->getCS(0),
|
|
|
|
static_cast<uint32_t>(regOffset >> 32),
|
|
|
|
static_cast<uint32_t>(l3GfxAddress >> 32),
|
|
|
|
true);
|
2019-09-19 01:32:33 +08:00
|
|
|
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
} // namespace NEO
|