summaryrefslogtreecommitdiff
path: root/src/intel/genxml/gen_bits_header.py
AgeCommit message (Collapse)AuthorFilesLines
2019-09-23intel/genxml: Stop manually scrubbing 'α' -> "alpha"Kenneth Graunke1-1/+1
'α' has never appeared in any genxml files, so there's no need to replace it with the word "alpha". Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
2019-08-28intel/genxml: Build gen12 genxmlJordan Justen1-0/+1
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-08-28intel/genxml: Handle field names with different spacing/hyphenJordan Justen1-3/+4
If a field name differs slightly between two generations then this change will still add the fields into the same group. For example, these will be treated as equal: * "Software Exception" and "Software Exception" * "Per Thread" and "Per-Thread" Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-03-28intel/genxml: Only handle instructions meant for render engine when generatingToni Lönnberg1-1/+17
headers v2: Fixed the check for engine v3: Changed engine into an argument given to the scripts Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2019-02-21genxml/gen_bits_header.py: Use regex to strip no alphanum charsJordan Justen1-26/+4
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2018-08-16intel: various python cleanupsEric Engestrom1-1/+0
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-08-01python: Open file in binary modeMathieu Bridon1-1/+1
The XML parser wants byte strings, not unicode strings. In both Python 2 and 3, opening a file without specifying the mode will open it for reading in text mode ('r'). On Python 2, the read() method of the file object will return byte strings, while on Python 3 it will return unicode strings. Explicitly specifying the binary mode ('rb') makes the behaviour identical in both Python 2 and 3, returning what the XML parser expects. Signed-off-by: Mathieu Bridon <bochecha@daitauha.fr> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2018-07-24python: Better iterate over dictionariesMathieu Bridon1-5/+5
In Python 2, dictionaries have 2 sets of methods to iterate over their keys and values: keys()/values()/items() and iterkeys()/itervalues()/iteritems(). The former return lists while the latter return iterators. Python 3 dropped the method which return lists, and renamed the methods returning iterators to keys()/values()/items(). Using those names makes the scripts compatible with both Python 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>
2018-03-05intel: Split gen_device_info out into libintel_devJordan Justen1-1/+1
Split out the device info so isl doesn't depend on intel/common. Now it will depend on the new intel/dev device info lib. This will allow the decoder in intel/common to use isl, allowing us to apply Ken's patch that removes the genxml duplication of surface formats. Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2018-02-15intel/genxml/icl: Update genx_bits headerAnuj Phogat1-0/+1
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-06-09intel/genxml: Update genx_bits for gen10+Anuj Phogat1-4/+2
This commit adds a gen10 case to the switch statement and drops some unneeded code for handling gen numbers which doesn't work on gen10 and above. V2: Drop "z = float(z)" and the "z *= 10" lines Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-04-07intel/genxml/bits: Emit per-container _length helpersJason Ekstrand1-0/+34
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-04-07intel/genxml/bits: Emit per-field _start helpersJason Ekstrand1-0/+8
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-04-07intel/genxml/bits: Pull the function emit code into a helper blockJason Ekstrand1-26/+43
The helper block is extremely general. It takes an string property name and an object that supports three methods: has_prop, iter_prop, and get_prop. This way we can easily generalize it to emit more different types of getter functions. Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-04-07intel/genxml/bits: Refactor to add a container classJason Ekstrand1-20/+36
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
2017-03-28genxml: New generated header genX_bits.h (v6)Chad Versace1-0/+281
genX_bits.h contains the sizes of bitfields in genxml instructions, structures, and registers. It also defines some functions to query those sizes. isl_surf_init() will use the new header to validate that requested pitches fit in their destination bitfields. What's currently in genX_bits.h: - Each CONTAINER::Field from gen*.xml that has a bitsize has a macro in genX_bits.h: #define GEN{N}_CONTAINER_Field_bits {bitsize} - For each set of macros whose name, after stripping the GEN prefix, is the same, genX_bits.h contains a query function: static inline uint32_t __attribute__((pure)) CONTAINER_Field_bits(const struct gen_device_info *devinfo); v2 (Chad Versace): - Parse the XML instead of scraping the generated gen*_pack.h headers. v3 (Dylan Baker): - Port to Mako. v4 (Jason Ekstrand): - Make the _bits functions take a gen_device_info. v5 (Chad Versace): - Fix autotools out-of-tree build. - Fix Android build. Tested with git://github.com/android-ia/manifest. - Fix macro names. They were all missing the "_bits" suffix. - Fix macros names more. Remove all double-underscores. - Unindent all generated code. (It was floating in a sea of whitespace). - Reformat header to appear human-written not machine-generated. - Sort gens from high to low. Newest gens should come first because, when we read code, we likely want to read the gen8/9 code and ignore the gen4 code. So put the gen4 code at the bottom. - Replace 'const' attributes with 'pure', because the functions now have a pointer parameter. - Add --cpp-guard flag. Used by Android. - Kill class FieldCollection. After Jason's rewrite, it was just a dict. v6 (Chad Versace): - Replace `key not in d.keys()` with `key not in d`. [for dylan] Co-authored-by: Dylan Baker <dylan@pnwbakers.com> Co-authored-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v5) Reviewed-by: Dylan Baker <dylan@pnwbakers.com> (v6)