2 * Copyright © 2016-2018 Broadcom
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
24 #ifndef CLIF_PRIVATE_H
25 #define CLIF_PRIVATE_H
29 #include "util/list.h"
40 const struct v3d_device_info
*devinfo
;
43 struct v3d_spec
*spec
;
45 /* List of struct reloc_worklist_entry */
46 struct list_head worklist
;
53 * Flag to switch from CLIF ABI to slightly more human-readable
59 enum reloc_worklist_type
{
61 reloc_gl_shader_state
,
62 reloc_generic_tile_list
,
65 struct reloc_worklist_entry
{
66 struct list_head link
;
68 enum reloc_worklist_type type
;
85 clif_lookup_bo(struct clif_dump
*clif
, uint32_t addr
);
87 struct reloc_worklist_entry
*
88 clif_dump_add_address_to_worklist(struct clif_dump
*clif
,
89 enum reloc_worklist_type type
,
92 bool v3d33_clif_dump_packet(struct clif_dump
*clif
, uint32_t offset
,
93 const uint8_t *cl
, uint32_t *size
, bool reloc_mode
);
94 bool v3d41_clif_dump_packet(struct clif_dump
*clif
, uint32_t offset
,
95 const uint8_t *cl
, uint32_t *size
, bool reloc_mode
);
96 bool v3d42_clif_dump_packet(struct clif_dump
*clif
, uint32_t offset
,
97 const uint8_t *cl
, uint32_t *size
, bool reloc_mode
);
100 out(struct clif_dump
*clif
, const char *fmt
, ...)
105 vfprintf(clif
->out
, fmt
, args
);
110 out_address(struct clif_dump
*clif
, uint32_t addr
)
112 struct clif_bo
*bo
= clif_lookup_bo(clif
, addr
);
114 out(clif
, "[%s+0x%08x] /* 0x%08x */",
115 bo
->name
, addr
- bo
->offset
, addr
);
117 out(clif
, "/* XXX: BO unknown */ 0x%08x", addr
);
123 #endif /* CLIF_PRIVATE_H */