summaryrefslogtreecommitdiff
path: root/src/intel/genxml/gen_pack_header.py
AgeCommit message (Collapse)AuthorFilesLines
2019-03-28intel/genxml: Only handle instructions meant for render engine when generatingToni Lönnberg1-6/+42
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>
2018-08-21intel/genxml: minor python style fixEric Engestrom1-1/+1
Suggested-by: Dylan Baker <dylan@pnwbakers.com> Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
2018-08-16intel: various python cleanupsEric Engestrom1-15/+14
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2018-05-07intel/genxml: Assert that genxml field start and ends are sane.Kenneth Graunke1-0/+7
Chris recently fixed a bunch of genxml end < start bugs, as well as booleans that are wider than a bit. These are way too easy to write, so asserting that the fields are sane is a good plan. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Acked-by: Jason Ekstrand <jason@jlekstrand.net>
2018-05-07intel/genxml: Make assert in gen_pack_header print a message.Kenneth Graunke1-1/+1
Python's assert can take both a condition and a string, which will cause it to print the string if the assertion trips. (You can't use parens as that creates a tuple.) Doing "condition and string" works in C, but doesn't have the desired effect in Python. Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2018-05-04intel/genxml: recognize 0x, 0o and 0b when setting default valueCaio Marcelo de Oliveira Filho1-1/+2
Remove the need of converting values that are documented in hexadecimal. This patch would allow writing <field name="3D Command Sub Opcode" ... default="0x1B"/> instead of <field name="3D Command Sub Opcode" ... default="27"/> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2018-04-05genxml: Preserve fields that share dword space with addresses.Rafael Antognolli1-2/+6
Some instructions contain fields that are either an address or a value of some type based on the content of other fields, such as clear color values vs address. That works fine if these fields are in the less significant dword, the lower 32 bits of the address, because they get OR'ed with the address. But if they are in the higher 32 bits, they get discarded. On Gen10 we have fields that share space with the higher 16 bits of the address too. This commit makes sure those fields don't get discarded. v5: Remove spurious whitespace (Jason). Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2018-03-02genxml: Silence unused parameter warnings in generated pack codeIan Romanick1-3/+11
Reduces my build from 1960 warnings to 1808 warnings by silencing 152 instances of things like In file included from ../../SOURCE/master/src/intel/genxml/genX_pack.h:32:0, from ../../SOURCE/master/src/intel/isl/isl_emit_depth_stencil.c:36: src/intel/genxml/gen4_pack.h: In function ‘__gen_uint’: src/intel/genxml/gen4_pack.h:58:49: warning: unused parameter ‘end’ [-Wunused-parameter] __gen_uint(uint64_t v, uint32_t start, uint32_t end) ^~~ src/intel/genxml/gen4_pack.h: In function ‘__gen_offset’: src/intel/genxml/gen4_pack.h:94:35: warning: unused parameter ‘start’ [-Wunused-parameter] __gen_offset(uint64_t v, uint32_t start, uint32_t end) ^~~~~ src/intel/genxml/gen4_pack.h:94:51: warning: unused parameter ‘end’ [-Wunused-parameter] __gen_offset(uint64_t v, uint32_t start, uint32_t end) ^~~ src/intel/genxml/gen4_pack.h: In function ‘__gen_ufixed’: src/intel/genxml/gen4_pack.h:133:48: warning: unused parameter ‘end’ [-Wunused-parameter] __gen_ufixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits) ^~~ Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
2017-11-23genxml: fix assert guardsEric Engestrom1-5/+5
This removes a few hundred warnings on debug builds with asserts off. Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-11-21intel/genxml: Add helpers for determining field typeKristian H. Kristensen1-6/+17
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-09-26intel/genxml: Convert a not-present-or-"1" dict to a set.Eric Anholt1-2/+3
I was implementing the same enum support in broadcom's gen_pack_header.py, and did this same simplification there. Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-06-28genxml: Silence about a billion unused parameter warningsIan Romanick1-2/+7
v2: Use textwrap.dedent to make the source line a lot shorter. Shortening (?) the line was requested by Jason. v3: Simplify the texwrap.dedent usage. Suggested by Dylan. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2017-06-01genxml: Fix parsing of address fields in groups.Kenneth Graunke1-2/+2
For example, <group count="4" start="64" size="64"> <field name="Pointer" start="5" end="63" type="address"/> </group> used to generate: const uint64_t v2_address = __gen_combine_address(data, &dw[2], values->Pointer, 0); ... const uint64_t v4_address = __gen_combine_address(data, &dw[4], values->Pointer, 0); ... but now generates code with proper subscripts: const uint64_t v2_address = __gen_combine_address(data, &dw[2], values->Pointer[0], 0); ... const uint64_t v4_address = __gen_combine_address(data, &dw[4], values->Pointer[1], 0); ... Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-04-24genxml: Fix gen_pack_header.py crash when field type is invalid.Rafael Antognolli1-2/+2
Just return earlier in that case. Also set prefix to an empty string, so we don't get to use it undefined. Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-04-24genxml: Fix python crash when no dwords are found.Rafael Antognolli1-5/+12
If the 'dwords' dict is empty, max(dwords.keys()) throws an exception. This case could happen when we have an instruction that is only an array of other structs, with variable length. v2: - Add another clause for empty dwords and make it work with python 3 (Dylan) - Set the length to 0 if dwords is empty, and do not declare dw Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-04-24genxml: Remove unused parameter.Rafael Antognolli1-2/+2
'start' parameter from Group.emit_pack_function() is useless. Signed-off-by: Rafael Antognolli <rafael.antognolli@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2017-04-20genxml/pack: Allow hex values in the XMLJason Ekstrand1-1/+2
Acked-by: Kenneth Graunke <kenneth@whitecape.org> Reviewed by: Iago Toral Quiroga <itoral@igalia.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2017-03-13intel: genxml: prevent missing ; with address fields dwordsLionel Landwerlin1-28/+26
Before this change, the generator could print this kind of things : const uint32_t v0 = __gen_uint(values->ValidBit, 0, 0) | __gen_uint(values->FaultType, 1, 2) | __gen_uint(values->SRCIDofFault, 3, 10) | __gen_uint(values->GTTSEL, 11, 1) | dw[0] = __gen_combine_address(data, &dw[0], values->VirtualAddressofFault, v0); This change fix the trailing '|'. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2017-03-10genxml: remove shebang from gen_pack_header.pyEmil Velikov1-1/+0
Analogous to earlier commit(s). Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
2016-11-29intel/genxml: Emit genxml enums as C enumsKristian H. Kristensen1-4/+4
The previous commits got rid of any clashes between #defines and enum values and we can now emit the genxml enums as debugger friendly C enums. Signed-off-by: Kristian H. Kristensen <hoegsberg@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-11-29intel/genxml: Allow referencing enums in type attributesKristian H. Kristensen1-0/+7
This lets us reference enums in the type attribute of a field. Signed-off-by: Kristian H. Kristensen <hoegsberg@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-14intel/genxml: use correct header guardsEmil Velikov1-8/+14
Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Chad Versace <chadversary@chromium.org>
2016-05-31genxml: change chbang to python 2Dylan Baker1-1/+1
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> cc: 12.0 <mesa-stable@lists.freedesktop.org>
2016-05-31genxml: use the isalpha method rather than str.isalpha.Dylan Baker1-1/+1
This fixes gen_pack_header to work on python 2, where name[0] is unicode not str. Signed-off-by: Dylan Bake <dylanx.c.baker@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> cc: 12.0 <mesa-stable@lists.freedesktop.org>
2016-05-31genxml: require future imports for python2 compatibility.Dylan Baker1-0/+3
Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> cc: 12.0 <mesa-stable@lists.freedesktop.org>
2016-05-31genxml: mark re strings as rawDylan Baker1-2/+2
This is a correctness issue. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> cc: 12.0 <mesa-stable@lists.freedesktop.org>
2016-05-31genxml: Make classes descendants of objectDylan Baker1-4/+4
This is the default in python3, but in python2 you get old style classes. No one likes old-style classes. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> cc: 12.0 <mesa-stable@lists.freedesktop.org>
2016-05-31genxml: mark gen_pack_header.py as encoded in utf-8Dylan Baker1-0/+1
There is unicode in this file, and I'm actually surprised that the python interpreter hasn't gotten grumpy. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> cc: 12.0 <mesa-stable@lists.freedesktop.org>
2016-05-16genxml: Use llroundf() and store to appropriate type.Matt Turner1-2/+2
Both functions return uint64_t, so I expect the masking/shifting should be done on 64-bit types. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2016-04-23genxml: use PYTHON3Jonathan Gray1-0/+0
Allows the build to work when the python3 binary is not "python3". v2: remove x bit from the script at Emil's suggestion Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
2016-03-24genxml: Add register supportJordan Justen1-19/+43
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
2016-02-20genxml: Add mote includes in the generated headersJason Ekstrand1-0/+3
2016-02-19genxml: Stop using unicode in the pack generatorJason Ekstrand1-1/+1
This causes python problems and problems when people don't have a locale set properly in their shell.
2016-02-19anv: fix warning about unused width variable.Dave Airlie1-2/+1
We don't use width outside the debug clause here.
2016-02-18vulkan: Move XML and generator into src/intel/genxmlJason Ekstrand1-0/+614