2 * Copyright © 2014 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 #include "util/u_math.h"
25 #include "util/u_prim.h"
26 #include "util/macros.h"
27 #include "vc4_cl_dump.h"
28 #include "kernel/vc4_packet.h"
30 #include "broadcom/cle/v3d_decoder.h"
33 vc4_dump_cl(void *cl
, uint32_t size
, bool is_render
)
35 struct v3d_device_info devinfo
= {
36 /* While the driver supports V3D 2.1 and 2.6, we haven't split
37 * off a 2.6 XML yet (there are a couple of fields different
38 * in render target formatting)
42 struct v3d_spec
*spec
= v3d_spec_load(&devinfo
);
44 uint32_t offset
= 0, hw_offset
= 0;
47 while (offset
< size
) {
48 struct v3d_group
*inst
= v3d_spec_find_instruction(spec
, p
);
53 fprintf(stderr
, "0x%08x 0x%08x: Unknown packet 0x%02x (%d)!\n",
54 offset
, hw_offset
, header
, header
);
58 length
= v3d_group_get_length(inst
);
60 fprintf(stderr
, "0x%08x 0x%08x: 0x%02x %s\n",
61 offset
, hw_offset
, header
, v3d_group_get_name(inst
));
63 v3d_print_group(stderr
, inst
, offset
, p
, "");
67 case VC4_PACKET_STORE_MS_TILE_BUFFER_AND_EOF
:
74 if (header
!= VC4_PACKET_GEM_HANDLES
)