2020-02-10 15:57:49 +01:00
|
|
|
/*
|
2022-04-20 14:12:20 +00:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-02-10 15:57:49 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
#include <memory>
|
|
|
|
|
namespace NEO {
|
|
|
|
|
struct HardwareInfo;
|
2022-04-20 14:12:20 +00:00
|
|
|
class LinearStream;
|
2020-07-23 10:56:08 +02:00
|
|
|
class IndirectHeap;
|
2020-10-16 15:52:18 -07:00
|
|
|
struct DebugData;
|
|
|
|
|
class GraphicsAllocation;
|
2020-07-27 17:37:51 +02:00
|
|
|
|
2020-02-10 15:57:49 +01:00
|
|
|
class Debugger {
|
|
|
|
|
public:
|
2020-08-24 09:27:30 +02:00
|
|
|
struct SbaAddresses {
|
2022-04-20 14:12:20 +00:00
|
|
|
constexpr static size_t trackedAddressCount = 6;
|
2020-08-24 09:27:30 +02:00
|
|
|
uint64_t GeneralStateBaseAddress = 0;
|
|
|
|
|
uint64_t SurfaceStateBaseAddress = 0;
|
|
|
|
|
uint64_t DynamicStateBaseAddress = 0;
|
|
|
|
|
uint64_t IndirectObjectBaseAddress = 0;
|
|
|
|
|
uint64_t InstructionBaseAddress = 0;
|
|
|
|
|
uint64_t BindlessSurfaceStateBaseAddress = 0;
|
|
|
|
|
uint64_t BindlessSamplerStateBaseAddress = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2020-02-10 15:57:49 +01:00
|
|
|
static std::unique_ptr<Debugger> create(HardwareInfo *hwInfo);
|
|
|
|
|
virtual ~Debugger() = default;
|
2020-06-18 17:08:55 +02:00
|
|
|
bool isLegacy() const { return isLegacyMode; }
|
2022-04-20 14:12:20 +00:00
|
|
|
virtual void captureStateBaseAddress(NEO::LinearStream &cmdStream, SbaAddresses sba) = 0;
|
|
|
|
|
virtual size_t getSbaTrackingCommandsSize(size_t trackedAddressCount) = 0;
|
|
|
|
|
|
2020-07-23 10:56:08 +02:00
|
|
|
void *getDebugSurfaceReservedSurfaceState(IndirectHeap &ssh);
|
|
|
|
|
|
2020-11-16 16:24:54 +01:00
|
|
|
inline static bool isDebugEnabled(bool internalUsage) {
|
|
|
|
|
return !internalUsage;
|
|
|
|
|
}
|
|
|
|
|
|
2020-06-18 17:08:55 +02:00
|
|
|
protected:
|
|
|
|
|
bool isLegacyMode = true;
|
2020-02-10 15:57:49 +01:00
|
|
|
};
|
2022-04-20 14:12:20 +00:00
|
|
|
|
|
|
|
|
static_assert(std::is_standard_layout<Debugger::SbaAddresses>::value);
|
2020-02-10 15:57:49 +01:00
|
|
|
} // namespace NEO
|