| 1 |
|
| 2 |
n |
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
|
| 34 |
#ifndef MOS_BUFMGR_PRELIM_H |
| 35 |
#define MOS_BUFMGR_PRELIM_H |
| 36 |
|
| 37 |
#ifdef __I915_PMU_OTHER |
| 38 |
#undef __I915_PMU_OTHER |
| 39 |
#endif |
| 40 |
|
| 41 |
#include "i915_drm.h" |
| 42 |
#include "i915_drm_prelim.h" |
| 43 |
#include "media_class_trace.h" |
| 44 |
class BufmgrPrelim |
| 45 |
{ |
| 46 |
public: |
| 47 |
static BufmgrPrelim *CreatePrelim(int fd); |
| 48 |
static void DestroyPrelim(BufmgrPrelim *prelim); |
| 49 |
static bool IsPrelimSupported(); |
| 50 |
static int QueryDeviceBlob(int fd, MEDIA_SYSTEM_INFO* gfxInfo); |
| 51 |
static int SetContextParamParallel(struct mos_linux_context *ctx, |
| 52 |
struct i915_engine_class_instance *ci, |
| 53 |
uint32_t count); |
| 54 |
|
| 55 |
int Init(struct mos_bufmgr &bufmgr, bool hasLmem); |
| 56 |
uint8_t GetLmemRegionCount(); |
| 57 |
|
| 58 |
void InitVmaHeap(mos_vma_heap *heap); |
| 59 |
void UninitVmaHeap(mos_vma_heap *heap); |
| 60 |
|
| 61 |
int QueryEngines(bool hasLmem, |
| 62 |
uint16_t engine_class, |
| 63 |
uint64_t caps, |
| 64 |
uint32_t *nengine, |
| 65 |
struct i915_engine_class_instance *ci); |
| 66 |
|
| 67 |
int CheckMemRegion(int memRegion, int mem_type); |
| 68 |
|
| 69 |
void SetMmapOffset(int memRegion, struct drm_i915_gem_mmap_offset &mmap_arg); |
| 70 |
|
| 71 |
int CreateGem(uint64_t inSize, |
| 72 |
uint32_t &outHandle, |
| 73 |
uint64_t &outSize, |
| 74 |
uint32_t &outRegion); |
| 75 |
|
| 76 |
int QueryEnginesCount(uint32_t *nengine); |
| 77 |
|
| 78 |
mos_memory_zone GetMemzoneForAddress(uint64_t address); |
| 79 |
|
| 80 |
int GetSystemMemRegionId() const { return PRELIM_I915_MEMORY_CLASS_SYSTEM; } |
| 81 |
|
| 82 |
void WaDisableSingleTimeline(bool hasLmem, uint32_t &flags); |
| 83 |
|
| 84 |
int GetMemoryInfo(bool hasLmem, char *info, uint32_t length); |
| 85 |
|
| 86 |
private: |
| 87 |
BufmgrPrelim(int fd); |
| 88 |
virtual ~BufmgrPrelim(); |
| 89 |
|
| 90 |
struct prelim_drm_i915_query_memory_regions *QueryMemRegions(); |
| 91 |
uint32_t GetTileId(); |
| 92 |
bool IsEngineSatisfyCaps(struct prelim_drm_i915_engine_info *engine, uint64_t caps); |
| 93 |
int QueryEnginesInternal(uint16_t engine_class, |
| 94 |
uint64_t caps, |
| 95 |
uint32_t *nengine, |
| 96 |
struct i915_engine_class_instance *ci, |
| 97 |
std::map<uint16_t, uint16_t> &logical_map); |
| 98 |
int QueryEnginesDistance(uint32_t nengine, |
| 99 |
struct prelim_drm_i915_query_distance_info *distances); |
| 100 |
bool IsQueryEnginesDistanceSupported(struct prelim_drm_i915_query_distance_info *distances); |
| 101 |
|
| 102 |
static int QueryItems(int fd, struct drm_i915_query_item *items, uint32_t n_items); |
| 103 |
|
| 104 |
private: |
| 105 |
uint32_t m_tileId = 0; |
| 106 |
int m_fd = -1; |
| 107 |
static bool m_prelimEnabled; |
| 108 |
|
| 109 |
static constexpr uint32_t TYPE_DECIMAL = 10; |
| 110 |
|
| 111 |
MEDIA_CLASS_DEFINE_END(BufmgrPrelim) |
| 112 |
}; |
| 113 |
|
| 114 |
#endif |