2019-07-12 22:50:14 +08:00
|
|
|
/*
|
2024-12-31 21:48:34 +08:00
|
|
|
* Copyright (C) 2019-2025 Intel Corporation
|
2019-07-12 22:50:14 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/memory_manager/memory_operations_status.h"
|
|
|
|
#include "shared/source/utilities/arrayref.h"
|
2019-07-12 22:50:14 +08:00
|
|
|
|
2020-07-02 17:49:46 +08:00
|
|
|
namespace NEO {
|
|
|
|
class Device;
|
2019-07-12 22:50:14 +08:00
|
|
|
class GraphicsAllocation;
|
2021-09-03 19:40:34 +08:00
|
|
|
class OsContext;
|
2024-06-14 22:15:14 +08:00
|
|
|
class CommandStreamReceiver;
|
2019-07-12 22:50:14 +08:00
|
|
|
|
2019-08-21 16:53:07 +08:00
|
|
|
class MemoryOperationsHandler {
|
2019-07-12 22:50:14 +08:00
|
|
|
public:
|
2019-08-21 16:53:07 +08:00
|
|
|
MemoryOperationsHandler() = default;
|
|
|
|
virtual ~MemoryOperationsHandler() = default;
|
2019-07-12 22:50:14 +08:00
|
|
|
|
2025-02-05 14:40:13 +08:00
|
|
|
virtual MemoryOperationsStatus makeResident(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations, bool isDummyExecNeeded, const bool forcePagingFence) = 0;
|
2024-03-28 16:06:58 +08:00
|
|
|
virtual MemoryOperationsStatus lock(Device *device, ArrayRef<GraphicsAllocation *> gfxAllocations) = 0;
|
2020-07-02 17:49:46 +08:00
|
|
|
virtual MemoryOperationsStatus evict(Device *device, GraphicsAllocation &gfxAllocation) = 0;
|
|
|
|
virtual MemoryOperationsStatus isResident(Device *device, GraphicsAllocation &gfxAllocation) = 0;
|
2024-06-14 22:15:14 +08:00
|
|
|
virtual MemoryOperationsStatus free(Device *device, GraphicsAllocation &gfxAllocation) { return MemoryOperationsStatus::success; }
|
2021-09-03 19:40:34 +08:00
|
|
|
|
2025-03-19 18:14:24 +08:00
|
|
|
virtual MemoryOperationsStatus makeResidentWithinOsContext(OsContext *osContext, ArrayRef<GraphicsAllocation *> gfxAllocations, bool evictable, const bool forcePagingFence, const bool acquireLock) = 0;
|
2021-09-03 19:40:34 +08:00
|
|
|
virtual MemoryOperationsStatus evictWithinOsContext(OsContext *osContext, GraphicsAllocation &gfxAllocation) = 0;
|
2024-06-14 22:15:14 +08:00
|
|
|
virtual void processFlushResidency(CommandStreamReceiver *csr) {}
|
2019-07-12 22:50:14 +08:00
|
|
|
};
|
|
|
|
} // namespace NEO
|