2018-10-09 11:50:58 +02:00
|
|
|
/*
|
2022-02-04 13:59:01 +00:00
|
|
|
* Copyright (C) 2018-2022 Intel Corporation
|
2018-10-09 11:50:58 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/memory_manager/graphics_allocation.h"
|
2020-06-10 11:49:34 +02:00
|
|
|
#include "shared/source/memory_manager/memory_manager.h"
|
2022-07-07 18:33:25 +00:00
|
|
|
#include "shared/source/utilities/idlist.h"
|
2018-10-09 11:50:58 +02:00
|
|
|
|
2022-07-07 18:33:25 +00:00
|
|
|
#include <memory>
|
2019-09-17 17:11:10 +02:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2018-11-02 10:01:56 +01:00
|
|
|
class CommandStreamReceiver;
|
2018-10-09 11:50:58 +02:00
|
|
|
|
|
|
|
|
class AllocationsList : public IDList<GraphicsAllocation, true, true> {
|
|
|
|
|
public:
|
2022-07-07 18:33:25 +00:00
|
|
|
AllocationsList() = default;
|
2020-06-10 11:49:34 +02:00
|
|
|
AllocationsList(AllocationUsage allocationUsage);
|
2022-07-07 18:33:25 +00:00
|
|
|
|
2022-02-04 13:59:01 +00:00
|
|
|
std::unique_ptr<GraphicsAllocation> detachAllocation(size_t requiredMinimalSize, const void *requiredPtr, CommandStreamReceiver *commandStreamReceiver, AllocationType allocationType);
|
2021-08-16 15:31:09 +00:00
|
|
|
void freeAllGraphicsAllocations(Device *neoDevice);
|
2018-10-09 11:50:58 +02:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
GraphicsAllocation *detachAllocationImpl(GraphicsAllocation *, void *);
|
2020-06-10 11:49:34 +02:00
|
|
|
|
2022-07-07 18:33:25 +00:00
|
|
|
const AllocationUsage allocationUsage{REUSABLE_ALLOCATION};
|
2018-10-09 11:50:58 +02:00
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|