Commit Graph

18 Commits

Author SHA1 Message Date
Eric Engestrom f1eae2f8bb python: drop python2 support
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3674>
2021-08-14 21:44:32 +00:00
Kenneth Graunke a733423da5 broadcom/genxml: Stop manually scrubbing 'α' -> "alpha"
'α' has never appeared in any genxml files, so there's no need to
replace it with the word "alpha".

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-09-23 20:24:54 +00:00
Alejandro Piñeiro c2ff38d2df v3d: tweak initial comment on pack generator script
As the files it mentions to use as reference has slightly different
names.

Reviewed-by: Eric Anholt <eric@anholt.net>
2019-07-12 11:48:09 +02:00
Eric Anholt 89ac6fa403 v3d: Add pack header support for f187 values.
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.
2018-07-30 14:29:01 -07:00
Mathieu Bridon 9ebd8372b9 python: Use range() instead of xrange()
Python 2 has a range() function which returns a list, and an xrange()
one which returns an iterator.

Python 3 lost the function returning a list, and renamed the function
returning an iterator as range().

As a result, using range() makes the scripts compatible with both Python
versions 2 and 3.

Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2018-07-24 11:07:04 -07:00
Eric Anholt f8af5c58c3 v3d: Create XML fields for min_ver and max_ver of a packet/struct/enum.
This will be used to merge together the V3D 3.3-4.1 XML with the variants
disabled based on the version.
2018-06-29 13:36:28 -07:00
Eric Anholt 6f7ad7ed11 v3d: Pass the version being generated to the pack generator script.
It turns out that most V3D versions change very few packets, so keeping
separate copies of the XML per version makes changing the XML a pain as
you have to replicate your changes to each one.  This is the start of
changing it so that one XML can generate headers for multiple versions.
2018-06-29 13:36:28 -07:00
Eric Anholt 18b1bb0b63 v3d: Add pack/unpack/decode support for fields with a "- 1" modifier.
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).
2018-06-27 09:13:48 -07:00
Eric Anholt 2b1b2cbf61 v3d: Be more explicit about include directory from our generated code.
You'd need src/broadcom/cle/ in the -I previously, for srcdir != builddir.
nir was fine at that, but automake didn't have it.

Bugzilla: https://github.com/anholt/mesa/issues/104
2018-06-05 12:44:49 -07:00
Eric Anholt 7dedfd9660 broadcom/cle: Fix error path of missing a "type" in the XML.
We try to emit a #error and continue so that you can debug the missing
type at C compile time, but were missing a couple of definitions in that
path (sigh, python).
2018-01-12 21:51:34 -08:00
Eric Anholt d3e8a4b96c broadcom/xml: Fix up safe name confusion with prefixing.
For enums we were doubling the underscore if the value had a numeric first
character of its name (which safe_name() adds an underscore to).  A little
helper function cleans up the other instance of prefixing while also
fixing this.
2018-01-03 14:25:23 -08:00
Eric Anholt d0f7053369 broadcom/xml: Fix address packing for address with >= 8 alignment bits.
We were handing the intra-byte padding fine, but with a 24-bit address
(bottom 8 bits implied 0) we would end up off by 8 bytes in our shift,
impacting vc5's load/store general packets (all other packets we have had
<8 bits of padding).
2017-10-30 13:31:16 -07:00
Eric Anholt 443e1984d2 broadcom/xml: Throw an #error in XML-based codegen for a >1bit bool
I've debugged two nasty errors now due to copy-and-pasting a bool type
when writing a uint field.  Make sure I don't do that again.
2017-10-30 13:31:12 -07:00
Eric Anholt af3c521528 broadcom/genxml: Add support for enum-typed fields.
This basically comes from the intel genxml script.  This will help improve
gdb and CLIF output once we convert fields over.
2017-09-19 10:40:55 -07:00
Eric Anholt 14fe9fd3f7 broadcom/genxml: Emit code for default headers for structs as well.
In the vc5 NIR backend, I want to use the XML code-generation to set up
pack/unpack of structs for the texture uniforms, and setting up the
unpacked copy needs a default header.
2017-08-18 11:56:58 -07:00
Eric Anholt fd37ce6bec broadcom/genxml: Use the same "gen" attr for HW version as Intel does.
This will let us reuse their tools more easily.
2017-07-13 11:28:28 -07:00
Eric Anholt ee170c9d83 broadcom/genxml: Support unpacking fixed-point fractional values.
This was an oversight in the original XML support, because unpacking
wasn't used much.  The new XML-based CL dumper will want it, though.
2017-07-13 11:28:28 -07:00
Eric Anholt 7f80a9ff13 vc4: Introduce XML-based packet header generation like Intel's.
I really liked this idea, as it should help with management of packet
parsing tools like the CL dump.  The python script is forked off of theirs
because our packets are byte-based instead of dwords, and the changes to
do so while avoiding performance regressions due to unaligned accesses
were quite invasive.

v2: Fix Android.mk paths, drop shebang for python script, fix overlap
    detection.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Rob Herring <robh@kernel.org>
2017-06-30 12:25:45 -07:00