summaryrefslogtreecommitdiffstats
path: root/src/broadcom/cle/v3d_decoder.c
Commit message (Collapse)AuthorAgeFilesLines
* v3d: Fix a release build set-but-unused compiler warning.Eric Anholt2019-01-291-1/+2
|
* v3d: Actually put the "%s" in the snprintf.Eric Anholt2018-08-011-1/+1
| | | | | | | | I missed an important part when porting the change over, fixing my compiler warning but breaking -Werror=format-security. Fixes: e6ff5ac4468e ("v3d: use snprintf(..., "%s", ...) instead of strncpy") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107443
* v3d: use snprintf(..., "%s", ...) instead of strncpyEric Anholt2018-07-311-1/+1
| | | | | Fixes a compiler warning about terminator NUL, based on f836d799f906 ("intel/decoder: use snprintf(..., "%s", ...) instead of strncpy")
* v3d: Use a short, underscored name for packets in CLIF/CL dumping.Eric Anholt2018-07-301-1/+3
| | | | | | | These will match the names that the CLIF parser expects to see. I may in the future decide to change more of the other names so that I match the names the HW/closed SW team uses for their packets, rather than the names in the spec (which only they and I can read anyway).
* v3d: Print CLIF fixed-point values as just their decimal value.Eric Anholt2018-07-301-6/+16
| | | | The parser doesn't handle float input, so we have to dump the raw value.
* v3d: When not doing terminal pretty-printing, comment struct field names.Eric Anholt2018-07-301-1/+7
| | | | | The struct field names aren't part of the CLIF ABI, just the order of fields within the struct. The comments are there for human readability.
* v3d: Add pack header support for f187 values.Eric Anholt2018-07-301-0/+7
| | | | | | V3D only has one of these (the top 16 bits of a float32) left in its CLs, but VC4 had many more. This gets us proper pretty-printing of the values instead of a large uint.
* v3d: Skip printing sub-id or pad fields in CLIF dumping.Eric Anholt2018-07-271-0/+8
| | | | | The parser doesn't expect them, so our fields would end up mismatched. They're not really useful in console output, either.
* v3d: Dump fields in CLIF output in increasing offset order.Eric Anholt2018-07-271-0/+14
| | | | | | Previously, we emitted in XML order, which I happen to type in the decreasing offset order of the specifications. However, the CLIF parser wants increasing offsets.
* v3d: Print addresses in CLIFs as references to buffers.Eric Anholt2018-07-271-3/+22
| | | | | | | With CLIFs, the parser will choose an address for the buffer being created, so we need to use effectively relocations to buffers instead of the addresses that the driver uses. This is also a whole lot more intelligible for console output than raw addresses!
* v3d: Stop doing pretty-printed colorful booleans in CLIF output.Eric Anholt2018-07-271-11/+6
| | | | | The parser wants to see a 1 or 0. We can put "true" and "false" in a comment to clarify that it's a boolean and the parser will skip it.
* v3d: Pass the whole clif_dump structure to v3d_print_group().Eric Anholt2018-07-271-3/+4
| | | | | | To generate CLIF files that the v3dv3 simulator can parse, we're going to need to decode addresses, and for that we'll need the vaddr lookup function from the clif structure from within v3d_decoder.
* v3d: Use /* */ instead of () for enum names in CLIF output.Eric Anholt2018-07-271-1/+1
| | | | This lets the comments be ignored by the CLIF parser.
* v3d: CLIF-dump the "Vec size" field as 0 == maximum value.Eric Anholt2018-07-271-0/+2
| | | | | That's what a user should want to see, and what the CLIF parser wants. This should maybe be generalized.
* v3d: Switch v3d_decoder.c to the XML's top min_ver/max_ver fields.Eric Anholt2018-06-291-2/+10
| | | | | | | The XML zipper wants one XML per version for filling out its tables, but we want to do more than one GPU version per XML now. Assume that the "gen" field will be the same as min_ver and look up our XML text assuming that they're listed in increasing min_ver.
* v3d: Create XML fields for min_ver and max_ver of a packet/struct/enum.Eric Anholt2018-06-291-0/+43
| | | | | This will be used to merge together the V3D 3.3-4.1 XML with the variants disabled based on the version.
* v3d: Add pack/unpack/decode support for fields with a "- 1" modifier.Eric Anholt2018-06-271-0/+11
| | | | | | | | | | Right now, we name these fields as "field name minus one" so that your C code obviously states what the value should be. However, it's easy enough to handle at the codegen level with another little XML attribute, meaning less C code and easier-to-read values in CLIF dumping and gdb as well. (The actual CLIF format for simulator and FPGA replay takes in pre-minus-one values, so we need it there too).
* broadcom/genxml: Fix decoding of groups with small fields.Kenneth Graunke2017-11-071-2/+4
| | | | | | | | | | | | | | | | | Groups containing fields smaller than a byte probably not being decoded correctly. For example: <group count="32" start="32" size="4"> <field name="Vertex Element Enables" start="0" end="3" type="uint"/> </group> gen_field_iterator_next would properly walk over each element of the array, incrementing group_iter. However, the code to print the actual values only considered iter->field->start/end, which are 0 and 3 in the above example. So it would always fetch bits 3:0 of the current byte, printing the same value over and over. Cc: Eric Anholt <[email protected]>
* broadcom/genxml: Check the sub-id field when decoding instructions.Eric Anholt2017-08-181-5/+26
| | | | | | VC5 introduces packet variants where the same opcode has behavior that is decided by a sub-id field in the early bits of the packet. Keep iterating over packets until we find the one with the matching sub-id.
* broadcom/genxml: Support address fields with <32 bitsEric Anholt2017-07-251-1/+1
| | | | | | | | | | I was writing the XML such that the address field overlapped various flags in the alignment bits, which caused pain when trying to unpack for decode. Instead, keep the XML matching the docs (address fields don't overlap), and just infer the appropriate shift value during decode. During pack, the address is just applied to the appropriate bits already, ignoring the sub-byte start/end fields.
* broadcom/genxml: Introduce a V3D packet/struct decoder.Eric Anholt2017-07-251-0/+855
This is copied from Intel's XML decoder, modified to handle V3D's byte-oriented packets. v2: Squash in robher's fixes for Android