summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* broadcom/vc5: Fix depth and stencil clear values.Eric Anholt2017-10-104-15/+11
| | | | | I had misread the packet description: We always have a 32f depth, and a separate u8 stencil.
* broadcom/vc5: Add missing Z16 format.Eric Anholt2017-10-101-0/+1
| | | | We can render to and sample from it just fine.
* braodcom/vc5: Fix incorrect early Z writes in discard shaders.Eric Anholt2017-10-101-1/+6
| | | | Fixes glsl-fs-discard-02.
* broadcom/compiler: Set up passthrough Z when doing FS discards.Eric Anholt2017-10-103-2/+15
| | | | | | | | 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).
* broadcom/compiler: Don't forget the discard state on TLB Z writes.Eric Anholt2017-10-101-0/+1
| | | | We don't want to write Z for discarded fragments.
* broadcom/compiler: Use defines instead of magic values in TLB write setup.Eric Anholt2017-10-101-6/+33
|
* broadcom/vc5: Add proper support for base_vertex and base_instance.Eric Anholt2017-10-103-20/+24
| | | | | | I had base_vertex hacked into the shader state setup like in vc4, but it's not correct for big offsets. Using the proper packet is easier and hopefully means we can re-emit shader state setup less frequently.
* broadcom/xml: Add the vc5 Base Vertex/Base Instance packet.Eric Anholt2017-10-101-0/+6
| | | | This lets us do index_bias and ARB_base_instance.
* broadcom/vc5: Use supertiles and generic tile lists.Eric Anholt2017-10-103-73/+130
| | | | | This massively reduces the size of our RCL setup. It also gets us closer to supporting multicore platforms.
* broadcom/xml: Add a bunch more vc5 tile list management packets.Eric Anholt2017-10-101-0/+60
| | | | We're going to need these for MSAA, and to use the generic per-tile list.
* broadcom/xml: Remove vc5 base packet for tile bin/render mode config.Eric Anholt2017-10-101-10/+0
| | | | | | 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.
* braodcom/xml: Fix a pasteo in vc5 store tile buffer general.Eric Anholt2017-10-101-1/+1
|
* broadcom: Add V3D 3.3 gallium driver called "vc5", for BCM7268.Eric Anholt2017-10-1043-2/+9131
| | | | | | | | | | | | | | | | | | | | | | | | | V3D 3.3 is a continuation of the 3D implementation in VC4 (v2.1 and v2.6). V3D 3.3 introduces an MMU (no more CMA allocations) and support for GLES3.1. This driver is not currently conformant, though that will be a target as soon as possible. V3D 3.x parts use a new texture tiling layout common across many Broadcom graphics parts including and the HVS scanout engine. It also massively changes the QPU instructions, introducing a common physical register file (no more A/B split) and half-float instructions, while removing the 4x8 unorm instructions in favor of half-float for talking to fixed function interfaces. Because so much has changed, vc5 is implemented in a separate gallium driver, using only the XML code-generation support from vc4. v2: Fix tile layout for 64bpp textures. Fix texture swizzling for 32-bit returns. Fix up a bit of MRT setup. Sync the simulator to kernel behavior a bit more. Improve uniform debugging code. Rebase on QIR->VIR rename. Move texture state mostly to the CSOs. Improve cache flushing on the simulator. Fix program deletion use-after-frees. Acked-by: Dave Airlie <[email protected]> (uabi plan) Acked-by: Daniel Vetter <[email protected]> (uabi plan)
* broadcom: Add VC5 NIR compiler.Eric Anholt2017-10-1017-0/+7498
| | | | | | | | | | | 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.
* broadcom: Add vc5 CLIF dumpingEric Anholt2017-10-103-0/+312
| | | | | | | | 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.
* broadcom: Add V3D 3.3 QPU instruction pack, unpack, and disasm.Eric Anholt2017-10-1012-0/+2774
| | | | | | | | | | | | | | | | | 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
* broadcom: Introduce a v3d_debug.h header for vc5 and broadcom Vulkan.Eric Anholt2017-10-103-0/+173
| | | | | | | 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.
* configure: Add the new "vc5" driver to the list, requiring a simulator.Eric Anholt2017-10-102-2/+15
| | | | | | | | | | | | My intent is to develop the vc5 driver in-tree for some time to build the CL generation and shader compiler code, and keep out-of-tree patches for talking to an actual kernel driver until the kernel driver can be stabilized on the hardware. v2: Define a HAVE_BROADCOM_DRIVERS, like HAVE_INTEL or HAVE_AMD. Reviewed-by: Adam Jackson <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* nir: Move vc4's alpha test lowering to core NIR.Eric Anholt2017-10-109-55/+168
| | | | | | | | | | | | | I've been doing this inside of vc4, but vc5 wants it as well and it may be useful for other drivers (Intel has a related path for pre-gen6 with MRT, and freedreno had a TGSI path for it at one point). This required defining a common enum for the standard comparison functions, but other lowering passes are likely to also want that enum. v2: Add to meson.build as well. Acked-by: Rob Clark <[email protected]>
* mesa: Alphabetize GL_MESA_tile_raster_order in the extensions list.Eric Anholt2017-10-101-1/+1
| | | | trivial, fixes make check.
* mesa: Implement a new GL_MESA_tile_raster_order extension.Eric Anholt2017-10-1011-0/+87
| | | | | | | | | | | | | | The intent is to use this extension on vc4 to allow X11 to do overlapping CopyArea() within a pixmap without first blitting the pixmap to a temporary. With associated glamor patches, improves x11perf -copywinwin100 performance on a Raspberry Pi 3 from ~4700/sec to ~5130/sec, and is an even larger boost to uncomposited window movement performance (most copywinwin100 copies don't overlap). v2: Fix glIsEnabled() on the new enums. v3: Drop the local spec since I'm upstreaming the spec. Reviewed-by: Nicolai Hähnle <[email protected]>
* broadcom/vc4: Expose PIPE_CAP_TILE_RASTER_ORDEREric Anholt2017-10-107-20/+71
| | | | | | | | | | | | | | Because vc4 can control the order that tiles are rasterized in, we can use it to implement overlapping blits using normal drawing and GL_ARB_texture_barrier, as long as we can tell the kernel what order to render the tiles in. v2: Fix on the simulator. v3: Add the cap (disabled) to other drivers, add rst docs for the cap. v4: Rebase on PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS v5: Split from the core gallium commit, drop some unnecessary code related to glBlitFramebuffer(), fix a crash with clears before state has been bound.
* gallium: Create a new PIPE_CAP_TILE_RASTER_ORDER for vc4.Eric Anholt2017-10-1018-0/+29
| | | | | | | | | | | | | | | | Because vc4 can control the order that tiles are rasterized in, we can use it to implement overlapping blits using normal drawing and GL_ARB_texture_barrier, as long as we can tell the kernel what order to render the tiles in. This commit introduces the core gallium support, vc4 changes will follow. v2: Fix on the simulator. v3: Add the cap (disabled) to other drivers, add rst docs for the cap. v4: Rebase on PIPE_CAP_TGSI_ANY_REG_AS_ADDRESS v5: Drop vc4 changes from this commit, for clarity. Reviewed-by: Nicolai Hähnle <[email protected]> (v3)
* broadcom/vc4: Implement GL_ARB_texture_barrier.Eric Anholt2017-10-102-1/+12
| | | | | | Improves x11perf -copywinwin100 from ~2000/sec to ~4700/sec. More importantly, this is a prerequisite for the new GL_MESA_tile_raster_order extension.
* docs: Update the list of used MESA GL enums.Eric Anholt2017-10-101-0/+10
| | | | Acked-by: Nicolai Hähnle <[email protected]>
* docs: Fix a typo in the old MESA_program_debug spec.Eric Anholt2017-10-101-1/+1
| | | | | | | Noticed that we had two 0x8bb4 in the spec while grepping to find an open slot in the MESA enums set. gl.xml had the right value. Acked-by: Nicolai Hähnle <[email protected]>
* git_sha1_gen: accept MESA_GIT_SHA1_OVERRIDE env varBrian Paul2017-10-101-13/+26
| | | | | | | | | | | | | | | | If one uses a parent build script to download/build Mesa we may not have a full git repository (maybe a tar archive) so the 'git rev-parse' command will fail. This updates the script to look for a MESA_GIT_SHA1_OVERRIDE env var. If it's set, use that sha1 instead of using git rev-parse. With this change we can put a git hash in the GL_VERSION string even when we don't have a git repo. v2: incorporate Dylan's suggestions to simplify the code Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* mesa: move _mesa_half_is_negative() to half_float.hBrian Paul2017-10-102-6/+8
| | | | | | | | v2: use !! in the function to be explicit about type conversion. Though, gcc generates the same code with or without the logical !!. Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* mesa: move _mesa_exec_malloc/free() prototypes to their own headerBrian Paul2017-10-106-7/+41
| | | | | | | | Try to start removing things from the cluttered imports.h file. v2: add new header to Makefile.sources Reviewed-by: Roland Scheidegger <[email protected]>
* i965: minor whitespace fixKenneth Graunke2017-10-101-1/+1
|
* mesa: Set new renderbuffers to RGBA4 on all GLES contexts.Eric Anholt2017-10-101-1/+1
| | | | | | | | | Before we were doing RGBA4 on GLES3 only, but as of GLES2 2.0.22 it should be RGBA4 as well. Fixes DEQP functional.state_query.rbo.renderbuffer_internal_format. Tested-by: Matt Turner <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Expose GL_OES_required_internalformat on GLES contexts.Eric Anholt2017-10-105-39/+75
| | | | | | | | | | | | | | | | | | | | | | | This extension is effectively a backport of GLES3's internalformat handling to GLES 1/2. It guarantees that sized internalformats specified for textures and renderbuffers have at least the specified size stored. That's a pretty minimal requirement, so I think it can be dummy_true and exposed as a standard in Mesa. As a side effect, it also allows GL_RGB565 to be specified as a texture format, not just as a renderbuffer. Mesa had previously been allowing 565 textures, which angered DEQP in the absence of this extension being exposed. v2: Allow 2101010rev with sized internalformats even on GLES3, citing the extension spec. Extend extension checks for GLES2 contexts exposing with texture_float, texture_half_float, and texture_rg. v3: Fix ALPHA/LUMINANCE/LUMINANCE_ALPHA error checking (GLES3 CTS failures) v4: Mark GL_RGB10 non-color-renderable on ES, fix A/L/LA errors on GLES2 with float formats. Reviewed-by: Nicolai Hähnle <[email protected]>
* mesa: Only expose GLES's EXT_texture_type_2_10_10_10_REV if supported in HW.Eric Anholt2017-10-105-2/+10
| | | | | | | | | | | | Previously, we were downconverting to 8888 automatically if the hardware didn't suport it. However, with the advent of GL_OES_required_internalformat, we have to actually store the internalformats we advertise support for. And, it seems rather disingenuous to advertise the extension if we don't actually support it. v2: Throw an error when using the format on ES2 without the extension present. Reviewed-by: Nicolai Hähnle <[email protected]>
* vc4: Add support for 5551 textures.Eric Anholt2017-10-102-3/+3
| | | | | This keeps us from promoting them up to 8888, at the cost of not being color-renderable.
* gallium: Add support for 5551 with the 1-bit field in the low bit.Eric Anholt2017-10-104-2/+18
| | | | | | | | | | | | This is how VC4 stores 5551 textures, which we need to support for GL_OES_required_internalformat. v2: Extend commit message, fix svga driver build, add BE ordering from Roland. v3: Rebase on PIPE_FORMAT_R10G10B10X2_UNORM addition. Reviewed-by: Marek Olšák <[email protected]> (v2) Reviewed-by: Nicolai Hähnle <[email protected]> (v2)
* mesa: Add X1B5G5R5 along with A1B5G5R5.Eric Anholt2017-10-105-0/+9
| | | | | | | | | | For supporting RGB5 in hardware with A in the low bit (vc4), we need this format as well. v2: Add proper _mesa_format_matches_format_and_type() support (from Nicolai). Reviewed-by: Nicolai Hähnle <[email protected]> (v1)
* st_api: remove unused get_resource_for_egl_imageNicolai Hähnle2017-10-101-37/+0
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* st/dri: implement createImageFromRenderbuffer(2)Nicolai Hähnle2017-10-104-7/+76
| | | | | | Tested with dEQP-EGL.functional.image.*renderbuffer* tests. Reviewed-by: Eric Anholt <[email protected]>
* egl/dri: remove old left-oversNicolai Hähnle2017-10-101-2/+0
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri: use createImageFromRenderbuffer2 when availableNicolai Hähnle2017-10-101-3/+20
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* egl/dri: factor out egl_error_from_dri_image_errorNicolai Hähnle2017-10-101-28/+26
| | | | Reviewed-by: Eric Engestrom <[email protected]>
* dri_interface: add an error-returning version of createImageFromRenderbufferNicolai Hähnle2017-10-101-1/+18
| | | | | | | | | We ought to be able to distinguish between allocation errors and bad parameters (non-existent renderbuffer object). Bumps the version of the DRI Image extension to 17. Reviewed-by: Eric Engestrom <[email protected]>
* st/mesa: don't clobber glGetInternalformat* buffer for GL_NUM_SAMPLE_COUNTSNicolai Hähnle2017-10-101-1/+2
| | | | | | | | | | Applications might pass in a buffer that is sized too large and rely on the extra space of the buffer not being overwritten. Fixes dEQP-GLES31.functional.state_query.internal_format.partial_query.num_sample_counts Cc: [email protected] Reviewed-by: Marek Olšák <[email protected]>
* u_threaded_context: fix a memory leakNicolai Hähnle2017-10-101-7/+8
| | | | | | | | The uploaders can own transfers which need to be unmapped. Destroy them before the final sync (they're not used from the driver thread anyway) so that the transfer_unmap call is processed by the driver. Reviewed-by: Marek Olšák <[email protected]>
* disk_cache: remove unnecessary NULL-pointer guardsNicolai Hähnle2017-10-101-4/+2
| | | | Reviewed-by: Marek Olšák <[email protected]>
* disk_cache: fix a memory leakNicolai Hähnle2017-10-101-0/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: whitespace fixNicolai Hähnle2017-10-101-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix import of EGL images with non-zero level or layerNicolai Hähnle2017-10-105-10/+28
| | | | | | | | | | In GL state, textures created from EGL images look like plain 2D textures with a single level, so we use the existing layer_override facility and add an analogous level_override one. Fixes dEQP-EGL.functional.image.create.gles2_cubemap_{positive,negative}_{x,y,z}_rgba_texture Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: fix switching from surface-based to non-surface-based texturesNicolai Hähnle2017-10-106-9/+14
| | | | | | | | | This can happen with surface-based texture objects derived from EGL images, since those aren't immutable. Fixes tests in dEQP-EGL.functional.sharing.gles2.multithread.random.images.teximage2d.* and others Reviewed-by: Marek Olšák <[email protected]>
* glsl/linker: add check for compute shared memory sizeNicolai Hähnle2017-10-103-6/+23
| | | | | | | | | | Unlike uniforms, the limit on shared memory size is not called out explicitly in the list of things that cause linker errors, but presumably that's just an oversight in the spec. Fixes dEQP-GLES31.functional.debug.negative_coverage.{callbacks,get_error,log}.compute.exceed_shared_memory_size_limit Reviewed-by: Timothy Arceri <[email protected]>