mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 13:38:06 +02:00
freedreno/decode,ir3: Mark decoded dwords as const
Signed-off-by: Karmjit Mahil <karmjit.mahil@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40995>
This commit is contained in:
parent
3eb6798089
commit
ce6ed3da8b
15 changed files with 139 additions and 129 deletions
|
|
@ -54,16 +54,17 @@ struct shader_stats {
|
|||
uint16_t instrs_per_cat[8];
|
||||
};
|
||||
|
||||
int disasm_a2xx(uint32_t *dwords, int sizedwords, int level,
|
||||
int disasm_a2xx(const uint32_t *dwords, int sizedwords, int level,
|
||||
mesa_shader_stage type);
|
||||
int disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
int disasm_a3xx(const uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id);
|
||||
int disasm_a3xx_stat(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id, struct shader_stats *stats);
|
||||
int try_disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id);
|
||||
int try_disasm_a3xx_stat(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id, struct shader_stats *stats);
|
||||
int disasm_a3xx_stat(const uint32_t *dwords, int sizedwords, int level,
|
||||
FILE *out, unsigned gpu_id, struct shader_stats *stats);
|
||||
int try_disasm_a3xx(const uint32_t *dwords, int sizedwords, int level,
|
||||
FILE *out, unsigned gpu_id);
|
||||
int try_disasm_a3xx_stat(const uint32_t *dwords, int sizedwords, int level,
|
||||
FILE *out, unsigned gpu_id,
|
||||
struct shader_stats *stats);
|
||||
|
||||
void disasm_a2xx_set_debug(enum debug_t debug);
|
||||
void disasm_a3xx_set_debug(enum debug_t debug);
|
||||
|
|
|
|||
|
|
@ -68,13 +68,13 @@ get_buffer(uint64_t gpuaddr)
|
|||
}
|
||||
|
||||
static int
|
||||
buffer_contains_hostptr(struct buffer *buf, void *hostptr)
|
||||
buffer_contains_hostptr(struct buffer *buf, const void *hostptr)
|
||||
{
|
||||
return (buf->hostptr <= hostptr) && (hostptr < (buf->hostptr + buf->len));
|
||||
}
|
||||
|
||||
uint64_t
|
||||
gpuaddr(void *hostptr)
|
||||
gpuaddr(const void *hostptr)
|
||||
{
|
||||
rb_tree_foreach (struct buffer, buf, &buffers, node) {
|
||||
if (buffer_contains_hostptr(buf, hostptr))
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
uint64_t gpuaddr(void *hostptr);
|
||||
uint64_t gpuaddr(const void *hostptr);
|
||||
uint64_t gpubaseaddr(uint64_t gpuaddr);
|
||||
void *hostptr(uint64_t gpuaddr);
|
||||
unsigned hostlen(uint64_t gpuaddr);
|
||||
|
|
|
|||
|
|
@ -162,14 +162,14 @@ enum state_src_t {
|
|||
static void load_all_groups(int level);
|
||||
static void disable_all_groups(void);
|
||||
|
||||
static void dump_tex_samp(uint32_t *texsamp, enum state_src_t src, int num_unit,
|
||||
int level);
|
||||
static void dump_tex_const(uint32_t *texsamp, int num_unit, int level);
|
||||
static void dump_tex_samp(const uint32_t *texsamp, enum state_src_t src,
|
||||
int num_unit, int level);
|
||||
static void dump_tex_const(const uint32_t *texsamp, int num_unit, int level);
|
||||
|
||||
static struct shader_stats shader_stats[MESA_SHADER_STAGES];
|
||||
|
||||
static void
|
||||
decode_shader_ir3(uint32_t *dwords, uint32_t sizedwords, int level,
|
||||
decode_shader_ir3(const uint32_t *dwords, uint32_t sizedwords, int level,
|
||||
enum mesa_shader_stage stage)
|
||||
{
|
||||
try_disasm_a3xx_stat(dwords, sizedwords, level, stdout,
|
||||
|
|
@ -188,7 +188,7 @@ get_shader_stats(enum mesa_shader_stage stage)
|
|||
}
|
||||
|
||||
static bool
|
||||
highlight_addr(uint32_t *hostaddr)
|
||||
highlight_addr(const uint32_t *hostaddr)
|
||||
{
|
||||
if (!options->ibs[ib].base && (ib != 0 || !options->rb_host_base))
|
||||
return false;
|
||||
|
|
@ -229,7 +229,7 @@ highlight_addr(uint32_t *hostaddr)
|
|||
}
|
||||
|
||||
static void
|
||||
dump_hex(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
dump_hex(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
int i, j;
|
||||
int lastzero = 1;
|
||||
|
|
@ -283,7 +283,7 @@ dump_hex(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
dump_float(float *dwords, uint32_t sizedwords, int level)
|
||||
dump_float(const float *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < sizedwords; i++) {
|
||||
|
|
@ -443,7 +443,7 @@ reg_dump_gpuaddr64(const char *name, uint64_t qword, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
dump_shader(const char *ext, void *buf, int bufsz)
|
||||
dump_shader(const char *ext, const void *buf, int bufsz)
|
||||
{
|
||||
if (options->dump_shaders) {
|
||||
static int n = 0;
|
||||
|
|
@ -1157,7 +1157,7 @@ is_banked_reg(uint32_t regbase)
|
|||
}
|
||||
|
||||
static void
|
||||
dump_registers(uint32_t regbase, uint32_t *dwords, uint32_t sizedwords,
|
||||
dump_registers(uint32_t regbase, const uint32_t *dwords, uint32_t sizedwords,
|
||||
int level)
|
||||
{
|
||||
struct regacc r = regacc(NULL);
|
||||
|
|
@ -1181,7 +1181,8 @@ dump_registers(uint32_t regbase, uint32_t *dwords, uint32_t sizedwords,
|
|||
}
|
||||
|
||||
static void
|
||||
dump_domain(uint32_t *dwords, uint32_t sizedwords, int level, const char *name)
|
||||
dump_domain(const uint32_t *dwords, uint32_t sizedwords, int level,
|
||||
const char *name)
|
||||
{
|
||||
struct rnndomain *dom;
|
||||
int i;
|
||||
|
|
@ -1229,7 +1230,7 @@ dump_domain(uint32_t *dwords, uint32_t sizedwords, int level, const char *name)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_resource_list(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_resource_list(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t bv_resource_count = *dwords++;
|
||||
|
||||
|
|
@ -1431,7 +1432,7 @@ do_query(const char *primtype, uint32_t num_indices)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_im_loadi(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_im_loadi(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t start = dwords[1] >> 16;
|
||||
uint32_t size = dwords[1] & 0xffff;
|
||||
|
|
@ -1465,7 +1466,7 @@ cp_im_loadi(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_wide_reg_write(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_wide_reg_write(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t reg = dwords[0] & 0xffff;
|
||||
struct regacc r = regacc(NULL);
|
||||
|
|
@ -1502,7 +1503,7 @@ enum state_t {
|
|||
*/
|
||||
|
||||
static void
|
||||
a3xx_get_state_type(uint32_t *dwords, mesa_shader_stage *stage,
|
||||
a3xx_get_state_type(const uint32_t *dwords, mesa_shader_stage *stage,
|
||||
enum state_t *state, enum state_src_t *src)
|
||||
{
|
||||
unsigned state_block_id = (dwords[0] >> 19) & 0x7;
|
||||
|
|
@ -1623,7 +1624,7 @@ _get_state_type(unsigned state_block_id, unsigned state_type,
|
|||
}
|
||||
|
||||
static void
|
||||
a4xx_get_state_type(uint32_t *dwords, mesa_shader_stage *stage,
|
||||
a4xx_get_state_type(const uint32_t *dwords, mesa_shader_stage *stage,
|
||||
enum state_t *state, enum state_src_t *src)
|
||||
{
|
||||
unsigned state_block_id = (dwords[0] >> 18) & 0xf;
|
||||
|
|
@ -1633,7 +1634,7 @@ a4xx_get_state_type(uint32_t *dwords, mesa_shader_stage *stage,
|
|||
}
|
||||
|
||||
static void
|
||||
a6xx_get_state_type(uint32_t *dwords, mesa_shader_stage *stage,
|
||||
a6xx_get_state_type(const uint32_t *dwords, mesa_shader_stage *stage,
|
||||
enum state_t *state, enum state_src_t *src)
|
||||
{
|
||||
unsigned state_block_id = (dwords[0] >> 18) & 0xf;
|
||||
|
|
@ -1643,7 +1644,8 @@ a6xx_get_state_type(uint32_t *dwords, mesa_shader_stage *stage,
|
|||
}
|
||||
|
||||
static void
|
||||
dump_tex_samp(uint32_t *texsamp, enum state_src_t src, int num_unit, int level)
|
||||
dump_tex_samp(const uint32_t *texsamp, enum state_src_t src, int num_unit,
|
||||
int level)
|
||||
{
|
||||
for (int i = 0; i < num_unit; i++) {
|
||||
/* work-around to reduce noise for opencl blob which always
|
||||
|
|
@ -1679,7 +1681,7 @@ dump_tex_samp(uint32_t *texsamp, enum state_src_t src, int num_unit, int level)
|
|||
/* base=0 for bindful, N+1 for bindless .baseN
|
||||
*/
|
||||
static bool
|
||||
show_descriptor(uint32_t *desc, int sizedwords, int base, int idx,
|
||||
show_descriptor(const uint32_t *desc, int sizedwords, int base, int idx,
|
||||
const char *domain, const char *type)
|
||||
{
|
||||
if (options->dump_all_bindless)
|
||||
|
|
@ -1708,8 +1710,8 @@ show_descriptor(uint32_t *desc, int sizedwords, int base, int idx,
|
|||
}
|
||||
|
||||
static void
|
||||
dump_tex_descriptor_type(uint32_t *texmemobj, int base, int idx, int level,
|
||||
const char *domain, const char *type)
|
||||
dump_tex_descriptor_type(const uint32_t *texmemobj, int base, int idx,
|
||||
int level, const char *domain, const char *type)
|
||||
{
|
||||
if (!show_descriptor(texmemobj, 16, base, idx, domain, type))
|
||||
return;
|
||||
|
|
@ -1721,7 +1723,8 @@ dump_tex_descriptor_type(uint32_t *texmemobj, int base, int idx, int level,
|
|||
}
|
||||
|
||||
static void
|
||||
dump_tex_descriptor(uint32_t *texmemobj, int base, int idx, int level, const char *domain)
|
||||
dump_tex_descriptor(const uint32_t *texmemobj, int base, int idx, int level,
|
||||
const char *domain)
|
||||
{
|
||||
dump_tex_descriptor_type(texmemobj, base, idx, level, domain, "DESC_SINGLE_PLANE");
|
||||
dump_tex_descriptor_type(texmemobj, base, idx, level, domain, "DESC_MULTI_PLANE");
|
||||
|
|
@ -1732,7 +1735,7 @@ dump_tex_descriptor(uint32_t *texmemobj, int base, int idx, int level, const cha
|
|||
}
|
||||
|
||||
static void
|
||||
dump_tex_const(uint32_t *texconst, int num_unit, int level)
|
||||
dump_tex_const(const uint32_t *texconst, int num_unit, int level)
|
||||
{
|
||||
for (int i = 0; i < num_unit; i++) {
|
||||
/* work-around to reduce noise for opencl blob which always
|
||||
|
|
@ -1859,14 +1862,14 @@ dump_bindless_descriptors(bool is_compute, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_load_state(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_load_state(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
mesa_shader_stage stage;
|
||||
enum state_t state;
|
||||
enum state_src_t src;
|
||||
uint32_t num_unit = (dwords[0] >> 22) & 0x1ff;
|
||||
uint64_t ext_src_addr;
|
||||
void *contents;
|
||||
const void *contents;
|
||||
int i;
|
||||
|
||||
if (quiet(2) && !options->script)
|
||||
|
|
@ -1973,7 +1976,7 @@ cp_load_state(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
break;
|
||||
}
|
||||
case TEX_MIPADDR: {
|
||||
uint32_t *addrs = contents;
|
||||
const uint32_t *addrs = contents;
|
||||
|
||||
if (quiet(2))
|
||||
return;
|
||||
|
|
@ -2095,7 +2098,7 @@ cp_load_state(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_set_bin(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_bin(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
bin_x1 = dwords[1] & 0xffff;
|
||||
bin_y1 = dwords[1] >> 16;
|
||||
|
|
@ -2104,7 +2107,7 @@ cp_set_bin(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
dump_a2xx_tex_const(uint32_t *dwords, uint32_t sizedwords, uint32_t val,
|
||||
dump_a2xx_tex_const(const uint32_t *dwords, uint32_t sizedwords, uint32_t val,
|
||||
int level)
|
||||
{
|
||||
uint32_t w, h, p;
|
||||
|
|
@ -2174,8 +2177,8 @@ dump_a2xx_tex_const(uint32_t *dwords, uint32_t sizedwords, uint32_t val,
|
|||
}
|
||||
|
||||
static void
|
||||
dump_a2xx_shader_const(uint32_t *dwords, uint32_t sizedwords, uint32_t val,
|
||||
int level)
|
||||
dump_a2xx_shader_const(const uint32_t *dwords, uint32_t sizedwords,
|
||||
uint32_t val, int level)
|
||||
{
|
||||
int i;
|
||||
printf("%sset shader const %04x\n", levels[level], val);
|
||||
|
|
@ -2202,7 +2205,7 @@ dump_a2xx_shader_const(uint32_t *dwords, uint32_t sizedwords, uint32_t val,
|
|||
}
|
||||
|
||||
static void
|
||||
cp_set_const(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_const(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t val = dwords[0] & 0xffff;
|
||||
switch ((dwords[0] >> 16) & 0xf) {
|
||||
|
|
@ -2254,7 +2257,7 @@ cp_set_const(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
static void dump_register_summary(int level, const char *usage);
|
||||
|
||||
static void
|
||||
cp_event_write(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_event_write(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
const char *name = rnn_enumname(rnn, "vgt_event_type", dwords[0] & 0xff);
|
||||
printl(2, "%sevent %s\n", levels[level], name);
|
||||
|
|
@ -2343,7 +2346,7 @@ dump_register_summary(int level, const char *usage)
|
|||
}
|
||||
|
||||
static uint32_t
|
||||
draw_indx_common(uint32_t *dwords, int level)
|
||||
draw_indx_common(const uint32_t *dwords, int level)
|
||||
{
|
||||
uint32_t prim_type = dwords[1] & 0x1f;
|
||||
uint32_t source_select = (dwords[1] >> 6) & 0x3;
|
||||
|
|
@ -2368,7 +2371,7 @@ draw_indx_common(uint32_t *dwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_draw_indx(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_draw_indx(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t num_indices = draw_indx_common(dwords, level);
|
||||
|
||||
|
|
@ -2414,12 +2417,12 @@ cp_draw_indx(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_draw_indx_2(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_draw_indx_2(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t num_indices = draw_indx_common(dwords, level);
|
||||
enum pc_di_index_size size =
|
||||
((dwords[1] >> 11) & 1) | ((dwords[1] >> 12) & 2);
|
||||
void *ptr = &dwords[3];
|
||||
const void *ptr = &dwords[3];
|
||||
int sz = 0;
|
||||
|
||||
assert(!is_64b());
|
||||
|
|
@ -2429,17 +2432,17 @@ cp_draw_indx_2(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
int i;
|
||||
printf("%sidxs: ", levels[level]);
|
||||
if (size == INDEX_SIZE_8_BIT) {
|
||||
uint8_t *idx = ptr;
|
||||
const uint8_t *idx = ptr;
|
||||
for (i = 0; i < num_indices; i++)
|
||||
printf(" %u", idx[i]);
|
||||
sz = num_indices;
|
||||
} else if (size == INDEX_SIZE_16_BIT) {
|
||||
uint16_t *idx = ptr;
|
||||
const uint16_t *idx = ptr;
|
||||
for (i = 0; i < num_indices; i++)
|
||||
printf(" %u", idx[i]);
|
||||
sz = num_indices * 2;
|
||||
} else if (size == INDEX_SIZE_32_BIT) {
|
||||
uint32_t *idx = ptr;
|
||||
const uint32_t *idx = ptr;
|
||||
for (i = 0; i < num_indices; i++)
|
||||
printf(" %u", idx[i]);
|
||||
sz = num_indices * 4;
|
||||
|
|
@ -2456,7 +2459,7 @@ cp_draw_indx_2(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_draw_indx_offset(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_draw_indx_offset(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t num_indices = dwords[2];
|
||||
uint32_t prim_type = dwords[0] & 0x1f;
|
||||
|
|
@ -2472,7 +2475,7 @@ cp_draw_indx_offset(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_draw_indx_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_draw_indx_indirect(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t prim_type = dwords[0] & 0x1f;
|
||||
uint64_t addr;
|
||||
|
|
@ -2497,7 +2500,7 @@ cp_draw_indx_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_draw_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_draw_indirect(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t prim_type = dwords[0] & 0x1f;
|
||||
uint64_t addr;
|
||||
|
|
@ -2513,7 +2516,7 @@ cp_draw_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_draw_indirect_multi(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_draw_indirect_multi(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t prim_type = dwords[0] & 0x1f;
|
||||
uint32_t count = dwords[2];
|
||||
|
|
@ -2573,7 +2576,7 @@ cp_draw_indirect_multi(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_draw_auto(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_draw_auto(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t prim_type = dwords[0] & 0x1f;
|
||||
|
||||
|
|
@ -2585,14 +2588,14 @@ cp_draw_auto(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_run_cl(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_run_cl(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
do_query("COMPUTE", 1);
|
||||
dump_register_summary(level, "compute");
|
||||
}
|
||||
|
||||
static void
|
||||
print_nop_tail_string(uint32_t *dwords, uint32_t sizedwords)
|
||||
print_nop_tail_string(const uint32_t *dwords, uint32_t sizedwords)
|
||||
{
|
||||
const char *buf = (void *)dwords;
|
||||
for (int i = 0; i < 4 * sizedwords; i++) {
|
||||
|
|
@ -2604,7 +2607,7 @@ print_nop_tail_string(uint32_t *dwords, uint32_t sizedwords)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_nop(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_nop(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
if (quiet(3))
|
||||
return;
|
||||
|
|
@ -2644,9 +2647,9 @@ cp_nop(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
printf("\n");
|
||||
}
|
||||
|
||||
uint32_t *
|
||||
parse_cp_indirect(uint32_t *dwords, uint32_t sizedwords,
|
||||
uint64_t *ibaddr, uint32_t *ibsize)
|
||||
const uint32_t *
|
||||
parse_cp_indirect(const uint32_t *dwords, uint32_t sizedwords, uint64_t *ibaddr,
|
||||
uint32_t *ibsize)
|
||||
{
|
||||
if (is_64b()) {
|
||||
assert(sizedwords == 3);
|
||||
|
|
@ -2668,7 +2671,7 @@ parse_cp_indirect(uint32_t *dwords, uint32_t sizedwords,
|
|||
}
|
||||
|
||||
static void
|
||||
cp_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_indirect(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
/* traverse indirect buffers */
|
||||
uint64_t ibaddr;
|
||||
|
|
@ -2721,7 +2724,7 @@ cp_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_start_bin(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_start_bin(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint64_t ibaddr;
|
||||
uint32_t ibsize;
|
||||
|
|
@ -2766,7 +2769,8 @@ cp_start_bin(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_fixed_stride_draw_table(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_fixed_stride_draw_table(const uint32_t *dwords, uint32_t sizedwords,
|
||||
int level)
|
||||
{
|
||||
uint64_t ibaddr;
|
||||
uint32_t ibsize;
|
||||
|
|
@ -2806,13 +2810,13 @@ cp_fixed_stride_draw_table(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_wfi(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_wfi(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
needs_wfi = false;
|
||||
}
|
||||
|
||||
static void
|
||||
cp_mem_write(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_mem_write(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
struct rnndomain *domain = rnn_finddomain(rnn->db, "CP_MEM_WRITE");
|
||||
internal_packet(dwords, sizedwords, rnn, domain);
|
||||
|
|
@ -2835,7 +2839,7 @@ cp_mem_write(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_rmw(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_rmw(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
struct rnndomain *domain;
|
||||
const char *str;
|
||||
|
|
@ -2851,7 +2855,7 @@ cp_rmw(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_reg_mem(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_reg_mem(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t val = dwords[0] & 0xffff;
|
||||
printl(3, "%sbase register: %s\n", levels[level], regname(val, 1));
|
||||
|
|
@ -2956,7 +2960,7 @@ load_all_groups(int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_set_draw_state(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_draw_state(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t i;
|
||||
|
||||
|
|
@ -3005,14 +3009,14 @@ cp_set_draw_state(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_set_mode(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_mode(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
draw_mode = dwords[0];
|
||||
}
|
||||
|
||||
/* execute compute shader */
|
||||
static void
|
||||
cp_exec_cs(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_exec_cs(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
do_query("compute", 0);
|
||||
print_mode(level);
|
||||
|
|
@ -3021,7 +3025,7 @@ cp_exec_cs(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_exec_cs_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_exec_cs_indirect(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint64_t addr;
|
||||
|
||||
|
|
@ -3041,7 +3045,7 @@ cp_exec_cs_indirect(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_set_marker(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_marker(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t val = dwords[0] & 0xf;
|
||||
const char *mode = rnn_enumname(rnn, "a6xx_marker", val);
|
||||
|
|
@ -3065,14 +3069,14 @@ cp_set_marker(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_set_thread_control(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_thread_control(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t val = dwords[0] & 0x3;
|
||||
thread = rnn_enumname(rnn, "cp_thread", val);
|
||||
}
|
||||
|
||||
static void
|
||||
cp_set_render_mode(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_render_mode(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint64_t addr;
|
||||
uint32_t *ptr, len;
|
||||
|
|
@ -3139,7 +3143,7 @@ cp_set_render_mode(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_compute_checkpoint(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_compute_checkpoint(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint64_t addr;
|
||||
uint32_t *ptr, len;
|
||||
|
|
@ -3173,7 +3177,7 @@ cp_compute_checkpoint(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_blit(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_blit(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
do_query(rnn_enumname(rnn, "cp_blit_cmd", dwords[0]), 0);
|
||||
print_mode(level);
|
||||
|
|
@ -3181,7 +3185,7 @@ cp_blit(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_context_reg_bunch(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_context_reg_bunch(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
struct regacc r = regacc(NULL);
|
||||
|
||||
|
|
@ -3193,7 +3197,7 @@ cp_context_reg_bunch(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_non_context_reg_bunch(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_non_context_reg_bunch(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
dwords += 2;
|
||||
sizedwords -= 2;
|
||||
|
|
@ -3201,7 +3205,7 @@ cp_non_context_reg_bunch(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_reg_write(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_reg_write(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint32_t reg = dwords[1] & 0xffff;
|
||||
|
||||
|
|
@ -3212,7 +3216,7 @@ cp_reg_write(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_set_amble(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_set_amble(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
uint64_t addr;
|
||||
uint32_t size = dwords[2] & 0xffff;
|
||||
|
|
@ -3231,13 +3235,14 @@ cp_set_amble(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
}
|
||||
|
||||
static void
|
||||
cp_skip_ib2_enable_global(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_skip_ib2_enable_global(const uint32_t *dwords, uint32_t sizedwords,
|
||||
int level)
|
||||
{
|
||||
skip_ib2_enable_global = dwords[0];
|
||||
}
|
||||
|
||||
static void
|
||||
cp_skip_ib2_enable_local(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
cp_skip_ib2_enable_local(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
skip_ib2_enable_local = dwords[0];
|
||||
}
|
||||
|
|
@ -3245,7 +3250,7 @@ cp_skip_ib2_enable_local(uint32_t *dwords, uint32_t sizedwords, int level)
|
|||
#define CP(x, fxn, ...) { "CP_" #x, fxn, ##__VA_ARGS__ }
|
||||
static const struct type3_op {
|
||||
const char *name;
|
||||
void (*fxn)(uint32_t *dwords, uint32_t sizedwords, int level);
|
||||
void (*fxn)(const uint32_t *dwords, uint32_t sizedwords, int level);
|
||||
struct {
|
||||
bool load_all_groups;
|
||||
} options;
|
||||
|
|
@ -3311,7 +3316,7 @@ static const struct type3_op {
|
|||
};
|
||||
|
||||
static void
|
||||
noop_fxn(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
noop_fxn(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
@ -3334,7 +3339,7 @@ get_type3_op(unsigned opc)
|
|||
}
|
||||
|
||||
void
|
||||
dump_commands(uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
dump_commands(const uint32_t *dwords, uint32_t sizedwords, int level)
|
||||
{
|
||||
int dwords_left = sizedwords;
|
||||
uint32_t count = 0; /* dword count including packet header */
|
||||
|
|
|
|||
|
|
@ -108,13 +108,13 @@ bool reg_written(uint32_t regbase);
|
|||
uint32_t reg_lastval(uint32_t regbase);
|
||||
uint32_t reg_val(uint32_t regbase);
|
||||
void reg_set(uint32_t regbase, uint32_t val);
|
||||
uint32_t * parse_cp_indirect(uint32_t *dwords, uint32_t sizedwords,
|
||||
uint64_t *ibaddr, uint32_t *ibsize);
|
||||
const uint32_t *parse_cp_indirect(const uint32_t *dwords, uint32_t sizedwords,
|
||||
uint64_t *ibaddr, uint32_t *ibsize);
|
||||
void reset_regs(void);
|
||||
void cffdec_init(const struct cffdec_options *options);
|
||||
void cffdec_finish(void);
|
||||
void dump_register_val(struct regacc *r, int level);
|
||||
void dump_commands(uint32_t *dwords, uint32_t sizedwords, int level);
|
||||
void dump_commands(const uint32_t *dwords, uint32_t sizedwords, int level);
|
||||
|
||||
enum mesa_shader_stage;
|
||||
struct shader_stats *get_shader_stats(enum mesa_shader_stage stage);
|
||||
|
|
@ -162,7 +162,7 @@ pkt_is_opcode(uint32_t dword, uint32_t *opcode, uint32_t *size)
|
|||
* the same cmdstream corruption that confused the GPU doesn't confuse us!
|
||||
*/
|
||||
static inline uint32_t
|
||||
find_next_packet(uint32_t *dwords, uint32_t sizedwords)
|
||||
find_next_packet(const uint32_t *dwords, uint32_t sizedwords)
|
||||
{
|
||||
for (uint32_t c = 0; c < sizedwords; c++) {
|
||||
if (pkt_is_type7(dwords[c]) || pkt_is_type4(dwords[c]))
|
||||
|
|
|
|||
|
|
@ -131,7 +131,8 @@ reverse_prefetch(struct prefetch_state *s, int lvl)
|
|||
* matches CP_IBn_BASE.
|
||||
*/
|
||||
static struct ib *
|
||||
scan_cmdstream(struct prefetch_state *s, int lvl, uint32_t *dwords, uint32_t sizedwords)
|
||||
scan_cmdstream(struct prefetch_state *s, int lvl, const uint32_t *dwords,
|
||||
uint32_t sizedwords)
|
||||
{
|
||||
int dwords_left = sizedwords;
|
||||
uint32_t count = 0; /* dword count including packet header */
|
||||
|
|
@ -173,7 +174,7 @@ next_pkt:
|
|||
}
|
||||
|
||||
void
|
||||
handle_prefetch(uint32_t *dwords, uint32_t sizedwords)
|
||||
handle_prefetch(const uint32_t *dwords, uint32_t sizedwords)
|
||||
{
|
||||
struct prefetch_state rb_state = {};
|
||||
|
||||
|
|
|
|||
|
|
@ -429,7 +429,7 @@ valid_header(uint32_t pkt)
|
|||
* looks for "IB" type packets and logs the target cmdstream buffers.
|
||||
*/
|
||||
static void
|
||||
parse_ibs(uint32_t *dwords, uint32_t sizedwords)
|
||||
parse_ibs(const uint32_t *dwords, uint32_t sizedwords)
|
||||
{
|
||||
int dwords_left = sizedwords;
|
||||
uint32_t count = 0; /* dword count including packet header */
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ is_gmu_legacy(void)
|
|||
|
||||
void dump_register(struct regacc *r);
|
||||
void dump_cp_mem_pool(uint32_t *mempool, bool is_bv);
|
||||
void handle_prefetch(uint32_t *dwords, uint32_t sizedwords);
|
||||
void handle_prefetch(const uint32_t *dwords, uint32_t sizedwords);
|
||||
|
||||
struct a6xx_hfi_state {
|
||||
uint64_t iova;
|
||||
|
|
|
|||
|
|
@ -393,7 +393,7 @@ dump_short_summary(struct state *state, int nconsts,
|
|||
}
|
||||
|
||||
static void
|
||||
dump_raw_shader(uint32_t *dwords, uint32_t sizedwords, int n, char *ext)
|
||||
dump_raw_shader(const uint32_t *dwords, uint32_t sizedwords, int n, char *ext)
|
||||
{
|
||||
static char filename[256];
|
||||
int fd;
|
||||
|
|
|
|||
|
|
@ -163,7 +163,7 @@ pktname(unsigned opc)
|
|||
}
|
||||
|
||||
static uint32_t
|
||||
decompile_shader(const char *name, uint32_t regbase, uint32_t *dwords,
|
||||
decompile_shader(const char *name, uint32_t regbase, const uint32_t *dwords,
|
||||
int level, bool in_reg_bunch)
|
||||
{
|
||||
uint64_t gpuaddr = ((uint64_t)dwords[1] << 32) | dwords[0];
|
||||
|
|
@ -218,7 +218,7 @@ decompile_shader(const char *name, uint32_t regbase, uint32_t *dwords,
|
|||
|
||||
static struct {
|
||||
uint32_t regbase;
|
||||
uint32_t (*fxn)(const char *name, uint32_t regbase, uint32_t *dwords,
|
||||
uint32_t (*fxn)(const char *name, uint32_t regbase, const uint32_t *dwords,
|
||||
int level, bool in_reg_bunch);
|
||||
} reg_a6xx[] = {
|
||||
{REG_A6XX_SP_VS_BASE, decompile_shader},
|
||||
|
|
@ -232,7 +232,8 @@ static struct {
|
|||
}, *type0_reg;
|
||||
|
||||
static uint32_t
|
||||
decompile_register(uint32_t regbase, uint32_t *dwords, uint16_t cnt, int level)
|
||||
decompile_register(uint32_t regbase, const uint32_t *dwords, uint16_t cnt,
|
||||
int level)
|
||||
{
|
||||
struct rnndecaddrinfo *info = rnn_reginfo(rnn, regbase);
|
||||
|
||||
|
|
@ -286,8 +287,8 @@ decompile_register(uint32_t regbase, uint32_t *dwords, uint16_t cnt, int level)
|
|||
}
|
||||
|
||||
static uint32_t
|
||||
decompile_register_reg_bunch(uint32_t regbase, uint32_t *dwords, uint16_t cnt,
|
||||
bool as_reg_bunch, int level)
|
||||
decompile_register_reg_bunch(uint32_t regbase, const uint32_t *dwords,
|
||||
uint16_t cnt, bool as_reg_bunch, int level)
|
||||
{
|
||||
struct rnndecaddrinfo *info = rnn_reginfo(rnn, regbase);
|
||||
uint64_t value = dwords[0];
|
||||
|
|
@ -342,8 +343,8 @@ reg_is_64b(uint32_t regbase)
|
|||
}
|
||||
|
||||
static uint32_t
|
||||
decompile_bunch_register(uint32_t *dw, uint32_t dwords_left, bool no_reg_bunch,
|
||||
int level)
|
||||
decompile_bunch_register(const uint32_t *dw, uint32_t dwords_left,
|
||||
bool no_reg_bunch, int level)
|
||||
{
|
||||
if (dwords_left < 2)
|
||||
return dwords_left;
|
||||
|
|
@ -363,8 +364,8 @@ decompile_bunch_register(uint32_t *dw, uint32_t dwords_left, bool no_reg_bunch,
|
|||
}
|
||||
|
||||
static void
|
||||
decompile_registers(uint32_t regbase, uint32_t *dwords, uint32_t sizedwords,
|
||||
int level)
|
||||
decompile_registers(uint32_t regbase, const uint32_t *dwords,
|
||||
uint32_t sizedwords, int level)
|
||||
{
|
||||
if (!sizedwords)
|
||||
return;
|
||||
|
|
@ -379,7 +380,7 @@ decompile_registers(uint32_t regbase, uint32_t *dwords, uint32_t sizedwords,
|
|||
}
|
||||
|
||||
static void
|
||||
decompile_domain(uint32_t pkt, uint32_t *dwords, uint32_t sizedwords,
|
||||
decompile_domain(uint32_t pkt, const uint32_t *dwords, uint32_t sizedwords,
|
||||
const char *dom_name, const char *packet_name, int level)
|
||||
{
|
||||
struct rnndomain *dom;
|
||||
|
|
@ -435,7 +436,8 @@ decompile_domain(uint32_t pkt, uint32_t *dwords, uint32_t sizedwords,
|
|||
}
|
||||
|
||||
static void
|
||||
decompile_commands(uint32_t *dwords, uint32_t sizedwords, int level, uint32_t *cond_count)
|
||||
decompile_commands(const uint32_t *dwords, uint32_t sizedwords, int level,
|
||||
uint32_t *cond_count)
|
||||
{
|
||||
int dwords_left = sizedwords;
|
||||
uint32_t count = 0; /* dword count including packet header */
|
||||
|
|
@ -488,7 +490,7 @@ decompile_commands(uint32_t *dwords, uint32_t sizedwords, int level, uint32_t *c
|
|||
}
|
||||
}
|
||||
} else if (val == CP_CONTEXT_REG_BUNCH || val == CP_NON_CONTEXT_REG_BUNCH) {
|
||||
uint32_t *dw = dwords + 1;
|
||||
const uint32_t *dw = dwords + 1;
|
||||
uint32_t cnt = count - 1;
|
||||
|
||||
if (val == CP_NON_CONTEXT_REG_BUNCH) {
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ struct rnndec {
|
|||
|
||||
/* for pm4 packet decoding: */
|
||||
uint32_t sizedwords;
|
||||
uint32_t *dwords;
|
||||
const uint32_t *dwords;
|
||||
};
|
||||
|
||||
static inline struct rnndec *
|
||||
|
|
@ -539,7 +539,7 @@ static const struct luaL_Reg l_meta_rnn_dom[] = {
|
|||
};
|
||||
|
||||
static int
|
||||
l_rnn_dom(lua_State *L, uint32_t *dwords, uint32_t sizedwords,
|
||||
l_rnn_dom(lua_State *L, const uint32_t *dwords, uint32_t sizedwords,
|
||||
struct rnn *rnn, struct rnndomain *dom)
|
||||
{
|
||||
struct rnndec *rnndec = lua_newuserdata(L, sizeof(*rnndec));
|
||||
|
|
@ -976,7 +976,7 @@ script_draw(const char *primtype, uint32_t nindx)
|
|||
*/
|
||||
|
||||
static bool
|
||||
setup_call(lua_State *state, uint32_t *dwords, uint32_t sizedwords,
|
||||
setup_call(lua_State *state, const uint32_t *dwords, uint32_t sizedwords,
|
||||
const char *name, struct rnn *rnn, struct rnndomain *dom)
|
||||
{
|
||||
if (!state)
|
||||
|
|
@ -998,8 +998,8 @@ setup_call(lua_State *state, uint32_t *dwords, uint32_t sizedwords,
|
|||
/* called to general pm4 packet decoding, such as texture/sampler state
|
||||
*/
|
||||
static bool
|
||||
handle_packet_setup(lua_State *state, uint32_t *dwords, uint32_t sizedwords,
|
||||
struct rnn *rnn, struct rnndomain *dom)
|
||||
handle_packet_setup(lua_State *state, const uint32_t *dwords,
|
||||
uint32_t sizedwords, struct rnn *rnn, struct rnndomain *dom)
|
||||
{
|
||||
if (!setup_call(state, dwords, sizedwords, dom->name, rnn, dom))
|
||||
return false;
|
||||
|
|
@ -1010,7 +1010,7 @@ handle_packet_setup(lua_State *state, uint32_t *dwords, uint32_t sizedwords,
|
|||
}
|
||||
|
||||
void
|
||||
script_packet(uint32_t *dwords, uint32_t sizedwords, struct rnn *rnn,
|
||||
script_packet(const uint32_t *dwords, uint32_t sizedwords, struct rnn *rnn,
|
||||
struct rnndomain *dom)
|
||||
{
|
||||
bool ret;
|
||||
|
|
@ -1024,7 +1024,7 @@ script_packet(uint32_t *dwords, uint32_t sizedwords, struct rnn *rnn,
|
|||
}
|
||||
|
||||
const char *
|
||||
internal_packet(uint32_t *dwords, uint32_t sizedwords, struct rnn *rnn,
|
||||
internal_packet(const uint32_t *dwords, uint32_t sizedwords, struct rnn *rnn,
|
||||
struct rnndomain *dom)
|
||||
{
|
||||
bool ret;
|
||||
|
|
@ -1048,7 +1048,7 @@ internal_packet(uint32_t *dwords, uint32_t sizedwords, struct rnn *rnn,
|
|||
}
|
||||
|
||||
bool
|
||||
script_show_descriptor(uint32_t *dwords,
|
||||
script_show_descriptor(const uint32_t *dwords,
|
||||
uint32_t sizedwords,
|
||||
int base, int idx,
|
||||
const char *type,
|
||||
|
|
|
|||
|
|
@ -37,17 +37,17 @@ __attribute__((weak))
|
|||
void script_draw(const char *primtype, uint32_t nindx);
|
||||
|
||||
__attribute__((weak))
|
||||
void script_packet(uint32_t *dwords, uint32_t sizedwords,
|
||||
void script_packet(const uint32_t *dwords, uint32_t sizedwords,
|
||||
struct rnn *rnn,
|
||||
struct rnndomain *dom);
|
||||
|
||||
__attribute__((weak))
|
||||
const char * internal_packet(uint32_t *dwords, uint32_t sizedwords,
|
||||
const char * internal_packet(const uint32_t *dwords, uint32_t sizedwords,
|
||||
struct rnn *rnn,
|
||||
struct rnndomain *dom);
|
||||
|
||||
__attribute__((weak))
|
||||
bool script_show_descriptor(uint32_t *dwords,
|
||||
bool script_show_descriptor(const uint32_t *dwords,
|
||||
uint32_t sizedwords,
|
||||
int base, int idx,
|
||||
const char *type,
|
||||
|
|
|
|||
|
|
@ -330,7 +330,7 @@ static FILE *snapshot;
|
|||
static uint64_t ptbase = 0x43210000; /* We don't always have a real ttbr0, so fake it */
|
||||
|
||||
static inline void
|
||||
snapshot_write(void *data, size_t sz)
|
||||
snapshot_write(const void *data, size_t sz)
|
||||
{
|
||||
fwrite(data, sz, 1, snapshot);
|
||||
}
|
||||
|
|
@ -559,12 +559,12 @@ snapshot_gpu_object(uint64_t gpuaddr, uint32_t size, uint32_t *buf)
|
|||
|
||||
static struct {
|
||||
struct snapshot_ib_v2 ib;
|
||||
uint32_t *dwords;
|
||||
const uint32_t *dwords;
|
||||
} ibs[512];
|
||||
static unsigned nibs;
|
||||
|
||||
static inline void
|
||||
snapshot_ib(uint64_t gpuaddr, uint32_t *dwords, uint32_t sizedwords)
|
||||
snapshot_ib(uint64_t gpuaddr, const uint32_t *dwords, uint32_t sizedwords)
|
||||
{
|
||||
int idx;
|
||||
|
||||
|
|
|
|||
|
|
@ -209,7 +209,7 @@ struct {
|
|||
};
|
||||
|
||||
static int
|
||||
disasm_alu(uint32_t *dwords, uint32_t alu_off, int level, int sync,
|
||||
disasm_alu(const uint32_t *dwords, uint32_t alu_off, int level, int sync,
|
||||
mesa_shader_stage type)
|
||||
{
|
||||
instr_alu_t *alu = (instr_alu_t *)dwords;
|
||||
|
|
@ -454,7 +454,7 @@ struct {
|
|||
};
|
||||
|
||||
static int
|
||||
disasm_fetch(uint32_t *dwords, uint32_t alu_off, int level, int sync)
|
||||
disasm_fetch(const uint32_t *dwords, uint32_t alu_off, int level, int sync)
|
||||
{
|
||||
instr_fetch_t *fetch = (instr_fetch_t *)dwords;
|
||||
|
||||
|
|
@ -600,7 +600,8 @@ print_cf(instr_cf_t *cf, int level)
|
|||
*/
|
||||
|
||||
int
|
||||
disasm_a2xx(uint32_t *dwords, int sizedwords, int level, mesa_shader_stage type)
|
||||
disasm_a2xx(const uint32_t *dwords, int sizedwords, int level,
|
||||
mesa_shader_stage type)
|
||||
{
|
||||
instr_cf_t *cfs = (instr_cf_t *)dwords;
|
||||
int idx, max_idx;
|
||||
|
|
|
|||
|
|
@ -814,7 +814,7 @@ disasm_instr_cb(void *d, unsigned n, void *instr)
|
|||
}
|
||||
|
||||
int
|
||||
disasm_a3xx_stat(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
disasm_a3xx_stat(const uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id, struct shader_stats *stats)
|
||||
{
|
||||
struct isa_decode_options decode_options = {
|
||||
|
|
@ -839,7 +839,7 @@ disasm_a3xx_stat(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
|||
|
||||
decode_options.cbdata = &ctx;
|
||||
|
||||
ir3_isa_disasm(dwords, sizedwords * 4, out, &decode_options);
|
||||
ir3_isa_disasm((void *)dwords, sizedwords * 4, out, &decode_options);
|
||||
|
||||
disasm_handle_last(&ctx);
|
||||
|
||||
|
|
@ -881,7 +881,7 @@ ir3_assert_handler(const char *expr, const char *file, int line,
|
|||
} while (0)
|
||||
|
||||
int
|
||||
disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
disasm_a3xx(const uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id)
|
||||
{
|
||||
struct shader_stats stats;
|
||||
|
|
@ -889,7 +889,7 @@ disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
|||
}
|
||||
|
||||
int
|
||||
try_disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
try_disasm_a3xx(const uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id)
|
||||
{
|
||||
struct shader_stats stats;
|
||||
|
|
@ -897,8 +897,8 @@ try_disasm_a3xx(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
|||
}
|
||||
|
||||
int
|
||||
try_disasm_a3xx_stat(uint32_t *dwords, int sizedwords, int level, FILE *out,
|
||||
unsigned gpu_id, struct shader_stats *stats)
|
||||
try_disasm_a3xx_stat(const uint32_t *dwords, int sizedwords, int level,
|
||||
FILE *out, unsigned gpu_id, struct shader_stats *stats)
|
||||
{
|
||||
int ret = -1;
|
||||
TRY(ret = disasm_a3xx_stat(dwords, sizedwords, level, out, gpu_id, stats));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue