Commit Graph

2096 Commits

Author SHA1 Message Date
Eric Anholt 1ae8018a6a meson: Add support for the vc4 driver.
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
2017-10-17 13:41:59 -07:00
Eric Anholt 20b91cd568 broadcom/vc5: Don't pair VPMSETUP with other peripheral access.
The specs don't say you can't, but pairing it with an SFU write on the
7268 breaks all our simple shader tests using gl_MVP * gl_Vertex.
2017-10-12 10:41:09 -07:00
Eric Anholt dc9fa4bfb3 broadcom/vc5: Fix inclusion of FS flag bits in dumping the FS address. 2017-10-12 10:41:09 -07:00
Eric Anholt ae9a56db6a braodcom/vc5: Set up clear color for higher-bpp formats.
Fixes arb_color_buffer_float-clear
2017-10-10 11:42:06 -07:00
Eric Anholt ffdba7fd4c broadcom/vc5: Fix Rendering Mode Common Config's color store bitmask.
This controls the RTs that get stored by the default resolved store, the
same way that the extended resolved store packet has a RT bitmask.
2017-10-10 11:42:06 -07:00
Eric Anholt 4b7de2a360 broadcom/vc5: Add support for f32 render targets.
The TLB write code is getting ugly and needs a refactoring (that will
hopefully handle TLBU uniform coalescing as well).
2017-10-10 11:42:06 -07:00
Eric Anholt dc25a83a7a broadcom/vc5: Start hooking up multiple render targets support.
We now emit as many TLB color writes as there are color buffers.
2017-10-10 11:42:05 -07:00
Eric Anholt f0ee7d6ba8 broadcom/vc5: Add support for GL_EXT_provoking_vertex.
The bit was missing from the spec, but it's there in the simulator.  Fixes
the piglit clipflat test.
2017-10-10 11:42:05 -07:00
Eric Anholt d8bc9c71df broadcom/vc5: Mark our primitives as needing TF processing.
The TF enable state appears to stick around until the next TF enable
packet is sent, so we only want to request TF when the shader is using it.
2017-10-10 11:42:05 -07:00
Eric Anholt 28105560f7 broadcom/vc5: Fix setup of TF dword output count.
I missed the "- 1" when reading the spec.
2017-10-10 11:42:05 -07:00
Eric Anholt 361c5f28bd broadcom/vc5: Fix handling of interp qualifiers on builtin color inputs.
The interpolation qualifier, if specified, is supposed to take precedence
over glShadeModel().
2017-10-10 11:42:05 -07:00
Eric Anholt d0dfc4bd5f broadcom/vc5: Fix CLIF dumping of lists that aren't capped by a HALT.
The HW will halt when you hit a HALT packet, or when you hit the end
address.  Tell CLIF if there's an end address is so that it can stop
correctly.  (There was usually a 0 byte after the CL, so it would stop
anyway).
2017-10-10 11:42:05 -07:00
Eric Anholt 7f3b890697 broadcom/vc5: Fix depth and stencil clear values.
I had misread the packet description: We always have a 32f depth, and a
separate u8 stencil.
2017-10-10 11:42:05 -07:00
Eric Anholt 732a3a72cb broadcom/compiler: Set up passthrough Z when doing FS discards.
In order to keep early-Z from writing early in a discard shader, you need
to set the "modifies Z" bit in the shader state (which the new
prog_data.discards will indicate).  Then, in the shader we do a TLB write
to make Z passthrough happen (the QPU result is ignored, so we use a NULL
source).
2017-10-10 11:42:05 -07:00
Eric Anholt 4c4fbab345 broadcom/compiler: Don't forget the discard state on TLB Z writes.
We don't want to write Z for discarded fragments.
2017-10-10 11:42:05 -07:00
Eric Anholt 84939552d0 broadcom/compiler: Use defines instead of magic values in TLB write setup. 2017-10-10 11:42:05 -07:00
Eric Anholt e74a9e8def broadcom/xml: Add the vc5 Base Vertex/Base Instance packet.
This lets us do index_bias and ARB_base_instance.
2017-10-10 11:42:05 -07:00
Eric Anholt 4b2cf771e6 broadcom/xml: Add a bunch more vc5 tile list management packets.
We're going to need these for MSAA, and to use the generic per-tile list.
2017-10-10 11:42:04 -07:00
Eric Anholt efa329ab4f broadcom/xml: Remove vc5 base packet for tile bin/render mode config.
These existed so I could unpack just the sub-id field to switch on in the
old manual CLIF dumper.  The new codegen handles sub-id automatically, but
only if these stub packets aren't there with an implicit sub-id=0.
2017-10-10 11:42:04 -07:00
Eric Anholt afb31a9e87 braodcom/xml: Fix a pasteo in vc5 store tile buffer general. 2017-10-10 11:42:04 -07:00
Eric Anholt ade416d023 broadcom: Add VC5 NIR compiler.
This is a pretty straightforward fork of VC4's NIR compiler to VC5.  The
condition codes, registers, and I/O have all changed, making the backend
hard to share, though their heritage is still recognizable.

v2: Move to src/broadcom/compiler to match intel's layout, rename more
    "vc5" to "v3d", rename QIR to VIR ("V3D IR") to avoid symbol conflicts
    with vc4, use new v3d_debug header, add compiler init/free functions,
    do texture swizzling in NIR to allow optimization.
2017-10-10 11:42:04 -07:00
Eric Anholt f71364f297 broadcom: Add vc5 CLIF dumping
This will be usable with "VC5_DEBUG=cl" on the vc5 driver to stream a CLIF
file (the Broadcom equivalent of i965's AUB) to stderr.  I haven't tested
that this is actually usable with the internal CLIF-consuming tools, but
is close enough as a baseline and is useful for visually inspecting the
command stream.
2017-10-10 11:42:04 -07:00
Eric Anholt 05c7d9715b broadcom: Add V3D 3.3 QPU instruction pack, unpack, and disasm.
Unlike VC4, I've defined an unpacked instruction format with pack/unpack
functions to convert to 64-bit encoded instructions.  This will let us
incrementally put together our instructions and validate them in a more
natural way than the QPU_GET_FIELD/QPU_SET_FIELD used to.

The pack/unpack unfortuantely are written by hand.  While I could define
genxml for parts of it, there are many special cases (like operand order
of commutative binops choosing which binop is being performed!) and it
probably wouldn't come out much cleaner.

The disasm unit test ensures that we have the same assembly format as
Broadcom's internal tools, other than whitespace changes.

v2: Fix automake variable redefinition complaints, add test to .gitignore
2017-10-10 11:42:04 -07:00
Eric Anholt 59257c35eb broadcom: Introduce a v3d_debug.h header for vc5 and broadcom Vulkan.
Unlike vc4, where the compiler and gallium driver live together, for vc5
the compiler will live up in the shared broadcom directory, and need
access to the debug flags.  Define a set of debug flags and helpers there,
so it can be shared between compiler, vc5, and vulkan.
2017-10-10 11:42:04 -07:00
Daniel Stone bbe2082e7d broadcom: Fix out-of-tree build include path
Reviewed-by: Eric Anholt <eric@anholt.net>
Fixes: 5b102160ae ("broadcom/genxml: Introduce a V3D packet/struct decoder.")
2017-10-05 15:03:11 -07:00
Eric Anholt 58cd67655c broadcom/genxml: Set up enums for VC5 blending, depth, stencil, and prims.
These will be used in tables in the Vulkan driver, and give us pretty CLIF
dump output.
2017-09-19 10:40:55 -07:00
Eric Anholt af3c521528 broadcom/genxml: Add support for enum-typed fields.
This basically comes from the intel genxml script.  This will help improve
gdb and CLIF output once we convert fields over.
2017-09-19 10:40:55 -07:00
Eric Anholt a727e03360 broadcom/genxml: Add V3D 3.3 packet definitions.
This will be used by the new vc5 gallium driver, and a future Vulkan
driver.
2017-08-18 12:54:13 -07:00
Eric Anholt 7c576d6091 broadcom/genxml: Check the sub-id field when decoding instructions.
VC5 introduces packet variants where the same opcode has behavior that is
decided by a sub-id field in the early bits of the packet.  Keep iterating
over packets until we find the one with the matching sub-id.
2017-08-18 11:56:58 -07:00
Eric Anholt 14fe9fd3f7 broadcom/genxml: Emit code for default headers for structs as well.
In the vc5 NIR backend, I want to use the XML code-generation to set up
pack/unpack of structs for the texture uniforms, and setting up the
unpacked copy needs a default header.
2017-08-18 11:56:58 -07:00
Eric Anholt f785db3d31 broadcom: Add v3d_xml.h to gitignore. 2017-08-15 13:23:54 -07:00
Eric Anholt 463de32b95 broadcom: Add missing libexpat cflags for the decoder.
The Raspbian ARMv6 cross compiler wasn't picking up my (amd64) system copy
of the header the way that the system gcc and armhf cross-compile did.
2017-08-15 13:23:54 -07:00
Eric Anholt 4d4872708e broadcom/vc4: Switch the V3D 2.1 XML over to restricted address fields.
This keeps the flags out of v3d_decode.c's output.  In the generated code,
only the unpack functions see any change (where they now get the
restricted start value), and vc4 doesn't use the unpack functions yet.
2017-07-25 14:55:12 -07:00
Eric Anholt 82fdc10606 broadcom/genxml: Support address fields with <32 bits
I was writing the XML such that the address field overlapped various flags
in the alignment bits, which caused pain when trying to unpack for decode.
Instead, keep the XML matching the docs (address fields don't overlap),
and just infer the appropriate shift value during decode.

During pack, the address is just applied to the appropriate bits
already, ignoring the sub-byte start/end fields.
2017-07-25 14:55:12 -07:00
Eric Anholt b3c78a51f3 broadcom/vc4: Switch the Viewport Center fields to a fixed-point representation.
This gets us automatic CL decoding to a floating-point value, and drops a
magic number from the emit code.  250x250 shader runner tests now say they
have a center of 125.0 instead of 2000.
2017-07-25 14:44:52 -07:00
Eric Anholt 5b102160ae broadcom/genxml: Introduce a V3D packet/struct decoder.
This is copied from Intel's XML decoder, modified to handle V3D's
byte-oriented packets.

v2: Squash in robher's fixes for Android
2017-07-25 14:44:52 -07:00
Eric Anholt 12b55c8e27 broadcom: add editorconfig
This is the same 8-space style used in the vc4 and vc5 gallium drivers.
2017-07-25 14:44:52 -07:00
Andres Gomez bfe8134472 broadcom: correct header file in BROADCOM_FILES
This fixes `make distcheck`

> make[3]: *** No rule to make target 'common/v3d_devinfo.h', needed by 'distdir'.  Stop.
> make[3]: Leaving directory '/home/local/mesa/src/broadcom'
> Makefile:945: recipe for target 'distdir' failed
> make[2]: Leaving directory '/home/local/mesa/src'
> make[2]: *** [distdir] Error 1
> make[1]: *** [distdir] Error 1

Fixes: 427bbbb99c ("broadcom: Introduce a header for talking about chip revisions.")
Cc: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-24 01:40:05 +03:00
Eric Anholt 5a9fb2eabc broadcom/vc4: Add more packets to the v2.1 XML.
These will be used to replace vc4_cl_dump.c's hand-written dumping.
2017-07-13 11:30:42 -07:00
Eric Anholt 427bbbb99c broadcom: Introduce a header for talking about chip revisions.
This will be used by the VC5 driver and various shared VC4/VC5 tooling,
like the XML decoder.
2017-07-13 11:28:28 -07:00
Eric Anholt fd37ce6bec broadcom/genxml: Use the same "gen" attr for HW version as Intel does.
This will let us reuse their tools more easily.
2017-07-13 11:28:28 -07:00
Eric Anholt ee170c9d83 broadcom/genxml: Support unpacking fixed-point fractional values.
This was an oversight in the original XML support, because unpacking
wasn't used much.  The new XML-based CL dumper will want it, though.
2017-07-13 11:28:28 -07:00
Rob Herring 7a7a84c8db Android: Fix vc4 build since XML changes.
Since commit 7f80a9ff13 ("vc4: Introduce XML-based packet header
generation like Intel's."), the vc4 build on Android is broken:

out/target/product/linaro_x86_64/gen/STATIC_LIBRARIES/libmesa_broadcom_genxml_intermediates/broadcom/cle/v3d_packet_v21_pack.h:12:10: fatal error: 'v3d_packet_helpers.h' file not found
external/mesa3d/src/gallium/drivers/vc4/vc4_cl_dump.c:28:10: fatal error: 'vc4_packet.h' file not found

The path of the generated header needs to be fixed since we build out of
tree.

Acked-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Rob Herring <robh@kernel.org>
2017-07-12 16:47:10 -05:00
Juan A. Suarez Romero 2c240a7205 vc4: automake: include vc4_cl_dump.h in
Ensure vc4_cl_dump.h and $(BROADCOM_FILES) are distributed in the
dist-file.

This fixes `make distcheck`

Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2017-07-04 09:37:19 +02:00
Eric Anholt bd1925562a vc4: Convert the driver to emitting the shader record using pack macros. 2017-06-30 12:25:45 -07:00
Eric Anholt 7f80a9ff13 vc4: Introduce XML-based packet header generation like Intel's.
I really liked this idea, as it should help with management of packet
parsing tools like the CL dump.  The python script is forked off of theirs
because our packets are byte-based instead of dwords, and the changes to
do so while avoiding performance regressions due to unaligned accesses
were quite invasive.

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

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