Files
compute-runtime/shared/source/os_interface/linux/clos_helper.h
Mateusz Jablonski 4a24195e99 Move bind/unbind buffer objects methods to drm_neo.cpp
use ioctl helper to handle binding properly

Related-To: NEO-6591
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2022-02-16 08:37:16 +01:00

38 lines
876 B
C++

/*
* Copyright (C) 2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/debug_helpers.h"
#include "shared/source/os_interface/linux/cache_info.h"
namespace NEO {
namespace ClosHelper {
/*
PAT Index CLOS MemType
SHARED
0 0 UC (00)
1 0 WC (01)
2 0 WT (10)
3 0 WB (11)
RESERVED 1
4 1 WT (10)
5 1 WB (11)
RESERVED 2
6 2 WT (10)
7 2 WB (11)
*/
constexpr uint64_t getPatIndex(CacheRegion closIndex, CachePolicy memType) {
UNRECOVERABLE_IF((closIndex > CacheRegion::Default) && (memType < CachePolicy::WriteThrough));
return (static_cast<uint32_t>(memType) + (static_cast<uint16_t>(closIndex) * 2));
}
} // namespace ClosHelper
} // namespace NEO