diff options
author | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-01-08 05:41:34 +0000 |
---|---|---|
committer | Jonathan Gray <jsg@cvs.openbsd.org> | 2018-01-08 05:41:34 +0000 |
commit | c00801de923e125863aaf8180439d59d610b2517 (patch) | |
tree | e2896aa2785f3cf2151aeeb3c95fb5cc09a2fe02 /lib/mesa/src/broadcom/cle | |
parent | be30e6efb92db21299b936c0e068e7088941e9c9 (diff) |
Revert to Mesa 13.0.6 again.
Corruption has again been reported on Intel hardware running Xorg with
the modesetting driver (which uses OpenGL based acceleration instead of
SNA acceleration the intel driver defaults to).
Reported in various forms on Sandy Bridge (X220), Ivy Bridge (X230) and
Haswell (X240). Confirmed to not occur with the intel driver but the
xserver was changed to default to the modesetting driver on >= gen4
hardware (except Ironlake).
One means of triggering this is to open a large pdf with xpdf on an
idle machine and highlight a section of the document.
There have been reports of gpu hangs on gen4 intel hardware
(T500 with GM45, X61 with 965GM) when starting Xorg as well.
Diffstat (limited to 'lib/mesa/src/broadcom/cle')
-rw-r--r-- | lib/mesa/src/broadcom/cle/gen_pack_header.py | 551 | ||||
-rw-r--r-- | lib/mesa/src/broadcom/cle/v3d_packet_helpers.h | 205 | ||||
-rw-r--r-- | lib/mesa/src/broadcom/cle/v3d_packet_v21.xml | 334 | ||||
-rw-r--r-- | lib/mesa/src/broadcom/cle/v3d_packet_v21_pack.h | 1689 |
4 files changed, 0 insertions, 2779 deletions
diff --git a/lib/mesa/src/broadcom/cle/gen_pack_header.py b/lib/mesa/src/broadcom/cle/gen_pack_header.py deleted file mode 100644 index 1ebeec7a7..000000000 --- a/lib/mesa/src/broadcom/cle/gen_pack_header.py +++ /dev/null @@ -1,551 +0,0 @@ -#encoding=utf-8 - -# Copyright (C) 2016 Intel Corporation -# Copyright (C) 2016 Broadcom -# -# Permission is hereby granted, free of charge, to any person obtaining a -# copy of this software and associated documentation files (the "Software"), -# to deal in the Software without restriction, including without limitation -# the rights to use, copy, modify, merge, publish, distribute, sublicense, -# and/or sell copies of the Software, and to permit persons to whom the -# Software is furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice (including the next -# paragraph) shall be included in all copies or substantial portions of the -# Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS -# IN THE SOFTWARE. - -from __future__ import ( - absolute_import, division, print_function, unicode_literals -) -import xml.parsers.expat -import re -import sys -import copy - -license = """/* Generated code, see packets.xml and gen_packet_header.py */ -""" - -pack_header = """%(license)s - -/* Packets, enums and structures for %(platform)s. - * - * This file has been generated, do not hand edit. - */ - -#ifndef %(guard)s -#define %(guard)s - -#include "v3d_packet_helpers.h" - -""" - -def to_alphanum(name): - substitutions = { - ' ': '_', - '/': '_', - '[': '', - ']': '', - '(': '', - ')': '', - '-': '_', - ':': '', - '.': '', - ',': '', - '=': '', - '>': '', - '#': '', - 'α': 'alpha', - '&': '', - '*': '', - '"': '', - '+': '', - '\'': '', - } - - for i, j in substitutions.items(): - name = name.replace(i, j) - - return name - -def safe_name(name): - name = to_alphanum(name) - if not name[0].isalpha(): - name = '_' + name - - return name - -def num_from_str(num_str): - if num_str.lower().startswith('0x'): - return int(num_str, base=16) - else: - assert(not num_str.startswith('0') and 'octals numbers not allowed') - return int(num_str) - -class Field(object): - ufixed_pattern = re.compile(r"u(\d+)\.(\d+)") - sfixed_pattern = re.compile(r"s(\d+)\.(\d+)") - - def __init__(self, parser, attrs): - self.parser = parser - if "name" in attrs: - self.name = safe_name(attrs["name"]).lower() - - if str(attrs["start"]).endswith("b"): - self.start = int(attrs["start"][:-1]) * 8 - else: - self.start = int(attrs["start"]) - # packet <field> entries in XML start from the bit after the - # opcode, so shift everything up by 8 since we'll also have a - # Field for the opcode. - if not parser.struct: - self.start += 8 - - self.end = self.start + int(attrs["size"]) - 1 - self.type = attrs["type"] - - if "prefix" in attrs: - self.prefix = safe_name(attrs["prefix"]).upper() - else: - self.prefix = None - - if "default" in attrs: - self.default = int(attrs["default"]) - else: - self.default = None - - ufixed_match = Field.ufixed_pattern.match(self.type) - if ufixed_match: - self.type = 'ufixed' - self.fractional_size = int(ufixed_match.group(2)) - - sfixed_match = Field.sfixed_pattern.match(self.type) - if sfixed_match: - self.type = 'sfixed' - self.fractional_size = int(sfixed_match.group(2)) - - def emit_template_struct(self, dim): - if self.type == 'address': - type = '__gen_address_type' - elif self.type == 'bool': - type = 'bool' - elif self.type == 'float': - type = 'float' - elif self.type == 'ufixed': - type = 'float' - elif self.type == 'sfixed': - type = 'float' - elif self.type == 'uint' and self.end - self.start > 32: - type = 'uint64_t' - elif self.type == 'offset': - type = 'uint64_t' - elif self.type == 'int': - type = 'int32_t' - elif self.type == 'uint': - type = 'uint32_t' - elif self.type in self.parser.structs: - type = 'struct ' + self.parser.gen_prefix(safe_name(self.type)) - elif self.type == 'mbo': - return - else: - print("#error unhandled type: %s" % self.type) - - print(" %-36s %s%s;" % (type, self.name, dim)) - - if len(self.values) > 0 and self.default == None: - if self.prefix: - prefix = self.prefix + "_" - else: - prefix = "" - - for value in self.values: - print("#define %-40s %d" % ((prefix + value.name).replace("__", "_"), - value.value)) - - def overlaps(self, field): - return self != field and max(self.start, field.start) <= min(self.end, field.end) - - -class Group(object): - def __init__(self, parser, parent, start, count): - self.parser = parser - self.parent = parent - self.start = start - self.count = count - self.size = 0 - self.fields = [] - - def emit_template_struct(self, dim): - if self.count == 0: - print(" /* variable length fields follow */") - else: - if self.count > 1: - dim = "%s[%d]" % (dim, self.count) - - for field in self.fields: - field.emit_template_struct(dim) - - class Byte: - def __init__(self): - self.size = 8 - self.fields = [] - self.address = None - - def collect_bytes(self, bytes): - for field in self.fields: - first_byte = field.start // 8 - last_byte = field.end // 8 - - for b in xrange(first_byte, last_byte + 1): - if not b in bytes: - bytes[b] = self.Byte() - - bytes[b].fields.append(field) - - if field.type == "address": - # assert bytes[index].address == None - bytes[b].address = field - - def emit_pack_function(self, start): - # Determine number of bytes in this group. - self.length = max(field.end // 8 for field in self.fields) + 1 - - bytes = {} - self.collect_bytes(bytes) - - relocs_emitted = set() - memcpy_fields = set() - - for index in range(self.length): - # Handle MBZ bytes - if not index in bytes: - print(" cl[%2d] = 0;" % index) - continue - byte = bytes[index] - - # Call out to the driver to note our relocations. Inside of the - # packet we only store offsets within the BOs, and we store the - # handle to the packet outside. Unlike Intel genxml, we don't - # need to have the other bits that will be stored together with - # the address during the reloc process, so there's no need for the - # complicated combine_address() function. - if byte.address and byte.address not in relocs_emitted: - print(" __gen_emit_reloc(data, &values->%s);" % byte.address.name) - relocs_emitted.add(byte.address) - - # Special case: floats can't have any other fields packed into - # them (since they'd change the meaning of the float), and the - # per-byte bitshifting math below bloats the pack code for floats, - # so just copy them directly here. Also handle 16/32-bit - # uints/ints with no merged fields. - if len(byte.fields) == 1: - field = byte.fields[0] - if field.type in ["float", "uint", "int"] and field.start % 8 == 0 and field.end - field.start == 31: - if field in memcpy_fields: - continue - - if not any(field.overlaps(scan_field) for scan_field in self.fields): - assert(field.start == index * 8) - print("") - print(" memcpy(&cl[%d], &values->%s, sizeof(values->%s));" % - (index, field.name, field.name)) - memcpy_fields.add(field) - continue - - byte_start = index * 8 - - v = None - prefix = " cl[%2d] =" % index - - field_index = 0 - for field in byte.fields: - if field.type != "mbo": - name = field.name - - start = field.start - end = field.end - field_byte_start = (field.start // 8) * 8 - start -= field_byte_start - end -= field_byte_start - - if field.type == "mbo": - s = "__gen_mbo(%d, %d)" % \ - (start, end) - elif field.type == "address": - s = "__gen_address_offset(&values->%s)" % byte.address.name - elif field.type == "uint": - s = "__gen_uint(values->%s, %d, %d)" % \ - (name, start, end) - elif field.type == "int": - s = "__gen_sint(values->%s, %d, %d)" % \ - (name, start, end) - elif field.type == "bool": - s = "__gen_uint(values->%s, %d, %d)" % \ - (name, start, end) - elif field.type == "float": - s = "#error %s float value mixed in with other fields" % name - elif field.type == "offset": - s = "__gen_offset(values->%s, %d, %d)" % \ - (name, start, end) - elif field.type == 'ufixed': - s = "__gen_ufixed(values->%s, %d, %d, %d)" % \ - (name, start, end, field.fractional_size) - elif field.type == 'sfixed': - s = "__gen_sfixed(values->%s, %d, %d, %d)" % \ - (name, start, end, field.fractional_size) - elif field.type in self.parser.structs: - s = "__gen_uint(v%d_%d, %d, %d)" % \ - (index, field_index, start, end) - field_index = field_index + 1 - else: - print("/* unhandled field %s, type %s */\n" % (name, field.type)) - s = None - - if not s == None: - if byte_start - field_byte_start != 0: - s = "%s >> %d" % (s, byte_start - field_byte_start) - - if field == byte.fields[-1]: - print("%s %s;" % (prefix, s)) - else: - print("%s %s |" % (prefix, s)) - prefix = " " - - print("") - continue - - def emit_unpack_function(self, start): - for field in self.fields: - if field.type != "mbo": - convert = None - - args = [] - args.append('cl') - args.append(str(start + field.start)) - args.append(str(start + field.end)) - - if field.type == "address": - convert = "__gen_unpack_address" - elif field.type == "uint": - convert = "__gen_unpack_uint" - elif field.type == "int": - convert = "__gen_unpack_sint" - elif field.type == "bool": - convert = "__gen_unpack_uint" - elif field.type == "float": - convert = "__gen_unpack_float" - elif field.type == "offset": - convert = "__gen_unpack_offset" - elif field.type == 'ufixed': - args.append(str(field.fractional_size)) - convert = "__gen_unpack_ufixed" - elif field.type == 'sfixed': - args.append(str(field.fractional_size)) - convert = "__gen_unpack_sfixed" - else: - print("/* unhandled field %s, type %s */\n" % (name, field.type)) - s = None - - print(" values->%s = %s(%s);" % \ - (field.name, convert, ', '.join(args))) - -class Value(object): - def __init__(self, attrs): - self.name = safe_name(attrs["name"]).upper() - self.value = int(attrs["value"]) - -class Parser(object): - def __init__(self): - self.parser = xml.parsers.expat.ParserCreate() - self.parser.StartElementHandler = self.start_element - self.parser.EndElementHandler = self.end_element - - self.packet = None - self.struct = None - self.structs = {} - self.registers = {} - - def gen_prefix(self, name): - if name[0] == "_": - return 'V3D%s%s' % (self.ver, name) - else: - return 'V3D%s_%s' % (self.ver, name) - - def gen_guard(self): - return self.gen_prefix("PACK_H") - - def start_element(self, name, attrs): - if name == "vcxml": - self.platform = "V3D {}".format(attrs["gen"]) - self.ver = attrs["gen"].replace('.', '') - print(pack_header % {'license': license, 'platform': self.platform, 'guard': self.gen_guard()}) - elif name in ("packet", "struct", "register"): - default_field = None - - object_name = self.gen_prefix(safe_name(attrs["name"].upper())) - if name == "packet": - self.packet = object_name - - # Add a fixed Field for the opcode. We only make <field>s in - # the XML for the fields listed in the spec, and all of those - # start from bit 0 after of the opcode. - default_field = { - "name" : "opcode", - "default" : attrs["code"], - "type" : "uint", - "start" : -8, - "size" : 8, - } - elif name == "struct": - self.struct = object_name - self.structs[attrs["name"]] = 1 - elif name == "register": - self.register = object_name - self.reg_num = num_from_str(attrs["num"]) - self.registers[attrs["name"]] = 1 - - self.group = Group(self, None, 0, 1) - if default_field: - field = Field(self, default_field) - field.values = [] - self.group.fields.append(field) - - elif name == "field": - self.group.fields.append(Field(self, attrs)) - self.values = [] - elif name == "enum": - self.values = [] - self.enum = safe_name(attrs["name"]) - if "prefix" in attrs: - self.prefix = safe_name(attrs["prefix"]) - else: - self.prefix= None - elif name == "value": - self.values.append(Value(attrs)) - - def end_element(self, name): - if name == "packet": - self.emit_packet() - self.packet = None - self.group = None - elif name == "struct": - self.emit_struct() - self.struct = None - self.group = None - elif name == "register": - self.emit_register() - self.register = None - self.reg_num = None - self.group = None - elif name == "field": - self.group.fields[-1].values = self.values - elif name == "enum": - self.emit_enum() - self.enum = None - elif name == "vcxml": - print('#endif /* %s */' % self.gen_guard()) - - def emit_template_struct(self, name, group): - print("struct %s {" % name) - group.emit_template_struct("") - print("};\n") - - def emit_pack_function(self, name, group): - print("static inline void\n%s_pack(__gen_user_data *data, uint8_t * restrict cl,\n%sconst struct %s * restrict values)\n{" % - (name, ' ' * (len(name) + 6), name)) - - group.emit_pack_function(0) - - print("}\n") - - print('#define %-33s %6d' % - (name + "_length", self.group.length)) - - def emit_unpack_function(self, name, group): - print("#ifdef __gen_unpack_address") - print("static inline void") - print("%s_unpack(const uint8_t * restrict cl,\n%sstruct %s * restrict values)\n{" % - (name, ' ' * (len(name) + 8), name)) - - group.emit_unpack_function(0) - - print("}\n#endif\n") - - def emit_packet(self): - name = self.packet - - assert(self.group.fields[0].name == "opcode") - print('#define %-33s %6d' % - (name + "_opcode", self.group.fields[0].default)) - - default_fields = [] - for field in self.group.fields: - if not type(field) is Field: - continue - if field.default == None: - continue - default_fields.append(" .%-35s = %6d" % (field.name, field.default)) - - if default_fields: - print('#define %-40s\\' % (name + '_header')) - print(", \\\n".join(default_fields)) - print('') - - self.emit_template_struct(self.packet, self.group) - self.emit_pack_function(self.packet, self.group) - self.emit_unpack_function(self.packet, self.group) - - print('') - - def emit_register(self): - name = self.register - if not self.reg_num == None: - print('#define %-33s 0x%04x' % - (self.gen_prefix(name + "_num"), self.reg_num)) - - self.emit_template_struct(self.register, self.group) - self.emit_pack_function(self.register, self.group) - self.emit_unpack_function(self.register, self.group) - - def emit_struct(self): - name = self.struct - # Emit an empty header define so that we can use the CL pack functions - # with structs. - print('#define ' + name + '_header') - - self.emit_template_struct(self.struct, self.group) - self.emit_pack_function(self.struct, self.group) - self.emit_unpack_function(self.struct, self.group) - - print('') - - def emit_enum(self): - print('/* enum %s */' % self.gen_prefix(self.enum)) - for value in self.values: - if self.prefix: - name = self.prefix + "_" + value.name - else: - name = value.name - print('#define %-36s %6d' % (name.upper(), value.value)) - print('') - - def parse(self, filename): - file = open(filename, "rb") - self.parser.ParseFile(file) - file.close() - -if len(sys.argv) < 2: - print("No input xml file specified") - sys.exit(1) - -input_file = sys.argv[1] - -p = Parser() -p.parse(input_file) diff --git a/lib/mesa/src/broadcom/cle/v3d_packet_helpers.h b/lib/mesa/src/broadcom/cle/v3d_packet_helpers.h deleted file mode 100644 index c86cad852..000000000 --- a/lib/mesa/src/broadcom/cle/v3d_packet_helpers.h +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (C) 2016 Intel Corporation - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS - * IN THE SOFTWARE. - */ - -#include <stdio.h> -#include <stdint.h> -#include <stdbool.h> -#include <assert.h> -#include <math.h> - -#ifdef HAVE_VALGRIND -#include <valgrind.h> -#include <memcheck.h> -#define VG(x) x -#define __gen_validate_value(x) VALGRIND_CHECK_MEM_IS_DEFINED(&(x), sizeof(x)) -#else -#define VG(x) -#endif - -#ifndef __gen_validate_value -#define __gen_validate_value(x) -#endif -/* -#ifndef __gen_address_type -#error #define __gen_address_type before including this file -#endif - -#ifndef __gen_user_data -#error #define __gen_combine_address before including this file -#endif -*/ -union __gen_value { - float f; - uint32_t dw; -}; - -static inline uint64_t -__gen_mbo(uint32_t start, uint32_t end) -{ - return (~0ull >> (64 - (end - start + 1))) << start; -} - -static inline uint64_t -__gen_uint(uint64_t v, uint32_t start, uint32_t end) -{ - __gen_validate_value(v); - -#if DEBUG - const int width = end - start + 1; - if (width < 64) { - const uint64_t max = (1ull << width) - 1; - assert(v <= max); - } -#endif - - return v << start; -} - -static inline uint64_t -__gen_sint(int64_t v, uint32_t start, uint32_t end) -{ - const int width = end - start + 1; - - __gen_validate_value(v); - -#if DEBUG - if (width < 64) { - const int64_t max = (1ll << (width - 1)) - 1; - const int64_t min = -(1ll << (width - 1)); - assert(min <= v && v <= max); - } -#endif - - const uint64_t mask = ~0ull >> (64 - width); - - return (v & mask) << start; -} - -static inline uint64_t -__gen_offset(uint64_t v, uint32_t start, uint32_t end) -{ - __gen_validate_value(v); -#if DEBUG - uint64_t mask = (~0ull >> (64 - (end - start + 1))) << start; - - assert((v & ~mask) == 0); -#endif - - return v; -} - -static inline uint32_t -__gen_float(float v) -{ - __gen_validate_value(v); - return ((union __gen_value) { .f = (v) }).dw; -} - -static inline uint64_t -__gen_sfixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits) -{ - __gen_validate_value(v); - - const float factor = (1 << fract_bits); - -#if DEBUG - const float max = ((1 << (end - start)) - 1) / factor; - const float min = -(1 << (end - start)) / factor; - assert(min <= v && v <= max); -#endif - - const int64_t int_val = llroundf(v * factor); - const uint64_t mask = ~0ull >> (64 - (end - start + 1)); - - return (int_val & mask) << start; -} - -static inline uint64_t -__gen_ufixed(float v, uint32_t start, uint32_t end, uint32_t fract_bits) -{ - __gen_validate_value(v); - - const float factor = (1 << fract_bits); - -#if DEBUG - const float max = ((1 << (end - start + 1)) - 1) / factor; - const float min = 0.0f; - assert(min <= v && v <= max); -#endif - - const uint64_t uint_val = llroundf(v * factor); - - return uint_val << start; -} - -static inline uint64_t -__gen_unpack_uint(const uint8_t *restrict cl, uint32_t start, uint32_t end) -{ - uint64_t val = 0; - const int width = end - start + 1; - const uint32_t mask = (width == 32 ? ~0 : (1 << width) - 1 ); - - for (int byte = start / 8; byte <= end / 8; byte++) { - val |= cl[byte] << ((byte - start / 8) * 8); - } - - return (val >> (start % 8)) & mask; -} - -static inline uint64_t -__gen_unpack_sint(const uint8_t *restrict cl, uint32_t start, uint32_t end) -{ - int size = end - start + 1; - int64_t val = __gen_unpack_uint(cl, start, end); - - /* Get the sign bit extended. */ - return (val << (64 - size)) >> (64 - size); -} - -static inline float -__gen_unpack_sfixed(const uint8_t *restrict cl, uint32_t start, uint32_t end, - uint32_t fractional_size) -{ - int32_t bits = __gen_unpack_sint(cl, start, end); - return (float)bits / (1 << fractional_size); -} - -static inline float -__gen_unpack_ufixed(const uint8_t *restrict cl, uint32_t start, uint32_t end, - uint32_t fractional_size) -{ - int32_t bits = __gen_unpack_uint(cl, start, end); - return (float)bits / (1 << fractional_size); -} - -static inline float -__gen_unpack_float(const uint8_t *restrict cl, uint32_t start, uint32_t end) -{ - assert(start % 8 == 0); - assert(end - start == 31); - - struct PACKED { float f; } *f = (void *)(cl + (start / 8)); - - return f->f; -} - diff --git a/lib/mesa/src/broadcom/cle/v3d_packet_v21.xml b/lib/mesa/src/broadcom/cle/v3d_packet_v21.xml deleted file mode 100644 index 350cf294b..000000000 --- a/lib/mesa/src/broadcom/cle/v3d_packet_v21.xml +++ /dev/null @@ -1,334 +0,0 @@ -<vcxml gen="2.1"> - <packet name="Halt" code="0"/> - <packet name="NOP" code="1"/> - <packet name="Flush" code="4" cl="B"/> - <packet name="Flush All State" code="5" cl="B"/> - <packet name="Start Tile Binning" code="6" cl="B"/> - <packet name="Increment Semaphore" code="7"/> - <packet name="Wait on Semaphore" code="8"/> - <packet name="Branch" code="16"> - <field name="Address" size="32" start="0" type="address"/> - </packet> - <packet name="Branch to sub-list" code="17"> - <field name="Address" size="32" start="0" type="address"/> - </packet> - <packet name="Return from sub-list" code="18"/> - - <packet name="Store Multi-sample Resolved Tile Color Buffer" code="24" cl="R"/> - <packet name="Store Multi-sample Resolved Tile Color Buffer and EOF" code="25" cl="R"/> - - <packet name="Store Full Resolution Tile Buffer" cl="R" code="26"> - <field name="Address" size="32" start="0" type="address"/> - <field name="Last Tile" size="1" start="3" type="bool"/> - <field name="Disable Clear on Write" size="1" start="2" type="bool"/> - <field name="Disable Z/Stencil Buffer write" size="1" start="1" type="bool"/> - <field name="Disable Color Buffer write" size="1" start="0" type="bool"/> - </packet> - - <packet name="Re-load Full Resolution Tile Buffer" cl="R" code="27"> - <field name="Address" size="32" start="0" type="address"/> - <field name="Disable Z/Stencil Buffer read" size="1" start="1" type="bool"/> - <field name="Disable Color Buffer read" size="1" start="0" type="bool"/> - </packet> - - <packet name="Store Tile Buffer General" code="28" cl="R"> - <field name="Memory base address of frame/tile dump buffer" size="32" start="16" type="address"/> - <field name="Last Tile of Frame" size="1" start="19" type="bool"/> - <field name="Disable VG-Mask buffer dump" size="1" start="18" type="bool"/> - <field name="Disable Z/Stencil buffer dump" size="1" start="17" type="bool"/> - <field name="Disable Color buffer dump" size="1" start="16" type="bool"/> - <field name="Disable VG-Mask buffer clear on store/dump" size="1" start="15" type="bool"/> - <field name="Disable Z/Stencil buffer clear on store/dump" size="1" start="14" type="bool"/> - <field name="Disable Color buffer clear on store/dump" size="1" start="13" type="bool"/> - - <field name="Pixel Color Format" size="2" start="8" type="uint"> - <value name="rgba8888" value="0"/> - <value name="bgr565 dithered" value="1"/> - <value name="bgr565 no dither" value="2"/> - </field> - - <field name="Mode" size="2" start="6" type="uint"> - <value name="Sample 0" value="0"/> - <value name="Decimate x4" value="1"/> - <value name="Decimate x16" value="2"/> - </field> - - <field name="Format" size="2" start="4" type="uint"> - <value name="Raster" value="0"/> - <value name="T" value="1"/> - <value name="LT" value="2"/> - </field> - - <field name="Buffer to Store" size="3" start="0" type="uint"> - <value name="None" value="0"/> - <value name="Color" value="1"/> - <value name="Z/stencil" value="2"/> - <value name="Z" value="3"/> - <value name="VG-Mask" value="4"/> - </field> - </packet> - - <packet name="Load Tile Buffer General" code="29" cl="R"> - <field name="Memory base address of frame/tile dump buffer" size="32" start="16" type="address"/> - <field name="Disable VG-Mask buffer load" size="1" start="18" type="bool"/> - <field name="Disable Z/Stencil buffer load" size="1" start="17" type="bool"/> - <field name="Disable Color buffer load" size="1" start="16" type="bool"/> - - <field name="Pixel Color Format" size="2" start="8" type="uint"> - <value name="rgba8888" value="0"/> - <value name="bgr565 dithered" value="1"/> - <value name="bgr565 no dither" value="2"/> - </field> - - <field name="Mode" size="2" start="6" type="uint"> - <value name="Sample 0" value="0"/> - <value name="Decimate x4" value="1"/> - <value name="Decimate x16" value="2"/> - </field> - - <field name="Format" size="2" start="4" type="uint"> - <value name="Raster" value="0"/> - <value name="T" value="1"/> - <value name="LT" value="2"/> - </field> - - <field name="Buffer to Store" size="3" start="0" type="uint"> - <value name="None" value="0"/> - <value name="Color" value="1"/> - <value name="Z/stencil" value="2"/> - <value name="Z" value="3"/> - <value name="VG-Mask" value="4"/> - </field> - </packet> - - <packet name="Indexed Primitive List" code="32"> - <field name="Maximum Index" size="32" start="72" type="uint"/> - <field name="Address of Indices List" size="32" start="40" type="uint"/> - <field name="Length" size="32" start="8" type="uint"/> - <field name="Index type" size="4" start="4" type="uint"> - <value name="8-bit" value="0"/> - <value name="16-bit" value="1"/> - </field> - <field name="Primitive mode" size="4" start="0" type="uint"> - <value name="points" value="0"/> - <value name="lines" value="1"/> - <value name="line loop" value="2"/> - <value name="line strip" value="3"/> - <value name="triangles" value="4"/> - <value name="triangles strip" value="5"/> - <value name="triangles fan" value="6"/> - </field> - </packet> - - <packet name="Vertex Array Primitives" code="33"> - <field name="Index of First Vertex" size="32" start="40" type="uint"/> - <field name="Length" size="32" start="8" type="uint"/> - <field name="Primitive mode" size="4" start="0" type="uint"> - <value name="points" value="0"/> - <value name="lines" value="1"/> - <value name="line loop" value="2"/> - <value name="line strip" value="3"/> - <value name="triangles" value="4"/> - <value name="triangles strip" value="5"/> - <value name="triangles fan" value="6"/> - </field> - </packet> - - <packet name="Primitive List Format" cl="R" code="56"> - <field name="Data Type" size="4" start="4" type="uint"> - <value name="16-bit index" value="1"/> - <value name="32-bit x/y" value="3"/> - </field> - - <field name="Primitive Type" size="4" start="0" type="uint"> - <value name="Points List" value="0"/> - <value name="Lines List" value="1"/> - <value name="Triangles List" value="2"/> - <value name="RHY List" value="3"/> - </field> - </packet> - - <packet name="GL Shader State" code="64"> - <!-- The address field will be filled in by kernel validation code. --> - <field name="Address" size="28" start="0" type="uint"/> - <field name="Extended shader record" size="1" start="3" type="bool"/> - <field name="Number of attribute arrays" size="3" start="0" type="uint"/> - </packet> - - <packet name="Clear Colors" cl="R" code="114"> - <field name="Clear Stencil" size="8" start="96" type="uint"/> - <field name="Clear VG Mask" size="8" start="88" type="uint"/> - <field name="Clear ZS" size="24" start="64" type="uint"/> - <field name="Clear Color" size="64" start="0" type="uint"/> - </packet> - - <packet name="Configuration Bits" code="96"> - <field name="Early Z updates enable" size="1" start="17" type="bool"/> - <field name="Early Z enable" size="1" start="16" type="bool"/> - <field name="Z updates enable" size="1" start="15" type="bool"/> - <field name="Depth-Test Function" size="3" start="12" type="uint"/> - <!-- add values --> - <field name="Coverage Read Mode" size="1" start="11" type="uint"/> - <!-- add values --> - <field name="Coverage Pipe Select" size="1" start="8" type="bool"/> - <field name="Rasteriser Oversample Mode" size="2" start="6" type="bool"/> - <!-- add values --> - <field name="Coverage Read Type" size="1" start="5" type="uint"/> - <!-- add values --> - <field name="Antialiased Points and Lines" size="1" start="4" type="bool"/> - <field name="Enable Depth Offset" size="1" start="3" type="bool"/> - <field name="Clockwise Primitives" size="1" start="2" type="bool"/> - <field name="Enable Reverse Facing Primitive" size="1" start="1" type="bool"/> - <field name="Enable Forward Facing Primitive" size="1" start="0" type="bool"/> - </packet> - - <packet name="Flat Shade Flags" code="97"> - <field name="Flat-shading Flags" size="32" start="0" type="uint"/> - </packet> - - <packet name="Point size" code="98"> - <field name="Point Size" size="32" start="0" type="float"/> - </packet> - - <packet name="Line width" code="99"> - <field name="Line width" size="32" start="0" type="float"/> - </packet> - - <packet name="RHT X boundary" code="100"> - <field name="RHT primitive X boundary" size="16" start="0" type="int"/> - </packet> - - <packet name="Depth Offset" code="101"> - <!-- these fields are both float-1-8-7 encoded (top 16 bits of a float32) --> - <field name="Depth Offset Units" size="16" start="16" type="uint"/> - <field name="Depth Offset Factor" size="16" start="0" type="uint"/> - </packet> - - <packet name="Clip Window" code="102"> - <field name="Clip Window Height in pixels" size="16" start="48" type="uint"/> - <field name="Clip Window Width in pixels" size="16" start="32" type="uint"/> - <field name="Clip Window Bottom Pixel Coordinate" size="16" start="16" type="uint"/> - <field name="Clip Window Left Pixel Coordinate" size="16" start="0" type="uint"/> - </packet> - - <packet name="Viewport Offset" code="103"> - <field name="Viewport Centre Y-coordinate" size="16" start="16" type="int"/> - <field name="Viewport Centre X-coordinate" size="16" start="0" type="int"/> - </packet> - - <packet name="Z min and max clipping planes" code="104"> - <field name="Maximum Zw" size="32" start="32" type="float"/> - <field name="Minimum Zw" size="32" start="0" type="float"/> - </packet> - - <packet name="Clipper XY Scaling" code="105" cl="B"> - <field name="Viewport Half-Height in 1/16th of pixel" size="32" start="32" type="float"/> - <field name="Viewport Half-Width in 1/16th of pixel" size="32" start="0" type="float"/> - </packet> - - <packet name="Clipper Z Scale and Offset" code="106" cl="B"> - <field name="Viewport Z Offset (Zc to Zs)" size="32" start="32" type="float"/> - <field name="Viewport Z Scale (Zc to Zs)" size="32" start="0" type="float"/> - </packet> - - <packet name="Tile Binning Mode Configuration" code="112" cl="B"> - <field name="Double-buffer in non-ms mode" size="1" start="119" type="bool"/> - - <field name="Tile Allocation Block Size" size="2" start="117" type="uint"> - <value name="block size 32" value="0"/> - <value name="block size 64" value="1"/> - <value name="block size 128" value="2"/> - <value name="block size 256" value="3"/> - </field> - - <field name="Tile Allocation Initial Block Size" size="2" start="115" type="uint"> - <value name="block size 32" value="0"/> - <value name="block size 64" value="1"/> - <value name="block size 128" value="2"/> - <value name="block size 256" value="3"/> - </field> - - <field name="Auto-initialise Tile State Data Array" size="1" start="114" type="bool"/> - <field name="Tile Buffer 64-bit Color Depth" size="1" start="113" type="bool"/> - <field name="Multisample Mode (4x)" size="1" start="112" type="bool"/> - - <field name="Height (in tiles)" size="8" start="104" type="uint"/> - <field name="Width (in tiles)" size="8" start="96" type="uint"/> - - <field name="Tile State Data Array Address" size="32" start="64" type="uint"/> - <field name="Tile Allocation memory size" size="32" start="32" type="uint"/> - <field name="Tile Allocation memory address" size="32" start="0" type="uint"/> - - </packet> - - <packet name="Tile Rendering Mode Configuration" code="113" cl="R"> - <field name="Double-buffer in non-ms mode" size="1" start="76" type="bool"/> - <field name="Early-Z/Early-Cov disable" size="1" start="75" type="bool"/> - <field name="Early-Z Update Direction GT/GE" size="1" start="74" type="bool"/> - <field name="Select Coverage Mode" size="1" start="73" type="bool"/> - <field name="Enable VG Mask Buffer" size="1" start="72" type="bool"/> - <field name="Memory Format" size="2" start="70" type="uint"> - <value name="Raster" value="0"/> - <value name="T" value="1"/> - <value name="LT" value="2"/> - </field> - <field name="Decimate Mode" size="2" start="68" type="uint"/> - - <field name="Non-HDR Frame Buffer Color Format" size="2" start="66" type="uint"> - <value name="rendering config bgr565 dithered" value="0"/> - <value name="rendering config rgba8888" value="1"/> - <value name="rendering config bgr565 no dither" value="2"/> - </field> - - <field name="Tile Buffer 64-bit Color Depth" size="1" start="65" type="bool"/> - <field name="Multisample Mode (4x)" size="1" start="64" type="bool"/> - <field name="Height (pixels)" size="16" start="48" type="uint"/> - <field name="Width (pixels)" size="16" start="32" type="uint"/> - <field name="Memory Address" size="32" start="0" type="address"/> - </packet> - - <packet name="Tile Coordinates" code="115" cl="R"> - <field name="Tile Row Number" size="8" start="8" type="uint"/> - <field name="Tile Column Number" size="8" start="0" type="uint"/> - </packet> - - <packet name="Gem Relocations" code="254" cl="B"> - <field name="buffer 1" size="32" start="32" type="uint"/> - <field name="buffer 0" size="32" start="0" type="uint"/> - </packet> - - <struct name="Shader Record"> - <field name="Fragment Shader is single threaded" size="1" start="0" type="bool"/> - <field name="Point Size included in shaded vertex data" size="1" start="1" type="bool"/> - <field name="Enable Clipping" size="1" start="2" type="bool"/> - - <field name="Fragment Shader Number of Uniforms (not used currently)" size="16" start="2b" type="uint"/> - <field name="Fragment Shader Number of Varyings" size="8" start="3b" type="uint"/> - <field name="Fragment Shader Code Address" size="32" start="4b" type="address"/> - <!-- set up by the kernel --> - <field name="Fragment Shader Uniforms Address" size="32" start="8b" type="uint"/> - - <field name="Vertex Shader Number of Uniforms (not used currently)" size="16" start="12b" type="uint"/> - <field name="Vertex Shader Attribute Array select bits" size="8" start="14b" type="uint"/> - <field name="Vertex Shader Total Attributes Size" size="8" start="15b" type="uint"/> - <field name="Vertex Shader Code Address" size="32" start="16b" type="address"/> - <!-- set up by the kernel --> - <field name="Vertex Shader Uniforms Address" size="32" start="16b" type="uint"/> - - <field name="Coordinate Shader Number of Uniforms (not used currently)" size="16" start="24b" type="uint"/> - <field name="Coordinate Shader Attribute Array select bits" size="8" start="26b" type="uint"/> - <field name="Coordinate Shader Total Attributes Size" size="8" start="27b" type="uint"/> - <field name="Coordinate Shader Code Address" size="32" start="28b" type="address"/> - <!-- set up by the kernel --> - <field name="Coordinate Shader Uniforms Address" size="32" start="32b" type="uint"/> - </struct> - - <struct name="Attribute Record"> - <field name="Address" size="32" start="0b" type="address"/> - <field name="Number of Bytes minus 1" size="8" start="4b" type="uint"/> - <field name="Stride" size="8" start="5b" type="uint"/> - <field name="Vertex Shader VPM offset" size="8" start="6b" type="uint"/> - <field name="Coordinate Shader VPM offset" size="8" start="7b" type="uint"/> - </struct> - -</vcxml> diff --git a/lib/mesa/src/broadcom/cle/v3d_packet_v21_pack.h b/lib/mesa/src/broadcom/cle/v3d_packet_v21_pack.h deleted file mode 100644 index f11a4f0fc..000000000 --- a/lib/mesa/src/broadcom/cle/v3d_packet_v21_pack.h +++ /dev/null @@ -1,1689 +0,0 @@ -/* Generated code, see packets.xml and gen_packet_header.py */ - - -/* Packets, enums and structures for V3D 2.1. - * - * This file has been generated, do not hand edit. - */ - -#ifndef V3D21_PACK_H -#define V3D21_PACK_H - -#include "v3d_packet_helpers.h" - - -#define V3D21_HALT_opcode 0 -#define V3D21_HALT_header \ - .opcode = 0 - -struct V3D21_HALT { - uint32_t opcode; -}; - -static inline void -V3D21_HALT_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_HALT * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_HALT_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_HALT_unpack(const uint8_t * restrict cl, - struct V3D21_HALT * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_NOP_opcode 1 -#define V3D21_NOP_header \ - .opcode = 1 - -struct V3D21_NOP { - uint32_t opcode; -}; - -static inline void -V3D21_NOP_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_NOP * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_NOP_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_NOP_unpack(const uint8_t * restrict cl, - struct V3D21_NOP * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_FLUSH_opcode 4 -#define V3D21_FLUSH_header \ - .opcode = 4 - -struct V3D21_FLUSH { - uint32_t opcode; -}; - -static inline void -V3D21_FLUSH_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_FLUSH * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_FLUSH_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_FLUSH_unpack(const uint8_t * restrict cl, - struct V3D21_FLUSH * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_FLUSH_ALL_STATE_opcode 5 -#define V3D21_FLUSH_ALL_STATE_header \ - .opcode = 5 - -struct V3D21_FLUSH_ALL_STATE { - uint32_t opcode; -}; - -static inline void -V3D21_FLUSH_ALL_STATE_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_FLUSH_ALL_STATE * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_FLUSH_ALL_STATE_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_FLUSH_ALL_STATE_unpack(const uint8_t * restrict cl, - struct V3D21_FLUSH_ALL_STATE * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_START_TILE_BINNING_opcode 6 -#define V3D21_START_TILE_BINNING_header \ - .opcode = 6 - -struct V3D21_START_TILE_BINNING { - uint32_t opcode; -}; - -static inline void -V3D21_START_TILE_BINNING_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_START_TILE_BINNING * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_START_TILE_BINNING_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_START_TILE_BINNING_unpack(const uint8_t * restrict cl, - struct V3D21_START_TILE_BINNING * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_INCREMENT_SEMAPHORE_opcode 7 -#define V3D21_INCREMENT_SEMAPHORE_header \ - .opcode = 7 - -struct V3D21_INCREMENT_SEMAPHORE { - uint32_t opcode; -}; - -static inline void -V3D21_INCREMENT_SEMAPHORE_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_INCREMENT_SEMAPHORE * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_INCREMENT_SEMAPHORE_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_INCREMENT_SEMAPHORE_unpack(const uint8_t * restrict cl, - struct V3D21_INCREMENT_SEMAPHORE * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_WAIT_ON_SEMAPHORE_opcode 8 -#define V3D21_WAIT_ON_SEMAPHORE_header \ - .opcode = 8 - -struct V3D21_WAIT_ON_SEMAPHORE { - uint32_t opcode; -}; - -static inline void -V3D21_WAIT_ON_SEMAPHORE_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_WAIT_ON_SEMAPHORE * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_WAIT_ON_SEMAPHORE_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_WAIT_ON_SEMAPHORE_unpack(const uint8_t * restrict cl, - struct V3D21_WAIT_ON_SEMAPHORE * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_BRANCH_opcode 16 -#define V3D21_BRANCH_header \ - .opcode = 16 - -struct V3D21_BRANCH { - uint32_t opcode; - __gen_address_type address; -}; - -static inline void -V3D21_BRANCH_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_BRANCH * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - __gen_emit_reloc(data, &values->address); - cl[ 1] = __gen_address_offset(&values->address); - - cl[ 2] = __gen_address_offset(&values->address) >> 8; - - cl[ 3] = __gen_address_offset(&values->address) >> 16; - - cl[ 4] = __gen_address_offset(&values->address) >> 24; - -} - -#define V3D21_BRANCH_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_BRANCH_unpack(const uint8_t * restrict cl, - struct V3D21_BRANCH * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->address = __gen_unpack_address(cl, 8, 39); -} -#endif - - -#define V3D21_BRANCH_TO_SUB_LIST_opcode 17 -#define V3D21_BRANCH_TO_SUB_LIST_header \ - .opcode = 17 - -struct V3D21_BRANCH_TO_SUB_LIST { - uint32_t opcode; - __gen_address_type address; -}; - -static inline void -V3D21_BRANCH_TO_SUB_LIST_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_BRANCH_TO_SUB_LIST * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - __gen_emit_reloc(data, &values->address); - cl[ 1] = __gen_address_offset(&values->address); - - cl[ 2] = __gen_address_offset(&values->address) >> 8; - - cl[ 3] = __gen_address_offset(&values->address) >> 16; - - cl[ 4] = __gen_address_offset(&values->address) >> 24; - -} - -#define V3D21_BRANCH_TO_SUB_LIST_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_BRANCH_TO_SUB_LIST_unpack(const uint8_t * restrict cl, - struct V3D21_BRANCH_TO_SUB_LIST * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->address = __gen_unpack_address(cl, 8, 39); -} -#endif - - -#define V3D21_RETURN_FROM_SUB_LIST_opcode 18 -#define V3D21_RETURN_FROM_SUB_LIST_header \ - .opcode = 18 - -struct V3D21_RETURN_FROM_SUB_LIST { - uint32_t opcode; -}; - -static inline void -V3D21_RETURN_FROM_SUB_LIST_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_RETURN_FROM_SUB_LIST * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_RETURN_FROM_SUB_LIST_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_RETURN_FROM_SUB_LIST_unpack(const uint8_t * restrict cl, - struct V3D21_RETURN_FROM_SUB_LIST * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_opcode 24 -#define V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_header\ - .opcode = 24 - -struct V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER { - uint32_t opcode; -}; - -static inline void -V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_unpack(const uint8_t * restrict cl, - struct V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF_opcode 25 -#define V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF_header\ - .opcode = 25 - -struct V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF { - uint32_t opcode; -}; - -static inline void -V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - -} - -#define V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF_length 1 -#ifdef __gen_unpack_address -static inline void -V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF_unpack(const uint8_t * restrict cl, - struct V3D21_STORE_MULTI_SAMPLE_RESOLVED_TILE_COLOR_BUFFER_AND_EOF * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); -} -#endif - - -#define V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER_opcode 26 -#define V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER_header\ - .opcode = 26 - -struct V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER { - uint32_t opcode; - __gen_address_type address; - bool last_tile; - bool disable_clear_on_write; - bool disable_z_stencil_buffer_write; - bool disable_color_buffer_write; -}; - -static inline void -V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - __gen_emit_reloc(data, &values->address); - cl[ 1] = __gen_address_offset(&values->address) | - __gen_uint(values->last_tile, 3, 3) | - __gen_uint(values->disable_clear_on_write, 2, 2) | - __gen_uint(values->disable_z_stencil_buffer_write, 1, 1) | - __gen_uint(values->disable_color_buffer_write, 0, 0); - - cl[ 2] = __gen_address_offset(&values->address) >> 8; - - cl[ 3] = __gen_address_offset(&values->address) >> 16; - - cl[ 4] = __gen_address_offset(&values->address) >> 24; - -} - -#define V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER_unpack(const uint8_t * restrict cl, - struct V3D21_STORE_FULL_RESOLUTION_TILE_BUFFER * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->address = __gen_unpack_address(cl, 8, 39); - values->last_tile = __gen_unpack_uint(cl, 11, 11); - values->disable_clear_on_write = __gen_unpack_uint(cl, 10, 10); - values->disable_z_stencil_buffer_write = __gen_unpack_uint(cl, 9, 9); - values->disable_color_buffer_write = __gen_unpack_uint(cl, 8, 8); -} -#endif - - -#define V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER_opcode 27 -#define V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER_header\ - .opcode = 27 - -struct V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER { - uint32_t opcode; - __gen_address_type address; - bool disable_z_stencil_buffer_read; - bool disable_color_buffer_read; -}; - -static inline void -V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - __gen_emit_reloc(data, &values->address); - cl[ 1] = __gen_address_offset(&values->address) | - __gen_uint(values->disable_z_stencil_buffer_read, 1, 1) | - __gen_uint(values->disable_color_buffer_read, 0, 0); - - cl[ 2] = __gen_address_offset(&values->address) >> 8; - - cl[ 3] = __gen_address_offset(&values->address) >> 16; - - cl[ 4] = __gen_address_offset(&values->address) >> 24; - -} - -#define V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER_unpack(const uint8_t * restrict cl, - struct V3D21_RE_LOAD_FULL_RESOLUTION_TILE_BUFFER * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->address = __gen_unpack_address(cl, 8, 39); - values->disable_z_stencil_buffer_read = __gen_unpack_uint(cl, 9, 9); - values->disable_color_buffer_read = __gen_unpack_uint(cl, 8, 8); -} -#endif - - -#define V3D21_STORE_TILE_BUFFER_GENERAL_opcode 28 -#define V3D21_STORE_TILE_BUFFER_GENERAL_header \ - .opcode = 28 - -struct V3D21_STORE_TILE_BUFFER_GENERAL { - uint32_t opcode; - __gen_address_type memory_base_address_of_frame_tile_dump_buffer; - bool last_tile_of_frame; - bool disable_vg_mask_buffer_dump; - bool disable_z_stencil_buffer_dump; - bool disable_color_buffer_dump; - bool disable_vg_mask_buffer_clear_on_store_dump; - bool disable_z_stencil_buffer_clear_on_store_dump; - bool disable_color_buffer_clear_on_store_dump; - uint32_t pixel_color_format; -#define RGBA8888 0 -#define BGR565_DITHERED 1 -#define BGR565_NO_DITHER 2 - uint32_t mode; -#define SAMPLE_0 0 -#define DECIMATE_X4 1 -#define DECIMATE_X16 2 - uint32_t format; -#define RASTER 0 -#define T 1 -#define LT 2 - uint32_t buffer_to_store; -#define NONE 0 -#define COLOR 1 -#define Z_STENCIL 2 -#define Z 3 -#define VG_MASK 4 -}; - -static inline void -V3D21_STORE_TILE_BUFFER_GENERAL_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_STORE_TILE_BUFFER_GENERAL * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->mode, 6, 7) | - __gen_uint(values->format, 4, 5) | - __gen_uint(values->buffer_to_store, 0, 2); - - cl[ 2] = __gen_uint(values->disable_vg_mask_buffer_clear_on_store_dump, 7, 7) | - __gen_uint(values->disable_z_stencil_buffer_clear_on_store_dump, 6, 6) | - __gen_uint(values->disable_color_buffer_clear_on_store_dump, 5, 5) | - __gen_uint(values->pixel_color_format, 0, 1); - - __gen_emit_reloc(data, &values->memory_base_address_of_frame_tile_dump_buffer); - cl[ 3] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) | - __gen_uint(values->last_tile_of_frame, 3, 3) | - __gen_uint(values->disable_vg_mask_buffer_dump, 2, 2) | - __gen_uint(values->disable_z_stencil_buffer_dump, 1, 1) | - __gen_uint(values->disable_color_buffer_dump, 0, 0); - - cl[ 4] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) >> 8; - - cl[ 5] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) >> 16; - - cl[ 6] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) >> 24; - -} - -#define V3D21_STORE_TILE_BUFFER_GENERAL_length 7 -#ifdef __gen_unpack_address -static inline void -V3D21_STORE_TILE_BUFFER_GENERAL_unpack(const uint8_t * restrict cl, - struct V3D21_STORE_TILE_BUFFER_GENERAL * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->memory_base_address_of_frame_tile_dump_buffer = __gen_unpack_address(cl, 24, 55); - values->last_tile_of_frame = __gen_unpack_uint(cl, 27, 27); - values->disable_vg_mask_buffer_dump = __gen_unpack_uint(cl, 26, 26); - values->disable_z_stencil_buffer_dump = __gen_unpack_uint(cl, 25, 25); - values->disable_color_buffer_dump = __gen_unpack_uint(cl, 24, 24); - values->disable_vg_mask_buffer_clear_on_store_dump = __gen_unpack_uint(cl, 23, 23); - values->disable_z_stencil_buffer_clear_on_store_dump = __gen_unpack_uint(cl, 22, 22); - values->disable_color_buffer_clear_on_store_dump = __gen_unpack_uint(cl, 21, 21); - values->pixel_color_format = __gen_unpack_uint(cl, 16, 17); - values->mode = __gen_unpack_uint(cl, 14, 15); - values->format = __gen_unpack_uint(cl, 12, 13); - values->buffer_to_store = __gen_unpack_uint(cl, 8, 10); -} -#endif - - -#define V3D21_LOAD_TILE_BUFFER_GENERAL_opcode 29 -#define V3D21_LOAD_TILE_BUFFER_GENERAL_header \ - .opcode = 29 - -struct V3D21_LOAD_TILE_BUFFER_GENERAL { - uint32_t opcode; - __gen_address_type memory_base_address_of_frame_tile_dump_buffer; - bool disable_vg_mask_buffer_load; - bool disable_z_stencil_buffer_load; - bool disable_color_buffer_load; - uint32_t pixel_color_format; -#define RGBA8888 0 -#define BGR565_DITHERED 1 -#define BGR565_NO_DITHER 2 - uint32_t mode; -#define SAMPLE_0 0 -#define DECIMATE_X4 1 -#define DECIMATE_X16 2 - uint32_t format; -#define RASTER 0 -#define T 1 -#define LT 2 - uint32_t buffer_to_store; -#define NONE 0 -#define COLOR 1 -#define Z_STENCIL 2 -#define Z 3 -#define VG_MASK 4 -}; - -static inline void -V3D21_LOAD_TILE_BUFFER_GENERAL_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_LOAD_TILE_BUFFER_GENERAL * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->mode, 6, 7) | - __gen_uint(values->format, 4, 5) | - __gen_uint(values->buffer_to_store, 0, 2); - - cl[ 2] = __gen_uint(values->pixel_color_format, 0, 1); - - __gen_emit_reloc(data, &values->memory_base_address_of_frame_tile_dump_buffer); - cl[ 3] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) | - __gen_uint(values->disable_vg_mask_buffer_load, 2, 2) | - __gen_uint(values->disable_z_stencil_buffer_load, 1, 1) | - __gen_uint(values->disable_color_buffer_load, 0, 0); - - cl[ 4] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) >> 8; - - cl[ 5] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) >> 16; - - cl[ 6] = __gen_address_offset(&values->memory_base_address_of_frame_tile_dump_buffer) >> 24; - -} - -#define V3D21_LOAD_TILE_BUFFER_GENERAL_length 7 -#ifdef __gen_unpack_address -static inline void -V3D21_LOAD_TILE_BUFFER_GENERAL_unpack(const uint8_t * restrict cl, - struct V3D21_LOAD_TILE_BUFFER_GENERAL * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->memory_base_address_of_frame_tile_dump_buffer = __gen_unpack_address(cl, 24, 55); - values->disable_vg_mask_buffer_load = __gen_unpack_uint(cl, 26, 26); - values->disable_z_stencil_buffer_load = __gen_unpack_uint(cl, 25, 25); - values->disable_color_buffer_load = __gen_unpack_uint(cl, 24, 24); - values->pixel_color_format = __gen_unpack_uint(cl, 16, 17); - values->mode = __gen_unpack_uint(cl, 14, 15); - values->format = __gen_unpack_uint(cl, 12, 13); - values->buffer_to_store = __gen_unpack_uint(cl, 8, 10); -} -#endif - - -#define V3D21_INDEXED_PRIMITIVE_LIST_opcode 32 -#define V3D21_INDEXED_PRIMITIVE_LIST_header \ - .opcode = 32 - -struct V3D21_INDEXED_PRIMITIVE_LIST { - uint32_t opcode; - uint32_t maximum_index; - uint32_t address_of_indices_list; - uint32_t length; - uint32_t index_type; -#define _8_BIT 0 -#define _16_BIT 1 - uint32_t primitive_mode; -#define POINTS 0 -#define LINES 1 -#define LINE_LOOP 2 -#define LINE_STRIP 3 -#define TRIANGLES 4 -#define TRIANGLES_STRIP 5 -#define TRIANGLES_FAN 6 -}; - -static inline void -V3D21_INDEXED_PRIMITIVE_LIST_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_INDEXED_PRIMITIVE_LIST * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->index_type, 4, 7) | - __gen_uint(values->primitive_mode, 0, 3); - - - memcpy(&cl[2], &values->length, sizeof(values->length)); - - memcpy(&cl[6], &values->address_of_indices_list, sizeof(values->address_of_indices_list)); - - memcpy(&cl[10], &values->maximum_index, sizeof(values->maximum_index)); -} - -#define V3D21_INDEXED_PRIMITIVE_LIST_length 14 -#ifdef __gen_unpack_address -static inline void -V3D21_INDEXED_PRIMITIVE_LIST_unpack(const uint8_t * restrict cl, - struct V3D21_INDEXED_PRIMITIVE_LIST * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->maximum_index = __gen_unpack_uint(cl, 80, 111); - values->address_of_indices_list = __gen_unpack_uint(cl, 48, 79); - values->length = __gen_unpack_uint(cl, 16, 47); - values->index_type = __gen_unpack_uint(cl, 12, 15); - values->primitive_mode = __gen_unpack_uint(cl, 8, 11); -} -#endif - - -#define V3D21_VERTEX_ARRAY_PRIMITIVES_opcode 33 -#define V3D21_VERTEX_ARRAY_PRIMITIVES_header \ - .opcode = 33 - -struct V3D21_VERTEX_ARRAY_PRIMITIVES { - uint32_t opcode; - uint32_t index_of_first_vertex; - uint32_t length; - uint32_t primitive_mode; -#define POINTS 0 -#define LINES 1 -#define LINE_LOOP 2 -#define LINE_STRIP 3 -#define TRIANGLES 4 -#define TRIANGLES_STRIP 5 -#define TRIANGLES_FAN 6 -}; - -static inline void -V3D21_VERTEX_ARRAY_PRIMITIVES_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_VERTEX_ARRAY_PRIMITIVES * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->primitive_mode, 0, 3); - - - memcpy(&cl[2], &values->length, sizeof(values->length)); - - memcpy(&cl[6], &values->index_of_first_vertex, sizeof(values->index_of_first_vertex)); -} - -#define V3D21_VERTEX_ARRAY_PRIMITIVES_length 10 -#ifdef __gen_unpack_address -static inline void -V3D21_VERTEX_ARRAY_PRIMITIVES_unpack(const uint8_t * restrict cl, - struct V3D21_VERTEX_ARRAY_PRIMITIVES * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->index_of_first_vertex = __gen_unpack_uint(cl, 48, 79); - values->length = __gen_unpack_uint(cl, 16, 47); - values->primitive_mode = __gen_unpack_uint(cl, 8, 11); -} -#endif - - -#define V3D21_PRIMITIVE_LIST_FORMAT_opcode 56 -#define V3D21_PRIMITIVE_LIST_FORMAT_header \ - .opcode = 56 - -struct V3D21_PRIMITIVE_LIST_FORMAT { - uint32_t opcode; - uint32_t data_type; -#define _16_BIT_INDEX 1 -#define _32_BIT_X_Y 3 - uint32_t primitive_type; -#define POINTS_LIST 0 -#define LINES_LIST 1 -#define TRIANGLES_LIST 2 -#define RHY_LIST 3 -}; - -static inline void -V3D21_PRIMITIVE_LIST_FORMAT_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_PRIMITIVE_LIST_FORMAT * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->data_type, 4, 7) | - __gen_uint(values->primitive_type, 0, 3); - -} - -#define V3D21_PRIMITIVE_LIST_FORMAT_length 2 -#ifdef __gen_unpack_address -static inline void -V3D21_PRIMITIVE_LIST_FORMAT_unpack(const uint8_t * restrict cl, - struct V3D21_PRIMITIVE_LIST_FORMAT * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->data_type = __gen_unpack_uint(cl, 12, 15); - values->primitive_type = __gen_unpack_uint(cl, 8, 11); -} -#endif - - -#define V3D21_GL_SHADER_STATE_opcode 64 -#define V3D21_GL_SHADER_STATE_header \ - .opcode = 64 - -struct V3D21_GL_SHADER_STATE { - uint32_t opcode; - uint32_t address; - bool extended_shader_record; - uint32_t number_of_attribute_arrays; -}; - -static inline void -V3D21_GL_SHADER_STATE_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_GL_SHADER_STATE * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->address, 0, 27) | - __gen_uint(values->extended_shader_record, 3, 3) | - __gen_uint(values->number_of_attribute_arrays, 0, 2); - - cl[ 2] = __gen_uint(values->address, 0, 27) >> 8; - - cl[ 3] = __gen_uint(values->address, 0, 27) >> 16; - - cl[ 4] = __gen_uint(values->address, 0, 27) >> 24; - -} - -#define V3D21_GL_SHADER_STATE_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_GL_SHADER_STATE_unpack(const uint8_t * restrict cl, - struct V3D21_GL_SHADER_STATE * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->address = __gen_unpack_uint(cl, 8, 35); - values->extended_shader_record = __gen_unpack_uint(cl, 11, 11); - values->number_of_attribute_arrays = __gen_unpack_uint(cl, 8, 10); -} -#endif - - -#define V3D21_CLEAR_COLORS_opcode 114 -#define V3D21_CLEAR_COLORS_header \ - .opcode = 114 - -struct V3D21_CLEAR_COLORS { - uint32_t opcode; - uint32_t clear_stencil; - uint32_t clear_vg_mask; - uint32_t clear_zs; - uint64_t clear_color; -}; - -static inline void -V3D21_CLEAR_COLORS_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_CLEAR_COLORS * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->clear_color, 0, 63); - - cl[ 2] = __gen_uint(values->clear_color, 0, 63) >> 8; - - cl[ 3] = __gen_uint(values->clear_color, 0, 63) >> 16; - - cl[ 4] = __gen_uint(values->clear_color, 0, 63) >> 24; - - cl[ 5] = __gen_uint(values->clear_color, 0, 63) >> 32; - - cl[ 6] = __gen_uint(values->clear_color, 0, 63) >> 40; - - cl[ 7] = __gen_uint(values->clear_color, 0, 63) >> 48; - - cl[ 8] = __gen_uint(values->clear_color, 0, 63) >> 56; - - cl[ 9] = __gen_uint(values->clear_zs, 0, 23); - - cl[10] = __gen_uint(values->clear_zs, 0, 23) >> 8; - - cl[11] = __gen_uint(values->clear_zs, 0, 23) >> 16; - - cl[12] = __gen_uint(values->clear_vg_mask, 0, 7); - - cl[13] = __gen_uint(values->clear_stencil, 0, 7); - -} - -#define V3D21_CLEAR_COLORS_length 14 -#ifdef __gen_unpack_address -static inline void -V3D21_CLEAR_COLORS_unpack(const uint8_t * restrict cl, - struct V3D21_CLEAR_COLORS * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->clear_stencil = __gen_unpack_uint(cl, 104, 111); - values->clear_vg_mask = __gen_unpack_uint(cl, 96, 103); - values->clear_zs = __gen_unpack_uint(cl, 72, 95); - values->clear_color = __gen_unpack_uint(cl, 8, 71); -} -#endif - - -#define V3D21_CONFIGURATION_BITS_opcode 96 -#define V3D21_CONFIGURATION_BITS_header \ - .opcode = 96 - -struct V3D21_CONFIGURATION_BITS { - uint32_t opcode; - bool early_z_updates_enable; - bool early_z_enable; - bool z_updates_enable; - uint32_t depth_test_function; - uint32_t coverage_read_mode; - bool coverage_pipe_select; - bool rasteriser_oversample_mode; - uint32_t coverage_read_type; - bool antialiased_points_and_lines; - bool enable_depth_offset; - bool clockwise_primitives; - bool enable_reverse_facing_primitive; - bool enable_forward_facing_primitive; -}; - -static inline void -V3D21_CONFIGURATION_BITS_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_CONFIGURATION_BITS * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->rasteriser_oversample_mode, 6, 7) | - __gen_uint(values->coverage_read_type, 5, 5) | - __gen_uint(values->antialiased_points_and_lines, 4, 4) | - __gen_uint(values->enable_depth_offset, 3, 3) | - __gen_uint(values->clockwise_primitives, 2, 2) | - __gen_uint(values->enable_reverse_facing_primitive, 1, 1) | - __gen_uint(values->enable_forward_facing_primitive, 0, 0); - - cl[ 2] = __gen_uint(values->z_updates_enable, 7, 7) | - __gen_uint(values->depth_test_function, 4, 6) | - __gen_uint(values->coverage_read_mode, 3, 3) | - __gen_uint(values->coverage_pipe_select, 0, 0); - - cl[ 3] = __gen_uint(values->early_z_updates_enable, 1, 1) | - __gen_uint(values->early_z_enable, 0, 0); - -} - -#define V3D21_CONFIGURATION_BITS_length 4 -#ifdef __gen_unpack_address -static inline void -V3D21_CONFIGURATION_BITS_unpack(const uint8_t * restrict cl, - struct V3D21_CONFIGURATION_BITS * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->early_z_updates_enable = __gen_unpack_uint(cl, 25, 25); - values->early_z_enable = __gen_unpack_uint(cl, 24, 24); - values->z_updates_enable = __gen_unpack_uint(cl, 23, 23); - values->depth_test_function = __gen_unpack_uint(cl, 20, 22); - values->coverage_read_mode = __gen_unpack_uint(cl, 19, 19); - values->coverage_pipe_select = __gen_unpack_uint(cl, 16, 16); - values->rasteriser_oversample_mode = __gen_unpack_uint(cl, 14, 15); - values->coverage_read_type = __gen_unpack_uint(cl, 13, 13); - values->antialiased_points_and_lines = __gen_unpack_uint(cl, 12, 12); - values->enable_depth_offset = __gen_unpack_uint(cl, 11, 11); - values->clockwise_primitives = __gen_unpack_uint(cl, 10, 10); - values->enable_reverse_facing_primitive = __gen_unpack_uint(cl, 9, 9); - values->enable_forward_facing_primitive = __gen_unpack_uint(cl, 8, 8); -} -#endif - - -#define V3D21_FLAT_SHADE_FLAGS_opcode 97 -#define V3D21_FLAT_SHADE_FLAGS_header \ - .opcode = 97 - -struct V3D21_FLAT_SHADE_FLAGS { - uint32_t opcode; - uint32_t flat_shading_flags; -}; - -static inline void -V3D21_FLAT_SHADE_FLAGS_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_FLAT_SHADE_FLAGS * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->flat_shading_flags, sizeof(values->flat_shading_flags)); -} - -#define V3D21_FLAT_SHADE_FLAGS_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_FLAT_SHADE_FLAGS_unpack(const uint8_t * restrict cl, - struct V3D21_FLAT_SHADE_FLAGS * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->flat_shading_flags = __gen_unpack_uint(cl, 8, 39); -} -#endif - - -#define V3D21_POINT_SIZE_opcode 98 -#define V3D21_POINT_SIZE_header \ - .opcode = 98 - -struct V3D21_POINT_SIZE { - uint32_t opcode; - float point_size; -}; - -static inline void -V3D21_POINT_SIZE_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_POINT_SIZE * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->point_size, sizeof(values->point_size)); -} - -#define V3D21_POINT_SIZE_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_POINT_SIZE_unpack(const uint8_t * restrict cl, - struct V3D21_POINT_SIZE * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->point_size = __gen_unpack_float(cl, 8, 39); -} -#endif - - -#define V3D21_LINE_WIDTH_opcode 99 -#define V3D21_LINE_WIDTH_header \ - .opcode = 99 - -struct V3D21_LINE_WIDTH { - uint32_t opcode; - float line_width; -}; - -static inline void -V3D21_LINE_WIDTH_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_LINE_WIDTH * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->line_width, sizeof(values->line_width)); -} - -#define V3D21_LINE_WIDTH_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_LINE_WIDTH_unpack(const uint8_t * restrict cl, - struct V3D21_LINE_WIDTH * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->line_width = __gen_unpack_float(cl, 8, 39); -} -#endif - - -#define V3D21_RHT_X_BOUNDARY_opcode 100 -#define V3D21_RHT_X_BOUNDARY_header \ - .opcode = 100 - -struct V3D21_RHT_X_BOUNDARY { - uint32_t opcode; - int32_t rht_primitive_x_boundary; -}; - -static inline void -V3D21_RHT_X_BOUNDARY_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_RHT_X_BOUNDARY * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_sint(values->rht_primitive_x_boundary, 0, 15); - - cl[ 2] = __gen_sint(values->rht_primitive_x_boundary, 0, 15) >> 8; - -} - -#define V3D21_RHT_X_BOUNDARY_length 3 -#ifdef __gen_unpack_address -static inline void -V3D21_RHT_X_BOUNDARY_unpack(const uint8_t * restrict cl, - struct V3D21_RHT_X_BOUNDARY * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->rht_primitive_x_boundary = __gen_unpack_sint(cl, 8, 23); -} -#endif - - -#define V3D21_DEPTH_OFFSET_opcode 101 -#define V3D21_DEPTH_OFFSET_header \ - .opcode = 101 - -struct V3D21_DEPTH_OFFSET { - uint32_t opcode; - uint32_t depth_offset_units; - uint32_t depth_offset_factor; -}; - -static inline void -V3D21_DEPTH_OFFSET_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_DEPTH_OFFSET * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->depth_offset_factor, 0, 15); - - cl[ 2] = __gen_uint(values->depth_offset_factor, 0, 15) >> 8; - - cl[ 3] = __gen_uint(values->depth_offset_units, 0, 15); - - cl[ 4] = __gen_uint(values->depth_offset_units, 0, 15) >> 8; - -} - -#define V3D21_DEPTH_OFFSET_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_DEPTH_OFFSET_unpack(const uint8_t * restrict cl, - struct V3D21_DEPTH_OFFSET * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->depth_offset_units = __gen_unpack_uint(cl, 24, 39); - values->depth_offset_factor = __gen_unpack_uint(cl, 8, 23); -} -#endif - - -#define V3D21_CLIP_WINDOW_opcode 102 -#define V3D21_CLIP_WINDOW_header \ - .opcode = 102 - -struct V3D21_CLIP_WINDOW { - uint32_t opcode; - uint32_t clip_window_height_in_pixels; - uint32_t clip_window_width_in_pixels; - uint32_t clip_window_bottom_pixel_coordinate; - uint32_t clip_window_left_pixel_coordinate; -}; - -static inline void -V3D21_CLIP_WINDOW_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_CLIP_WINDOW * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->clip_window_left_pixel_coordinate, 0, 15); - - cl[ 2] = __gen_uint(values->clip_window_left_pixel_coordinate, 0, 15) >> 8; - - cl[ 3] = __gen_uint(values->clip_window_bottom_pixel_coordinate, 0, 15); - - cl[ 4] = __gen_uint(values->clip_window_bottom_pixel_coordinate, 0, 15) >> 8; - - cl[ 5] = __gen_uint(values->clip_window_width_in_pixels, 0, 15); - - cl[ 6] = __gen_uint(values->clip_window_width_in_pixels, 0, 15) >> 8; - - cl[ 7] = __gen_uint(values->clip_window_height_in_pixels, 0, 15); - - cl[ 8] = __gen_uint(values->clip_window_height_in_pixels, 0, 15) >> 8; - -} - -#define V3D21_CLIP_WINDOW_length 9 -#ifdef __gen_unpack_address -static inline void -V3D21_CLIP_WINDOW_unpack(const uint8_t * restrict cl, - struct V3D21_CLIP_WINDOW * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->clip_window_height_in_pixels = __gen_unpack_uint(cl, 56, 71); - values->clip_window_width_in_pixels = __gen_unpack_uint(cl, 40, 55); - values->clip_window_bottom_pixel_coordinate = __gen_unpack_uint(cl, 24, 39); - values->clip_window_left_pixel_coordinate = __gen_unpack_uint(cl, 8, 23); -} -#endif - - -#define V3D21_VIEWPORT_OFFSET_opcode 103 -#define V3D21_VIEWPORT_OFFSET_header \ - .opcode = 103 - -struct V3D21_VIEWPORT_OFFSET { - uint32_t opcode; - int32_t viewport_centre_y_coordinate; - int32_t viewport_centre_x_coordinate; -}; - -static inline void -V3D21_VIEWPORT_OFFSET_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_VIEWPORT_OFFSET * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_sint(values->viewport_centre_x_coordinate, 0, 15); - - cl[ 2] = __gen_sint(values->viewport_centre_x_coordinate, 0, 15) >> 8; - - cl[ 3] = __gen_sint(values->viewport_centre_y_coordinate, 0, 15); - - cl[ 4] = __gen_sint(values->viewport_centre_y_coordinate, 0, 15) >> 8; - -} - -#define V3D21_VIEWPORT_OFFSET_length 5 -#ifdef __gen_unpack_address -static inline void -V3D21_VIEWPORT_OFFSET_unpack(const uint8_t * restrict cl, - struct V3D21_VIEWPORT_OFFSET * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->viewport_centre_y_coordinate = __gen_unpack_sint(cl, 24, 39); - values->viewport_centre_x_coordinate = __gen_unpack_sint(cl, 8, 23); -} -#endif - - -#define V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES_opcode 104 -#define V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES_header\ - .opcode = 104 - -struct V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES { - uint32_t opcode; - float maximum_zw; - float minimum_zw; -}; - -static inline void -V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->minimum_zw, sizeof(values->minimum_zw)); - - memcpy(&cl[5], &values->maximum_zw, sizeof(values->maximum_zw)); -} - -#define V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES_length 9 -#ifdef __gen_unpack_address -static inline void -V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES_unpack(const uint8_t * restrict cl, - struct V3D21_Z_MIN_AND_MAX_CLIPPING_PLANES * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->maximum_zw = __gen_unpack_float(cl, 40, 71); - values->minimum_zw = __gen_unpack_float(cl, 8, 39); -} -#endif - - -#define V3D21_CLIPPER_XY_SCALING_opcode 105 -#define V3D21_CLIPPER_XY_SCALING_header \ - .opcode = 105 - -struct V3D21_CLIPPER_XY_SCALING { - uint32_t opcode; - float viewport_half_height_in_1_16th_of_pixel; - float viewport_half_width_in_1_16th_of_pixel; -}; - -static inline void -V3D21_CLIPPER_XY_SCALING_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_CLIPPER_XY_SCALING * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->viewport_half_width_in_1_16th_of_pixel, sizeof(values->viewport_half_width_in_1_16th_of_pixel)); - - memcpy(&cl[5], &values->viewport_half_height_in_1_16th_of_pixel, sizeof(values->viewport_half_height_in_1_16th_of_pixel)); -} - -#define V3D21_CLIPPER_XY_SCALING_length 9 -#ifdef __gen_unpack_address -static inline void -V3D21_CLIPPER_XY_SCALING_unpack(const uint8_t * restrict cl, - struct V3D21_CLIPPER_XY_SCALING * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->viewport_half_height_in_1_16th_of_pixel = __gen_unpack_float(cl, 40, 71); - values->viewport_half_width_in_1_16th_of_pixel = __gen_unpack_float(cl, 8, 39); -} -#endif - - -#define V3D21_CLIPPER_Z_SCALE_AND_OFFSET_opcode 106 -#define V3D21_CLIPPER_Z_SCALE_AND_OFFSET_header \ - .opcode = 106 - -struct V3D21_CLIPPER_Z_SCALE_AND_OFFSET { - uint32_t opcode; - float viewport_z_offset_zc_to_zs; - float viewport_z_scale_zc_to_zs; -}; - -static inline void -V3D21_CLIPPER_Z_SCALE_AND_OFFSET_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_CLIPPER_Z_SCALE_AND_OFFSET * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->viewport_z_scale_zc_to_zs, sizeof(values->viewport_z_scale_zc_to_zs)); - - memcpy(&cl[5], &values->viewport_z_offset_zc_to_zs, sizeof(values->viewport_z_offset_zc_to_zs)); -} - -#define V3D21_CLIPPER_Z_SCALE_AND_OFFSET_length 9 -#ifdef __gen_unpack_address -static inline void -V3D21_CLIPPER_Z_SCALE_AND_OFFSET_unpack(const uint8_t * restrict cl, - struct V3D21_CLIPPER_Z_SCALE_AND_OFFSET * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->viewport_z_offset_zc_to_zs = __gen_unpack_float(cl, 40, 71); - values->viewport_z_scale_zc_to_zs = __gen_unpack_float(cl, 8, 39); -} -#endif - - -#define V3D21_TILE_BINNING_MODE_CONFIGURATION_opcode 112 -#define V3D21_TILE_BINNING_MODE_CONFIGURATION_header\ - .opcode = 112 - -struct V3D21_TILE_BINNING_MODE_CONFIGURATION { - uint32_t opcode; - bool double_buffer_in_non_ms_mode; - uint32_t tile_allocation_block_size; -#define BLOCK_SIZE_32 0 -#define BLOCK_SIZE_64 1 -#define BLOCK_SIZE_128 2 -#define BLOCK_SIZE_256 3 - uint32_t tile_allocation_initial_block_size; -#define BLOCK_SIZE_32 0 -#define BLOCK_SIZE_64 1 -#define BLOCK_SIZE_128 2 -#define BLOCK_SIZE_256 3 - bool auto_initialise_tile_state_data_array; - bool tile_buffer_64_bit_color_depth; - bool multisample_mode_4x; - uint32_t height_in_tiles; - uint32_t width_in_tiles; - uint32_t tile_state_data_array_address; - uint32_t tile_allocation_memory_size; - uint32_t tile_allocation_memory_address; -}; - -static inline void -V3D21_TILE_BINNING_MODE_CONFIGURATION_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_TILE_BINNING_MODE_CONFIGURATION * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->tile_allocation_memory_address, sizeof(values->tile_allocation_memory_address)); - - memcpy(&cl[5], &values->tile_allocation_memory_size, sizeof(values->tile_allocation_memory_size)); - - memcpy(&cl[9], &values->tile_state_data_array_address, sizeof(values->tile_state_data_array_address)); - cl[13] = __gen_uint(values->width_in_tiles, 0, 7); - - cl[14] = __gen_uint(values->height_in_tiles, 0, 7); - - cl[15] = __gen_uint(values->double_buffer_in_non_ms_mode, 7, 7) | - __gen_uint(values->tile_allocation_block_size, 5, 6) | - __gen_uint(values->tile_allocation_initial_block_size, 3, 4) | - __gen_uint(values->auto_initialise_tile_state_data_array, 2, 2) | - __gen_uint(values->tile_buffer_64_bit_color_depth, 1, 1) | - __gen_uint(values->multisample_mode_4x, 0, 0); - -} - -#define V3D21_TILE_BINNING_MODE_CONFIGURATION_length 16 -#ifdef __gen_unpack_address -static inline void -V3D21_TILE_BINNING_MODE_CONFIGURATION_unpack(const uint8_t * restrict cl, - struct V3D21_TILE_BINNING_MODE_CONFIGURATION * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->double_buffer_in_non_ms_mode = __gen_unpack_uint(cl, 127, 127); - values->tile_allocation_block_size = __gen_unpack_uint(cl, 125, 126); - values->tile_allocation_initial_block_size = __gen_unpack_uint(cl, 123, 124); - values->auto_initialise_tile_state_data_array = __gen_unpack_uint(cl, 122, 122); - values->tile_buffer_64_bit_color_depth = __gen_unpack_uint(cl, 121, 121); - values->multisample_mode_4x = __gen_unpack_uint(cl, 120, 120); - values->height_in_tiles = __gen_unpack_uint(cl, 112, 119); - values->width_in_tiles = __gen_unpack_uint(cl, 104, 111); - values->tile_state_data_array_address = __gen_unpack_uint(cl, 72, 103); - values->tile_allocation_memory_size = __gen_unpack_uint(cl, 40, 71); - values->tile_allocation_memory_address = __gen_unpack_uint(cl, 8, 39); -} -#endif - - -#define V3D21_TILE_RENDERING_MODE_CONFIGURATION_opcode 113 -#define V3D21_TILE_RENDERING_MODE_CONFIGURATION_header\ - .opcode = 113 - -struct V3D21_TILE_RENDERING_MODE_CONFIGURATION { - uint32_t opcode; - bool double_buffer_in_non_ms_mode; - bool early_z_early_cov_disable; - bool early_z_update_direction_gt_ge; - bool select_coverage_mode; - bool enable_vg_mask_buffer; - uint32_t memory_format; -#define RASTER 0 -#define T 1 -#define LT 2 - uint32_t decimate_mode; - uint32_t non_hdr_frame_buffer_color_format; -#define RENDERING_CONFIG_BGR565_DITHERED 0 -#define RENDERING_CONFIG_RGBA8888 1 -#define RENDERING_CONFIG_BGR565_NO_DITHER 2 - bool tile_buffer_64_bit_color_depth; - bool multisample_mode_4x; - uint32_t height_pixels; - uint32_t width_pixels; - __gen_address_type memory_address; -}; - -static inline void -V3D21_TILE_RENDERING_MODE_CONFIGURATION_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_TILE_RENDERING_MODE_CONFIGURATION * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - __gen_emit_reloc(data, &values->memory_address); - cl[ 1] = __gen_address_offset(&values->memory_address); - - cl[ 2] = __gen_address_offset(&values->memory_address) >> 8; - - cl[ 3] = __gen_address_offset(&values->memory_address) >> 16; - - cl[ 4] = __gen_address_offset(&values->memory_address) >> 24; - - cl[ 5] = __gen_uint(values->width_pixels, 0, 15); - - cl[ 6] = __gen_uint(values->width_pixels, 0, 15) >> 8; - - cl[ 7] = __gen_uint(values->height_pixels, 0, 15); - - cl[ 8] = __gen_uint(values->height_pixels, 0, 15) >> 8; - - cl[ 9] = __gen_uint(values->memory_format, 6, 7) | - __gen_uint(values->decimate_mode, 4, 5) | - __gen_uint(values->non_hdr_frame_buffer_color_format, 2, 3) | - __gen_uint(values->tile_buffer_64_bit_color_depth, 1, 1) | - __gen_uint(values->multisample_mode_4x, 0, 0); - - cl[10] = __gen_uint(values->double_buffer_in_non_ms_mode, 4, 4) | - __gen_uint(values->early_z_early_cov_disable, 3, 3) | - __gen_uint(values->early_z_update_direction_gt_ge, 2, 2) | - __gen_uint(values->select_coverage_mode, 1, 1) | - __gen_uint(values->enable_vg_mask_buffer, 0, 0); - -} - -#define V3D21_TILE_RENDERING_MODE_CONFIGURATION_length 11 -#ifdef __gen_unpack_address -static inline void -V3D21_TILE_RENDERING_MODE_CONFIGURATION_unpack(const uint8_t * restrict cl, - struct V3D21_TILE_RENDERING_MODE_CONFIGURATION * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->double_buffer_in_non_ms_mode = __gen_unpack_uint(cl, 84, 84); - values->early_z_early_cov_disable = __gen_unpack_uint(cl, 83, 83); - values->early_z_update_direction_gt_ge = __gen_unpack_uint(cl, 82, 82); - values->select_coverage_mode = __gen_unpack_uint(cl, 81, 81); - values->enable_vg_mask_buffer = __gen_unpack_uint(cl, 80, 80); - values->memory_format = __gen_unpack_uint(cl, 78, 79); - values->decimate_mode = __gen_unpack_uint(cl, 76, 77); - values->non_hdr_frame_buffer_color_format = __gen_unpack_uint(cl, 74, 75); - values->tile_buffer_64_bit_color_depth = __gen_unpack_uint(cl, 73, 73); - values->multisample_mode_4x = __gen_unpack_uint(cl, 72, 72); - values->height_pixels = __gen_unpack_uint(cl, 56, 71); - values->width_pixels = __gen_unpack_uint(cl, 40, 55); - values->memory_address = __gen_unpack_address(cl, 8, 39); -} -#endif - - -#define V3D21_TILE_COORDINATES_opcode 115 -#define V3D21_TILE_COORDINATES_header \ - .opcode = 115 - -struct V3D21_TILE_COORDINATES { - uint32_t opcode; - uint32_t tile_row_number; - uint32_t tile_column_number; -}; - -static inline void -V3D21_TILE_COORDINATES_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_TILE_COORDINATES * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - cl[ 1] = __gen_uint(values->tile_column_number, 0, 7); - - cl[ 2] = __gen_uint(values->tile_row_number, 0, 7); - -} - -#define V3D21_TILE_COORDINATES_length 3 -#ifdef __gen_unpack_address -static inline void -V3D21_TILE_COORDINATES_unpack(const uint8_t * restrict cl, - struct V3D21_TILE_COORDINATES * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->tile_row_number = __gen_unpack_uint(cl, 16, 23); - values->tile_column_number = __gen_unpack_uint(cl, 8, 15); -} -#endif - - -#define V3D21_GEM_RELOCATIONS_opcode 254 -#define V3D21_GEM_RELOCATIONS_header \ - .opcode = 254 - -struct V3D21_GEM_RELOCATIONS { - uint32_t opcode; - uint32_t buffer_1; - uint32_t buffer_0; -}; - -static inline void -V3D21_GEM_RELOCATIONS_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_GEM_RELOCATIONS * restrict values) -{ - cl[ 0] = __gen_uint(values->opcode, 0, 7); - - - memcpy(&cl[1], &values->buffer_0, sizeof(values->buffer_0)); - - memcpy(&cl[5], &values->buffer_1, sizeof(values->buffer_1)); -} - -#define V3D21_GEM_RELOCATIONS_length 9 -#ifdef __gen_unpack_address -static inline void -V3D21_GEM_RELOCATIONS_unpack(const uint8_t * restrict cl, - struct V3D21_GEM_RELOCATIONS * restrict values) -{ - values->opcode = __gen_unpack_uint(cl, 0, 7); - values->buffer_1 = __gen_unpack_uint(cl, 40, 71); - values->buffer_0 = __gen_unpack_uint(cl, 8, 39); -} -#endif - - -#define V3D21_SHADER_RECORD_header -struct V3D21_SHADER_RECORD { - bool fragment_shader_is_single_threaded; - bool point_size_included_in_shaded_vertex_data; - bool enable_clipping; - uint32_t fragment_shader_number_of_uniforms_not_used_currently; - uint32_t fragment_shader_number_of_varyings; - __gen_address_type fragment_shader_code_address; - uint32_t fragment_shader_uniforms_address; - uint32_t vertex_shader_number_of_uniforms_not_used_currently; - uint32_t vertex_shader_attribute_array_select_bits; - uint32_t vertex_shader_total_attributes_size; - __gen_address_type vertex_shader_code_address; - uint32_t vertex_shader_uniforms_address; - uint32_t coordinate_shader_number_of_uniforms_not_used_currently; - uint32_t coordinate_shader_attribute_array_select_bits; - uint32_t coordinate_shader_total_attributes_size; - __gen_address_type coordinate_shader_code_address; - uint32_t coordinate_shader_uniforms_address; -}; - -static inline void -V3D21_SHADER_RECORD_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_SHADER_RECORD * restrict values) -{ - cl[ 0] = __gen_uint(values->fragment_shader_is_single_threaded, 0, 0) | - __gen_uint(values->point_size_included_in_shaded_vertex_data, 1, 1) | - __gen_uint(values->enable_clipping, 2, 2); - - cl[ 1] = 0; - cl[ 2] = __gen_uint(values->fragment_shader_number_of_uniforms_not_used_currently, 0, 15); - - cl[ 3] = __gen_uint(values->fragment_shader_number_of_uniforms_not_used_currently, 0, 15) >> 8 | - __gen_uint(values->fragment_shader_number_of_varyings, 0, 7); - - __gen_emit_reloc(data, &values->fragment_shader_code_address); - cl[ 4] = __gen_address_offset(&values->fragment_shader_code_address); - - cl[ 5] = __gen_address_offset(&values->fragment_shader_code_address) >> 8; - - cl[ 6] = __gen_address_offset(&values->fragment_shader_code_address) >> 16; - - cl[ 7] = __gen_address_offset(&values->fragment_shader_code_address) >> 24; - - - memcpy(&cl[8], &values->fragment_shader_uniforms_address, sizeof(values->fragment_shader_uniforms_address)); - cl[12] = __gen_uint(values->vertex_shader_number_of_uniforms_not_used_currently, 0, 15); - - cl[13] = __gen_uint(values->vertex_shader_number_of_uniforms_not_used_currently, 0, 15) >> 8; - - cl[14] = __gen_uint(values->vertex_shader_attribute_array_select_bits, 0, 7); - - cl[15] = __gen_uint(values->vertex_shader_total_attributes_size, 0, 7); - - __gen_emit_reloc(data, &values->vertex_shader_code_address); - cl[16] = __gen_address_offset(&values->vertex_shader_code_address) | - __gen_uint(values->vertex_shader_uniforms_address, 0, 31); - - cl[17] = __gen_address_offset(&values->vertex_shader_code_address) >> 8 | - __gen_uint(values->vertex_shader_uniforms_address, 0, 31) >> 8; - - cl[18] = __gen_address_offset(&values->vertex_shader_code_address) >> 16 | - __gen_uint(values->vertex_shader_uniforms_address, 0, 31) >> 16; - - cl[19] = __gen_address_offset(&values->vertex_shader_code_address) >> 24 | - __gen_uint(values->vertex_shader_uniforms_address, 0, 31) >> 24; - - cl[20] = 0; - cl[21] = 0; - cl[22] = 0; - cl[23] = 0; - cl[24] = __gen_uint(values->coordinate_shader_number_of_uniforms_not_used_currently, 0, 15); - - cl[25] = __gen_uint(values->coordinate_shader_number_of_uniforms_not_used_currently, 0, 15) >> 8; - - cl[26] = __gen_uint(values->coordinate_shader_attribute_array_select_bits, 0, 7); - - cl[27] = __gen_uint(values->coordinate_shader_total_attributes_size, 0, 7); - - __gen_emit_reloc(data, &values->coordinate_shader_code_address); - cl[28] = __gen_address_offset(&values->coordinate_shader_code_address); - - cl[29] = __gen_address_offset(&values->coordinate_shader_code_address) >> 8; - - cl[30] = __gen_address_offset(&values->coordinate_shader_code_address) >> 16; - - cl[31] = __gen_address_offset(&values->coordinate_shader_code_address) >> 24; - - - memcpy(&cl[32], &values->coordinate_shader_uniforms_address, sizeof(values->coordinate_shader_uniforms_address)); -} - -#define V3D21_SHADER_RECORD_length 36 -#ifdef __gen_unpack_address -static inline void -V3D21_SHADER_RECORD_unpack(const uint8_t * restrict cl, - struct V3D21_SHADER_RECORD * restrict values) -{ - values->fragment_shader_is_single_threaded = __gen_unpack_uint(cl, 0, 0); - values->point_size_included_in_shaded_vertex_data = __gen_unpack_uint(cl, 1, 1); - values->enable_clipping = __gen_unpack_uint(cl, 2, 2); - values->fragment_shader_number_of_uniforms_not_used_currently = __gen_unpack_uint(cl, 16, 31); - values->fragment_shader_number_of_varyings = __gen_unpack_uint(cl, 24, 31); - values->fragment_shader_code_address = __gen_unpack_address(cl, 32, 63); - values->fragment_shader_uniforms_address = __gen_unpack_uint(cl, 64, 95); - values->vertex_shader_number_of_uniforms_not_used_currently = __gen_unpack_uint(cl, 96, 111); - values->vertex_shader_attribute_array_select_bits = __gen_unpack_uint(cl, 112, 119); - values->vertex_shader_total_attributes_size = __gen_unpack_uint(cl, 120, 127); - values->vertex_shader_code_address = __gen_unpack_address(cl, 128, 159); - values->vertex_shader_uniforms_address = __gen_unpack_uint(cl, 128, 159); - values->coordinate_shader_number_of_uniforms_not_used_currently = __gen_unpack_uint(cl, 192, 207); - values->coordinate_shader_attribute_array_select_bits = __gen_unpack_uint(cl, 208, 215); - values->coordinate_shader_total_attributes_size = __gen_unpack_uint(cl, 216, 223); - values->coordinate_shader_code_address = __gen_unpack_address(cl, 224, 255); - values->coordinate_shader_uniforms_address = __gen_unpack_uint(cl, 256, 287); -} -#endif - - -#define V3D21_ATTRIBUTE_RECORD_header -struct V3D21_ATTRIBUTE_RECORD { - __gen_address_type address; - uint32_t number_of_bytes_minus_1; - uint32_t stride; - uint32_t vertex_shader_vpm_offset; - uint32_t coordinate_shader_vpm_offset; -}; - -static inline void -V3D21_ATTRIBUTE_RECORD_pack(__gen_user_data *data, uint8_t * restrict cl, - const struct V3D21_ATTRIBUTE_RECORD * restrict values) -{ - __gen_emit_reloc(data, &values->address); - cl[ 0] = __gen_address_offset(&values->address); - - cl[ 1] = __gen_address_offset(&values->address) >> 8; - - cl[ 2] = __gen_address_offset(&values->address) >> 16; - - cl[ 3] = __gen_address_offset(&values->address) >> 24; - - cl[ 4] = __gen_uint(values->number_of_bytes_minus_1, 0, 7); - - cl[ 5] = __gen_uint(values->stride, 0, 7); - - cl[ 6] = __gen_uint(values->vertex_shader_vpm_offset, 0, 7); - - cl[ 7] = __gen_uint(values->coordinate_shader_vpm_offset, 0, 7); - -} - -#define V3D21_ATTRIBUTE_RECORD_length 8 -#ifdef __gen_unpack_address -static inline void -V3D21_ATTRIBUTE_RECORD_unpack(const uint8_t * restrict cl, - struct V3D21_ATTRIBUTE_RECORD * restrict values) -{ - values->address = __gen_unpack_address(cl, 0, 31); - values->number_of_bytes_minus_1 = __gen_unpack_uint(cl, 32, 39); - values->stride = __gen_unpack_uint(cl, 40, 47); - values->vertex_shader_vpm_offset = __gen_unpack_uint(cl, 48, 55); - values->coordinate_shader_vpm_offset = __gen_unpack_uint(cl, 56, 63); -} -#endif - - -#endif /* V3D21_PACK_H */ |