2018-01-03 17:54:31 +08:00
|
|
|
/*
|
2021-03-22 23:26:03 +08:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-01-03 17:54:31 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2018-01-03 17:54:31 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-07-30 21:02:11 +08:00
|
|
|
#include "hw_cmds.h"
|
2018-01-03 17:54:31 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-02-08 23:00:20 +08:00
|
|
|
class Kernel;
|
|
|
|
|
2018-01-03 17:54:31 +08:00
|
|
|
class GTPinHwHelper {
|
|
|
|
public:
|
|
|
|
static GTPinHwHelper &get(GFXCORE_FAMILY gfxCore);
|
|
|
|
virtual uint32_t getGenVersion() = 0;
|
2021-03-22 23:26:03 +08:00
|
|
|
virtual bool addSurfaceState(Kernel *pKernel) = 0;
|
|
|
|
virtual void *getSurfaceState(Kernel *pKernel, size_t bti) = 0;
|
2021-04-07 07:52:24 +08:00
|
|
|
virtual bool canUseSharedAllocation(const HardwareInfo &hwInfo) const = 0;
|
2018-01-03 17:54:31 +08:00
|
|
|
|
|
|
|
protected:
|
|
|
|
GTPinHwHelper(){};
|
|
|
|
};
|
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
class GTPinHwHelperHw : public GTPinHwHelper {
|
|
|
|
public:
|
|
|
|
static GTPinHwHelper &get() {
|
|
|
|
static GTPinHwHelperHw<GfxFamily> gtpinHwHelper;
|
|
|
|
return gtpinHwHelper;
|
|
|
|
}
|
|
|
|
uint32_t getGenVersion() override;
|
2021-03-22 23:26:03 +08:00
|
|
|
bool addSurfaceState(Kernel *pKernel) override;
|
|
|
|
void *getSurfaceState(Kernel *pKernel, size_t bti) override;
|
2021-04-07 07:52:24 +08:00
|
|
|
bool canUseSharedAllocation(const HardwareInfo &hwInfo) const override;
|
2018-01-03 17:54:31 +08:00
|
|
|
|
2021-04-07 07:52:24 +08:00
|
|
|
protected:
|
2018-01-03 17:54:31 +08:00
|
|
|
GTPinHwHelperHw(){};
|
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|