Contributors:
Ammar ELWazir <aelwazir@amd.com>
AravindanC <aravindan.cheruvally@amd.com>
Benjamin Welton <bewelton@amd.com>
Ma, Bing <Bing.Ma@amd.com>
Chun Yang <chun.yang@amd.com>
Cole Nelson <cole.nelson@amd.com>
Ethan Stewart <ethan.stewart@amd.com>
Evgeny <evgeny.shcherbakov@amd.com>
Freddy Paul <Freddy.paul@amd.com>
Giovanni Baraldi <gbaraldi@amd.com>
Gopesh Bhardwaj <Gopesh.Bhardwaj@amd.com>
Icarus Sparry <icarus.sparry@amd.com>
itrowbri <Ian.Trowbridge@amd.com>
James Edwards <JamesAdrian.Edwards@amd.com>
jatang <jatang@amd.com>
Jeremy Newton <Jeremy.Newton@amd.com>
Jonathan Kim <jonathan.kim@amd.com>
Kent Russell <kent.russell@amd.com>
Kiumars Sabeti <kiumars.sabeti@amd.com>
Lang Yu <lang.yu@amd.com>
Laurent Morichetti <laurent.morichetti@amd.com>
Mallya, Ameya Keshava <AmeyaKeshava.Mallya@amd.com>
Manjunath Jakaraddi <manjunath.jakaraddi@amd.com>
Mark Laws <markdavid.laws@amd.com>
Mohan Kumar Mithur <Mohan.KumarMithur@amd.com>
Nicholas Curtis <nicurtis@amd.com>
Nirmal Unnikrishnan <Nirmal.Unnikrishnan@amd.com>
Parag Bhandari <parag.bhandari@amd.com>
Ranjith Ramakrishnan <Ranjith.Ramakrishnan@amd.com>
Robert Gregory <Robert.Gregory@amd.com>
Saravanan Solaiyappan <saravanan.solaiyappan@amd.com>
Saurabh Verma <saurabh.verma@amd.com>
Srihari Uttanur <srihari.u@amd.com>
Srinivasan Subramanian <srinivasan.subramanian@amd.com>
Sriraksha Nagaraj <Sriraksha.Nagaraj@amd.com>
Sushma Vaddireddy <svaddire@amd.com>
Xianwei Zhang <Xianwei.Zhang@amd.com>
Этот коммит содержится в:
Evgeny authored and Ammar ELWazir committed 2025-05-28 10:10:47 -05:00
1 родитель 7c7d7b4022
Коммит 1ed169e30c
157 files changed
+371830

No files matched your search

+39
Просмотреть файл
@@ -0,0 +1,39 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef _GFX10_DEF_H_
#define _GFX10_DEF_H_
#include "linux/navi10_enum.h"
#include "util/soc15_common.h"
#include "util/reg_offsets.h"
#include "linux/registers/gc/gc_10_3_0_offset.h"
#include "linux/registers/gc/gc_10_3_0_sh_mask.h"
#include "linux/registers/athub/athub_1_0_offset.h"
#include "linux/registers/athub/athub_1_0_sh_mask.h"
#include "linux/packets/nvd.h"
#include "gfxip/gfx10/gfx10_block_info.h"
#include "gfxip/gfx10/gfx10_primitives.h"
#include "gfxip/gfx10/gfx10_block_table.h"
using namespace gfxip::gfx10;
#endif // _GFX10_DEF_H_
+40
Просмотреть файл
@@ -0,0 +1,40 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef _GFX11_DEF_H_
#define _GFX11_DEF_H_
#include "linux/soc21_enum.h"
#include "util/soc15_common.h"
#include "util/reg_offsets.h"
#include "linux/registers/gc/gc_11_0_0_offset.h"
#include "linux/registers/gc/gc_11_0_0_sh_mask.h"
#include "linux/registers/athub/athub_1_0_offset.h"
#include "linux/registers/athub/athub_1_0_sh_mask.h"
#include "linux/packets/nvd.h"
#include "gfxip/gfx11/gfx11_block_info.h"
#include "gfxip/gfx11/gfx11_primitives.h"
#include "gfxip/gfx11/gfx11_block_table.h"
using namespace gfxip::gfx11;
#endif // _GFX11_DEF_H_
+39
Просмотреть файл
@@ -0,0 +1,39 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef _GFX12_DEF_H_
#define _GFX12_DEF_H_
#include "linux/soc24_enum.h"
#include "util/soc15_common.h"
#include "util/reg_offsets.h"
#include "linux/registers/gc/gc_12_0_0_offset.h"
#include "linux/registers/gc/gc_12_0_0_sh_mask.h"
#include "linux/packets/nvd.h"
#include "gfxip/gfx12/gfx12_block_info.h"
using namespace gfxip::gfx12;
using namespace gfxip::gfx12::gfx1201;
#include "gfxip/gfx12/gfx12_primitives.h"
#include "gfxip/gfx12/gfx12_block_table.h"
#endif // _GFX12_DEF_H_
+40
Просмотреть файл
@@ -0,0 +1,40 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef _GFX908_DEF_H_
#define _GFX908_DEF_H_
#include "linux/vega10_enum.h"
#include "util/soc15_common.h"
#include "util/reg_offsets.h"
#include "linux/packets/soc15d.h"
#include "linux/registers/gc/gc_9_2_1_offset.h"
#include "linux/registers/gc/gc_9_2_1_sh_mask.h"
#include "linux/registers/athub/athub_1_0_offset.h"
#include "linux/registers/athub/athub_1_0_sh_mask.h"
#include "gfxip/gfx9/gfx9_block_info.h"
#include "gfxip/gfx9/gfx9_primitives.h"
#include "gfxip/gfx9/gfx9_block_table.h"
using namespace gfxip::gfx9;
#endif // _GFX908_DEF_H_
+40
Просмотреть файл
@@ -0,0 +1,40 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef _GFX90A_DEF_H_
#define _GFX90A_DEF_H_
#include "linux/vega10_enum.h"
#include "util/soc15_common.h"
#include "util/reg_offsets.h"
#include "linux/packets/soc15d.h"
#include "linux/registers/gc/gc_9_2_1_offset.h"
#include "linux/registers/gc/gc_9_2_1_sh_mask.h"
#include "linux/registers/athub/athub_1_0_offset.h"
#include "linux/registers/athub/athub_1_0_sh_mask.h"
#include "gfxip/gfx9/gfx9_block_info.h"
#include "gfxip/gfx9/gfx9_primitives.h"
#include "gfxip/gfx9/gfx9_block_table.h"
using namespace gfxip::gfx9;
#endif // _GFX90A_DEF_H_
+40
Просмотреть файл
@@ -0,0 +1,40 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef _GFX940_DEF_H_
#define _GFX940_DEF_H_
#include "linux/vega10_enum.h"
#include "util/soc15_common.h"
#include "util/reg_offsets.h"
#include "linux/packets/soc15d.h"
#include "linux/registers/gc/gc_9_2_1_offset.h"
#include "linux/registers/gc/gc_9_2_1_sh_mask.h"
#include "linux/registers/athub/athub_1_0_offset.h"
#include "linux/registers/athub/athub_1_0_sh_mask.h"
#include "gfxip/gfx9/gfx9_block_info.h"
#include "gfxip/gfx9/gfx9_primitives.h"
#include "gfxip/gfx9/gfx9_block_table.h"
using namespace gfxip::gfx9;
#endif // _GFX940_DEF_H_
+40
Просмотреть файл
@@ -0,0 +1,40 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef _GFX9_DEF_H_
#define _GFX9_DEF_H_
#include "linux/vega10_enum.h"
#include "util/soc15_common.h"
#include "util/reg_offsets.h"
#include "linux/packets/soc15d.h"
#include "linux/registers/gc/gc_9_2_1_offset.h"
#include "linux/registers/gc/gc_9_2_1_sh_mask.h"
#include "linux/registers/athub/athub_1_0_offset.h"
#include "linux/registers/athub/athub_1_0_sh_mask.h"
#include "gfxip/gfx9/gfx9_block_info.h"
#include "gfxip/gfx9/gfx9_primitives.h"
#include "gfxip/gfx9/gfx9_block_table.h"
using namespace gfxip::gfx9;
#endif // _GFX9_DEF_H_
+138
Просмотреть файл
@@ -0,0 +1,138 @@
// MIT License
//
// Copyright (c) 2017-2025 Advanced Micro Devices, Inc.
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#ifndef SRC_DEF_GPU_BLOCK_INFO_H_
#define SRC_DEF_GPU_BLOCK_INFO_H_
#include <stdint.h>
#include "util/reg_offsets.h"
// Counter Block attributes
enum CounterBlockAttr {
// Default block attribute
CounterBlockDfltAttr = 1,
// Per ShaderEngine blocks
CounterBlockSeAttr = 2,
// SQ blocks
CounterBlockSqAttr = 4,
// Need to clean counter registers
CounterBlockCleanAttr = 8,
// MC Block
CounterBlockMcAttr = 0x10,
// CP PERFMON controllable blocks
CounterBlockCpmonAttr = 0x1f,
// SDMA block
CounterBlockSdmaAttr = 0x100,
// Texture cache
CounterBlockTcAttr = 0x400,
// Explicitly indexed blocks
CounterBlockExplInstAttr = 0x800,
// SPM blocks
CounterBlockSpmGlobalAttr = 0x1000,
CounterBlockSpmSeAttr = 0x2000,
// GUS block
CounterBlockGusAttr = 0x4000,
// GRBM block
CounterBlockGRBMAttr = 0x8000,
// UMC block
CounterBlockUmcAttr = 0x10000,
// SE and SA-dependent blocks
CounterBlockSaAttr = 0x20000,
// MI300 AID blocks
CounterBlockAidAttr = 0x40000,
// SPI special
CounterBlockSPIAttr = 0x80000,
// Blocks within WGP
CounterBlockWgpAttr = 0x100000,
// RPB block
CounterBlockRpbAttr = 0x200000,
// ATC block
CounterBlockAtcAttr = 0x400000,
};
// Register address corresponding to each counter
struct CounterRegInfo {
// counter select register address
Register select_addr;
// counter control register address
Register control_addr;
// counter register address low
Register register_addr_lo;
// counter register address high
Register register_addr_hi;
};
struct BlockDelayInfo {
Register reg;
uint32_t val;
};
struct counter_des_t;
// GPU Block info definition
struct GpuBlockInfo {
// Unique string identifier of the block.
const char* name;
// Block ID
uint32_t id;
// Maximum number of block instances in the group per shader array
uint32_t instance_count;
// Maximum counter event ID
uint32_t event_id_max;
// Maximum number of counters that can be enabled at once
uint32_t counter_count;
// Counter registers addresses
const CounterRegInfo* counter_reg_info;
// Counter select value function
uint32_t (*select_value)(const counter_des_t&);
// Block attributes mask
uint32_t attr;
// Block delay info
const BlockDelayInfo* delay_info;
// SPM block id
uint32_t spm_block_id;
};
// Block descriptor
struct block_des_t {
uint32_t id;
uint32_t index;
};
// block_des_t less then functor
struct lt_block_des {
bool operator()(const block_des_t& a1, const block_des_t& a2) const {
return (a1.id < a2.id) || ((a1.id == a2.id) && (a1.index < a2.index));
}
};
// Counter descriptor
struct counter_des_t {
uint32_t id;
uint32_t index;
block_des_t block_des;
const GpuBlockInfo* block_info;
};
#endif // SRC_DEF_GPU_BLOCK_INFO_H_