2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2025-02-13 11:13:17 +00:00
|
|
|
* Copyright (C) 2018-2025 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
2025-05-30 12:56:08 +00:00
|
|
|
#include "neo_igfxfmid.h"
|
2022-06-27 14:58:29 +00:00
|
|
|
|
2023-01-09 11:05:21 +00:00
|
|
|
#include <cstddef>
|
2022-06-27 14:58:29 +00:00
|
|
|
#include <cstdint>
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-02-27 14:52:10 +01:00
|
|
|
class GraphicsAllocation;
|
2023-02-24 16:55:21 +00:00
|
|
|
class ProductHelper;
|
|
|
|
|
|
2025-02-13 11:13:17 +00:00
|
|
|
bool isL3Capable(const void *ptr, size_t size);
|
2019-02-27 14:52:10 +01:00
|
|
|
bool isL3Capable(const GraphicsAllocation &graphicsAllocation);
|
2022-06-27 14:58:29 +00:00
|
|
|
|
|
|
|
|
template <PRODUCT_FAMILY gfxProduct>
|
|
|
|
|
struct L1CachePolicyHelper {
|
2022-07-28 06:53:44 +02:00
|
|
|
|
2022-08-23 11:48:18 +00:00
|
|
|
static const char *getCachingPolicyOptions(bool isDebuggerActive);
|
2022-06-27 14:58:29 +00:00
|
|
|
|
2022-08-23 11:48:18 +00:00
|
|
|
static uint32_t getDefaultL1CachePolicy(bool isDebuggerActive);
|
2022-08-12 12:23:39 +00:00
|
|
|
|
|
|
|
|
static uint32_t getUncachedL1CachePolicy();
|
|
|
|
|
|
2022-08-23 11:48:18 +00:00
|
|
|
static uint32_t getL1CachePolicy(bool isDebuggerActive);
|
2022-06-27 14:58:29 +00:00
|
|
|
};
|
|
|
|
|
|
2023-02-24 16:55:21 +00:00
|
|
|
struct L1CachePolicy {
|
|
|
|
|
L1CachePolicy() = default;
|
|
|
|
|
L1CachePolicy(const ProductHelper &helper) {
|
|
|
|
|
init(helper);
|
|
|
|
|
}
|
|
|
|
|
void init(const ProductHelper &helper);
|
|
|
|
|
uint32_t getL1CacheValue(bool isDebuggerActive) {
|
|
|
|
|
return isDebuggerActive ? defaultDebuggerActive : defaultDebuggerInactive;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected:
|
|
|
|
|
uint32_t defaultDebuggerActive = 0;
|
|
|
|
|
uint32_t defaultDebuggerInactive = 0;
|
|
|
|
|
};
|
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|