Commit Graph

115167 Commits

Author SHA1 Message Date
Alyssa Rosenzweig d34e3f7e0a pan/midgard: Remove cppwrap.cpp
It has not been used in a long time; I forgot this file even existed.
Flagged by cppcheck.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-09-03 13:55:21 +02:00
Alyssa Rosenzweig 1a4153b24c pan/midgard: Fix cppcheck issues
Miscellaneous minor issues flagged by cppcheck.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-09-03 13:54:21 +02:00
Alyssa Rosenzweig 032e21b33e pan/midgard: Correct issues in disassemble.c
cppcheck.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-09-03 13:54:05 +02:00
Alyssa Rosenzweig 23376c2d35 pan/decode: Add missing format specifier
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-09-03 13:42:08 +02:00
Alyssa Rosenzweig dc342aaac3 pan/decode: Use portable format specifier for 64-bit
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-09-03 13:42:04 +02:00
Alyssa Rosenzweig bcfcb7e624 pan/decode: Use %zu instead of %d
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-09-03 13:41:59 +02:00
Alyssa Rosenzweig d6d6d6327a pan/decode: Fix uninitialized variables
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2019-09-03 13:41:34 +02:00
Juan A. Suarez Romero c1c0386676 docs: update calendar, add news item and link release notes for 19.1.6
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
2019-09-03 13:06:56 +02:00
Juan A. Suarez Romero b3763dab18 docs: add sha256 checksums for 19.1.6
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 4ec2325dd0)
2019-09-03 13:04:49 +02:00
Juan A. Suarez Romero 4151947583 docs: add release notes for 19.1.6
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
(cherry picked from commit 85c8f88a49)
2019-09-03 13:04:45 +02:00
Lionel Landwerlin 320b0f66c2 vulkan/overlay: bounce image back to present layout
Once we write the overlay to an image to be presented, we must not
forget to put it back into present layout.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111401
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
2019-09-03 07:11:58 +00:00
Zhaowei Yuan 9db06a5350 broadcom/vc4: Expand width of dst surface
Four bytes of src_surf will be compressed into a 32-bits data and
stored into dst_surf, and dst_surf is read as z-order, so its width
must be aligned to multiples of 8(4x2) before divided by 2.

Signed-off-by: Zhaowei Yuan <zhaowei.yuan@samsung.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111266

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
2019-09-03 08:47:43 +02:00
Vinson Lee 538820ff5f swr: Fix make_unique build error.
swr_shader.cpp: In function ‘void (* swr_compile_gs(swr_context*, swr_jit_gs_key&))(HANDLE, HANDLE, SWR_GS_CONTEXT*)’:
swr_shader.cpp:732:44: error: ‘make_unique’ was not declared in this scope
    ctx->gs->map.insert(std::make_pair(key, make_unique<VariantGS>(builder.gallivm, func)));
                                            ^~~~~~~~~~~

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
2019-09-02 14:52:23 -07:00
nia 1900b82dbf loader: include limits.h for PATH_MAX
This is needed to build on illumos.

The location of the PATH_MAX definition in limits.h seems to be fairly standard:
https://pubs.opengroup.org/onlinepubs/009695399/basedefs/limits.h.html

Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-09-02 15:49:34 +00:00
Erik Faye-Lund 2f82d972ab util: only allow _BitScanReverse64 on 64-bit cpus
While the documentation for _BitScanReverse64 on MSDN says that it's
available on ARM, this isn't true. It's only available on ARM64. So
let's match reality.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Acked-by: Matt Turner <mattst88@gmail.com>
2019-09-02 12:45:45 +00:00
Erik Faye-Lund 1de9ba33a2 mesa/x86: improve SSE-checks for MSVC
This enables some more SSE optimizations on MSVC builds.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-09-02 12:45:45 +00:00
Erik Faye-Lund 06099d0e0c util: do not assume MSVC implies SSE
This is not true for MSVC on ARM.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-09-02 12:45:45 +00:00
Erik Faye-Lund 2ade1c5cf7 util: fix SSE-version needed for double opcodes
This code generates CVTSD2SI, which requires SSE2. So let's fix the
required SSE-version.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 5de29ae (util: try to use SSE instructions with MSVC and 32-bit gcc)
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-09-02 12:45:45 +00:00
Erik Faye-Lund ee2bc11cc7 mesa/main: remove unused include
This has been unused since 183db3a645 ("glsl: move half<->float
convertion to util"), Oct 10 2015. Let's drop needlessly including it.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
2019-09-02 12:45:45 +00:00
Samuel Pitoiset 966a455bb9 nir: do not assume that the result of fexp2(a) is always an integral
It's only correct when 'a' is an integral greater or equal to 0.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111493
Fixes: 5544b2cbbd ("nir/algebraic: Use value range analysis to eliminate useless unary ops")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2019-09-02 09:00:37 +02:00
Lionel Landwerlin 6775a52400 egl: fix platform selection
Add missing "device" platform

v2: Add the missing platform (Eric)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reported-by: Jean Hertel <jean.hertel@hotmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=111529
Fixes: d6edccee8d ("egl: add EGL_platform_device support")
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-09-02 06:28:06 +03:00
Kenneth Graunke 87fa8d9ebc iris: Lessen texture cache hack flush for blits/copies on Icelake.
Lionel found actual documentation for this at long last.  Apparently
it actually is a sampler cache limitation that was mostly fixed on
Icelake.  Unfortunately, it seems there are still issues with ASTC
and non-ASTC sampler views.  Still, we can lessen the flush condition
from "format mismatch" to "ASTC mismatch", which eliminates most of
the flushing here.

We also update the documentation to refer to the workaround name.
2019-08-31 20:17:55 -07:00
Vinson Lee 4771f6bccc util: Define strchrnul on macOS.
strchrnul is not available on macOS.

pipe_loader.c:141:14: error: implicit declaration of function 'strchrnul' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
      next = strchrnul(library_paths, ':');
             ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-08-31 13:26:10 -07:00
Erik Faye-Lund 52af1427c6 gallium/auxiliary/indices: consistently apply start only to input
The majority of these only apply the start argument to the input, but a
few of them also does for the output-array. util_primconvert, the only
user of this argument expects this pass a non-zero start-argument does
not expect this to be applied to the output; if it is, it will write
outside of allocated memory, leading to VRAM corruption.

The reason this doesn't seem to have been noticed before, is that no
driver currently use util_primconvert to convert a primitive-type to
itself, which is the cases where this was broken. But for Zink, this
will no longer be true, because we need to eliminate the use of 8-bit
index-buffers.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 28f3f8d413 ("gallium/auxiliary/indices: add start param")
Reviewed-by: Rob Clark <robdclark@chromium.org>
2019-08-31 19:45:52 +00:00
Vinson Lee 029b07b2ad travis: Fail build if any command in if statement fails.
Travis is checking the exit code of the entire if statement.

Fixes: 64ffc289be ("travis: add MacOS Scons build")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2019-08-31 12:20:04 -07:00
Vinson Lee 3664a6600e swr: Fix build with llvm-9.0 again.
Commit 6f7306c029 ("swr/rast: Refactor memory API between rasterizer
core and swr") unintentionally removed changes for llvm-9.0.

Fixes: 6f7306c029 ("swr/rast: Refactor memory API between rasterizer core and swr")
Fixes: 5dd9ad1570 ("swr/rasterizer: Better implementation of scatter")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Jan Zielinski <jan.zielinski@intel.com>
2019-08-31 00:20:40 -07:00
Alyssa Rosenzweig 20237166b6 pan/midgard: Use shared psiz clamp pass
We already had a perfectly cromulent pass for this, but one landed in
common NIR code so let's switch and lighten our tree.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 16:06:09 -07:00
Alyssa Rosenzweig 0b225f1892 pan/midgard: Remove mir_opt_post_move_eliminate
This optimization depended on RA running before scheduling. It therefore
no longer applies and is now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:28 -07:00
Alyssa Rosenzweig d699a17475 pan/midgard: Schedule before RA
This is a tradeoff.

Scheduling before RA means we don't do RA on what-will-become pipeline
registers. Importantly, it means the scheduler is able to reorder
instructions, as registers have not been decided yet.

Unfortunately, it also complicates register spilling, since the spills
themselves won't get bundled optimally and we can only spill twice per
ALU bundle (only one spill per bundle allowed here). It also prevents us
from eliminating dead moves introduced by register allocation, as they
are not dead before RA. The shader-db regressions are from poor spilling
choices introduced by the new bundling requirements. These could be
solved by the combination of a post-scheduler (to combine adjacent
spills into bundles) with a VLIW-aware spill cost calculation.
Nevertheless, the change is small enough that I feel it's worth it to
eat a tiny shader-db regression for the sake of flexibility.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:28 -07:00
Alyssa Rosenzweig 5e06d90c45 pan/midgard: Handle fragment writeout in RA
Rather than using a pile of hacks and awkward constructs in MIR to
ensure the writeout parameter gets written into r0, let's add a
dedicated shadow register class for writeout (interfering with work
register r0) so we can express the writeout condition succintly and
directly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:27 -07:00
Alyssa Rosenzweig 116b17d2d1 pan/midgard: Do not propagate swizzles into writeout
There's no slot for it; you'll end up writing into the void and
clobbering stuff. Don't. do it.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:27 -07:00
Alyssa Rosenzweig eb3cc20f42 pan/midgard: Fix misc. RA issues
When running the register allocator after scheduling, the MIR looks a
little different, so we need to extend the RA to handle a few of these
extra cases correctly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:27 -07:00
Alyssa Rosenzweig e5ba016d3a pan/midgard: Print MIR by the bundle
After scheduling, we still have valid MIR, but we have additional
bundling annotations which we would like to keep debug, so print these.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:27 -07:00
Alyssa Rosenzweig f42cebdd84 pan/midgard: Print branches in MIR
Rather than a vague "br.??" line, annotate the branch with its target
type (useful for disambiguating discards) and whether it was inverted.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig 59f2cfcbc7 pan/midgard: Remove texture_index
This is deadcode.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig 76529836ec pan/midgard: Cleanup fragment writeout branch
I'm not sure if this is strictly necessary but it makes debugging easier
and minimizes the diff with the experimental scheduler.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig cc2ba8efe9 pan/midgard: Add scheduling barriers
Scheduling occurs on a per-block basis, strongly assuming that a given
block contains at most a single branch. This does not always map to the
source NIR control flow, particularly when discard intrinsics are
involved. The solution is to allow scheduling barriers, which will
terminate a block early in code generation and open a new block.

To facilitate this, we need to move some post-block processing to a new
pass, rather than relying hackily on the current_block pointer.

This allows us to cleanup some logic analyzing branches in other parts
of the driver us well, now that the MIR is much more well-formed.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig 19bceb5812 pan/midgard: Track shader quadword count while scheduling
This allow multiblock blend shaders to compute constant colour offsets
correctly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig 72cbd2d4e7 pan/midgard: Allow NULL argument in mir_has_arg
It's sometimes convenient to call this with no instruction specified. By
definition, a missing instruction cannot reference any argument, so
let's check for NULL and shortciruit to false.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig bcc59ff04d pan/midgard: Improve mir_mask_of_read_components
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig 5377d70292 pan/midgard: Extend mir_special_index to writeout
The branch has the writeout specified in its source list, making this
special even if it's not explicitly part of r0.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:26 -07:00
Alyssa Rosenzweig b56399fcd2 pan/midgard: csel_swizzle with mir get swizzle
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:25 -07:00
Alyssa Rosenzweig 28622f9088 pan/midgard: Add mir_insert_instruction*scheduled helpers
In order to run register allocation after scheduling, it is sometimes
necessary to be able to insert instructions into an already-scheduled
program. This is suboptimal, since it forces us to do a worst-case
scheduling, but it is nevertheless required for correct handling of
spills/fills. Let's add helpers to insert instructions as standalone
bundles for use in spilling code.

These helpers are minimal -- they *only* work on load/store ops or
moves. They should not be used for anything but register spilling; any
other instructions should be added prior to the schedule.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:25 -07:00
Alyssa Rosenzweig 8e369966d7 pan/midgard: Track csel swizzle
While it doesn't matter with an unconditional move to the conditional
register (r31), when we try to elide that move we'll need to track the
swizzle explicitly, and there is no slot for that yet since ALU ops are
normally binary.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:24 -07:00
Alyssa Rosenzweig a8eafb0b74 pan/midgard: Ensure fragment writeout is in the final block
This ensures the block only has exactly one branch, which makes
scheduling happy.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:24 -07:00
Alyssa Rosenzweig cfd5bd2c7d pan/midgard: Document Midgard scheduling requirements
Oh boy. Midgard scheduling is crazy... These are all just the
requirements, not even the algorithm yet.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:24 -07:00
Alyssa Rosenzweig d6e4e36566 pan/midgard: Include condition in branch->src[0]
This will allow us to reference the condition while scheduling.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:24 -07:00
Alyssa Rosenzweig bd79cddafa pan/midgard: Add post-schedule iteration helpers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:24 -07:00
Alyssa Rosenzweig f29d03a1f9 pan/midgard: Fix corner case in RA
It doesn't really matter but... meh.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:24 -07:00
Alyssa Rosenzweig d722b60191 pan/midgard: Add OP_IS_CSEL_V helper
..to distinguish from scalar csel.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
2019-08-30 15:50:24 -07:00