meson: Use adreno-pm4-pack.xml.h instead of custom definitions

This was causing build issues when using the generate-rd.cc file,
due to redeclaration caused by the mixing of the generated header
file and the custom definitions.

Also adding some missing dependencies now introduced due to the
header file include.

Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38081>
This commit is contained in:
Karmjit Mahil 2025-10-27 14:07:13 +00:00 committed by Marge Bot
parent f5f11f12a6
commit 950f07748a
6 changed files with 28 additions and 35 deletions

View file

@ -99,6 +99,7 @@ if cc.sizeof('size_t') > 4
'util.c',
'util.h',
afuc_isa,
freedreno_pm4_xml_header_file,
],
include_directories: [
inc_freedreno,

View file

@ -11,16 +11,12 @@
#include <stdint.h>
#include "adreno_pm4.xml.h"
#ifdef __cplusplus
extern "C" {
#endif
#define CP_TYPE0_PKT 0x00000000
#define CP_TYPE2_PKT 0x80000000
#define CP_TYPE3_PKT 0xc0000000
#define CP_TYPE4_PKT 0x40000000
#define CP_TYPE7_PKT 0x70000000
#define CP_NOP_MESG 0x4D455347
#define CP_NOP_BEGN 0x4245474E
#define CP_NOP_END 0x454E4400

View file

@ -28,6 +28,7 @@ libfreedreno_common = static_library(
'freedreno_guardband.h',
'freedreno_vrs.h',
freedreno_devices_h,
freedreno_pm4_xml_header_file,
sha1_h,
'redump.h'
],

View file

@ -1372,17 +1372,6 @@ enum state_t {
UNKNOWN_4DWORDS,
};
enum adreno_state_block {
SB_VERT_TEX = 0,
SB_VERT_MIPADDR = 1,
SB_FRAG_TEX = 2,
SB_FRAG_MIPADDR = 3,
SB_VERT_SHADER = 4,
SB_GEOM_SHADER = 5,
SB_FRAG_SHADER = 6,
SB_COMPUTE_SHADER = 7,
};
/* TODO there is probably a clever way to let rnndec parse things so
* we don't have to care about packet format differences across gens
*/
@ -2178,14 +2167,6 @@ draw_indx_common(uint32_t *dwords, int level)
return num_indices;
}
enum pc_di_index_size {
INDEX_SIZE_IGN = 0,
INDEX_SIZE_16_BIT = 0,
INDEX_SIZE_32_BIT = 1,
INDEX_SIZE_8_BIT = 2,
INDEX_SIZE_INVALID = 0,
};
static void
cp_draw_indx(uint32_t *dwords, uint32_t sizedwords, int level)
{

View file

@ -28,6 +28,7 @@ libfreedreno_cffdec = static_library(
'script.h',
'util.h',
cffdump_pkt_handler_h,
freedreno_pm4_xml_header_file,
],
include_directories: [
inc_freedreno,
@ -92,7 +93,8 @@ if dep_libarchive.found()
replay = executable(
replay_name,
[
'replay.c'
'replay.c',
freedreno_pm4_xml_header_file,
],
include_directories: [
inc_freedreno,
@ -164,6 +166,7 @@ if dep_lua.found() and dep_libarchive.found()
'cffdump',
[
'cffdump.c',
freedreno_pm4_xml_header_file,
],
include_directories: [
inc_freedreno,
@ -192,6 +195,7 @@ if dep_lua.found() and dep_libarchive.found()
'crashdec-hfi.c',
'crashdec-mempool.c',
'crashdec-prefetch.c',
freedreno_pm4_xml_header_file,
],
include_directories: [
inc_freedreno,

View file

@ -22,10 +22,26 @@ xml_files += [
'adreno_control_regs.xml',
'adreno_pipe_regs.xml',
'adreno_common.xml',
'adreno_pm4.xml',
]
freedreno_py_header_files = []
freedreno_pm4_xml_header_file = []
freedreno_pm4_xml_header_file += custom_target(
'adreno_pm4.xml.h',
input: [gen_header_py, 'adreno_pm4.xml', freedreno_schema, freedreno_copyright],
output: 'adreno_pm4.xml.h',
command: [prog_python, '@INPUT0@', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'c-defines'],
capture: true,
)
freedreno_pm4_xml_header_file += custom_target(
'adreno-pm4-pack.xml.h',
input: [gen_header_py, 'adreno_pm4.xml', freedreno_schema, freedreno_copyright],
output: 'adreno-pm4-pack.xml.h',
command: [prog_python, '@INPUT0@', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'c-pack-structs'],
capture: true,
)
freedreno_xml_header_files += freedreno_pm4_xml_header_file
foreach f : xml_files
_name = f + '.h'
@ -57,13 +73,7 @@ freedreno_xml_header_files += custom_target(
capture: true,
)
freedreno_xml_header_files += custom_target(
'adreno-pm4-pack.xml.h',
input: [gen_header_py, 'adreno_pm4.xml', freedreno_schema, freedreno_copyright],
output: 'adreno-pm4-pack.xml.h',
command: [prog_python, '@INPUT0@', '--rnn', rnn_src_path, '--xml', '@INPUT1@', 'c-pack-structs'],
capture: true,
)
freedreno_py_header_files = []
foreach f : xml_reg_files
_pyname = f.split('.')[0] + '.py'