Commit Graph

124318 Commits

Author SHA1 Message Date
Alyssa Rosenzweig bb5e10af24 iris: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 17199107fd i965: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig f59d02a86d intel: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 7ea2ad0b39 softpipe: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 9983c4cd68 panfrost: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 82996a8cff glsl: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig a024b39427 gallium/draw: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 747cb95e3c mesa/swrast: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 05bacdb917 mesa: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 0f1fde1faf util/format: Use SATURATE
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Alyssa Rosenzweig 35938c15e2 util: Add SATURATE macro
Equivalent to clamp(x, 0.0, 1.0) or fsat in NIR. Useful for format
packing, among other uses given the variety of substituions in-tree.

v2: Drop brackets (Eric).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5100>
2020-05-26 22:31:31 +00:00
Caio Marcelo de Oliveira Filho 8cc7711924 intel/fs: Remove redundant assert()
This is covered by the two previous similar asserts.  Each time `v` is
assigned this is asserted.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5213>
2020-05-26 20:35:03 +00:00
Caio Marcelo de Oliveira Filho 462bc408fe intel/fs: Early return when can't satisfy explicit group size
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5213>
2020-05-26 20:35:03 +00:00
Caio Marcelo de Oliveira Filho 2a308ee4c7 intel/fs: Remove unused state from brw_nir_lower_cs_intrinsics
After 2663759af0 ("intel/fs: Add and use a new load_simd_width_intel
intrinsic") the local_workgroup_size is not used anymore except for
assertions at the pass' start, so drop it from state struct.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5213>
2020-05-26 20:35:03 +00:00
Caio Marcelo de Oliveira Filho 5e0525e145 intel/fs: Remove unused emission of load_simd_with_intel
The nir_intrinsic_load_simd_width_intel is always lowered by the
brw_nir_lower_simd() pass before the emission happens.  This is likely
a "leftover" from patch rewriting/squashing that happened when this
intrinsic was added.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5213>
2020-05-26 20:35:03 +00:00
Kristian H. Kristensen a5a413e19a egl/android: Drop unused variable
src/egl/drivers/dri2/platform_android.c:332:29: warning: unused
variable 'dri2_dpy' [-Wunused-variable]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen 09efdccf4a egl/android: Move get_format under HAVE_DRM_GRALLOC guard where it's used
src/egl/drivers/dri2/platform_android.c:159:12: warning: unused
function 'get_format' [-Wunused-function]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen c26317ebd6 mesa/st: Use memset to zero out struct
This is a non-stop source of warnings and build breakage. memset works
everywhere.

src/mesa/state_tracker/st_tgsi_lower_depth_clamp.c:354:45: warning:
suggest braces around initialization of subobject [-Wmissing-braces]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen 12653beacb mapi: Fix a couple of warning in generated code
safe_mul may not be used and clang doesn't understand the "optimize"
attribute.

src/mapi/glapi/gen/marshal_generated0.c:1216:16: warning: unknown
attribute 'optimize' ignored [-Wunknown-attributes]

src/mapi/glapi/gen/marshal_generated0.c:36:19: warning: unused
function 'safe_mul' [-Wunused-function]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen 8341f30f1e src/util: Remove out-of-range comparison
Silence the warning about this always-true comparison.

src/util/softfloat.c:214:42: warning: comparison of constant 32768
with expression of type 'int16_t' (aka 'short') is always false
[-Wtautological-constant-out-of-range-compare]
        } else if ((e > 0x1d) || (0x8000 <= m)) {
                                  ~~~~~~ ^  ~

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen f4e64e9f53 freedreno/ir3: Avoid {0} initializer for struct reginfo
First element is not a scalar.  Just initialize the struct like we do
elsewhere.

src/freedreno/ir3/disasm-a3xx.c:958:33: warning: suggest braces around
initialization of subobject [-Wmissing-braces]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen 06ab93d694 turnip: Use {} initializer to silence warning
We're already using the {} syntax elsewhere in turnip.

src/freedreno/vulkan/tu_formats.c:828:71: warning: suggest braces
around initialization of subobject [-Wmissing-braces]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen 697fe1c801 turnip: Use tu6_reduction_mode() to avoid warning
This makes it a little more explicit that the values line up.

src/freedreno/vulkan/tu_device.c:2209:75: warning: implicit conversion
from enumeration type 'const VkSamplerReductionMode' (aka 'const enum
VkSamplerReductionMode') to different enumeration type 'enum
a6xx_reduction_mode' [-Wenum-conversion]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Kristian H. Kristensen fff17707ea turnip: Use hw enum when emitting A6XX_RB_STENCIL_CONTROL
We're hard-coding this value, so let's use the hw enum and avoid a
warning.

src/freedreno/vulkan/tu_clear_blit.c:2091:19: warning: implicit
conversion from enumeration type 'enum VkStencilOp' to different
enumeration type 'enum adreno_stencil_op' [-Wenum-conversion]

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5174>
2020-05-26 12:46:18 -07:00
Rob Clark 6aa3004d60 freedreno/gmem: split out helper to calc # of bins
Gets the `nbins_x`/`y` local vars out of the main layout function,
to prevent any confusion like what was fixed in the previous patch
from sneaking back in.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
2020-05-26 19:29:34 +00:00
Rob Clark fcecdcd822 freedreno/gmem: fix nbins_x/y mismatch
`layout_gmem()` recalculates the # of bins in x/y dimensions after
aligning the bin width/height to required dimensions.  Because of this,
the resulting gmem config could have fewer bins in either dimension.
But the tile/bin layout and the pipe assignment logic were still using
the original values.  Which could result in extraneous bins with a
width and/or height of zero.

Because the gmem rendering code uses `gmem->bin_w`/`h` to determine
the number of bins, this could result in some zero size bins being
executed, while later valid bins are skipped.  Which can leave un-
rendered portions of the screen (generally lower-right).

To fix this, be sure to use `gmem->bin_w`/`h` rather than the local
variables.

Fixes: 1bd38746d5 ("freedreno/gmem: rework gmem layout algo")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
2020-05-26 19:29:34 +00:00
Rob Clark 9b91d88b33 freedreno/gmem: add some asserts
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
2020-05-26 19:29:34 +00:00
Rob Clark 1679efe927 freedreno/gmemtool: add verbose mode
And real getopt arg parsing.. now that we have one.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
2020-05-26 19:29:34 +00:00
Rob Clark 9c6693f0e4 freedreno/gmemtool: add a405
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
2020-05-26 19:29:34 +00:00
Rob Clark b20663c5ba freedreno/gmemtool: make GMEM alignment per-gen
`gmem_page_align` is generation specific (with the exception of a2xx
which has a different value for fast-clear).  So we should override the
value from the captured gmem_key according to the gpu we are emulating
for the purposes of calculating gmem config.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5189>
2020-05-26 19:29:34 +00:00
Rob Clark fec8288081 freedreno/gmem: make noscis debug actually do something on a6xx
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5188>
2020-05-26 19:14:22 +00:00
Rob Clark 3024d00900 freedreno: handle PIPE_TRANSFER_MAP_DIRECTLY
Just something I noticed in the process of debugging the issue fixed in
the previous commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5188>
2020-05-26 19:14:22 +00:00
Rob Clark 8728c42031 freedreno: clear last_fence after resource tracking
The resource tracking in the clear/draw_vbo/blit paths could itself
trigger a flush.  Which would update last_fence.  So we need to clear
last_fence *after* all the dependency tracking.

Fixes: ddb7fadaf8 ("freedreno: avoid no-op flushes by re-using last-fence")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2992
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5188>
2020-05-26 19:14:22 +00:00
Rob Clark 4c97a716a6 freedreno: add batch debugging
Something I cooked up in the process of debugging the issue fixed in the
next commit.  Might come in useful again in the future.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5188>
2020-05-26 19:14:22 +00:00
Rhys Perry 8e2009c448 nir: fix lowering to scratch with boolean access
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Fixes: 18ed82b084
   ('nir: Add a pass for selectively lowering variables to scratch space')

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5214>
2020-05-26 18:54:17 +00:00
Kristian H. Kristensen e369b8931c freedreno: Use explicit *_NONE enum for undefined formats
This adds RB, VFMT and TFMT NONE values for a3xx-a5xx and FMT6_NONE
for a6xx.  Use those values instead of open coded (enum xxx) ~0 or
sometimes even ~0, which triggers out-of-enum range warnings.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5173>
2020-05-26 18:35:03 +00:00
Eric Anholt 5ec3747fbe freedreno/ir3: Use RESINFO for a6xx image size queries.
The closed GL driver uses resinfo on images with the writeonly flag (using
the texture-path's getsize only for readonly images).  The closed vulkan
driver seems to use resinfo regardless.  Using resinfo doesn't need any
fixups after the instruction.  It also avoids one of the needs for the
TEX_CONST state for the image, which is awkward to set up in the GL
driver.

The new handler goes into ir3_a6xx to be next to the other current image
code, but the a4xx version is left in place because it wants a bunch of
sampler helpers.

Fixes assertion failure in dEQP-VK.image.image_size.buffer.readonly_32.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Eric Anholt 2ec4c53ef9 freedreno/ir3: Move handle_bindless_cat6 to compiler_nir and reuse.
There was an open coded version for ldc, and now we can drop that.  I
needed to do it for resinfo as well.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Eric Anholt 2068b01430 freedreno/ir3: Refactor out IBO source references.
All the users of the unsigned result just wanted an ir3_instruction to
reference.  Move a6xx's helpers to ir3_image.c and inline the old unsigned
results version.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Eric Anholt 00b9099dd5 freedreno: Set the immediate flag in a4/a5xx resinfos.
Noticed comparing our RESINFO asm to qcom's for the same test, and if I
drop this bit their disasm switches from immediate to reg.  ldgb seems to
have the same behavior.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Eric Anholt ae00da5ddb freedreno: Fix resinfo asm, which doesn't have srcs besides IBO number.
In the process, clarify what's going on with the LDC/LDIB case.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Eric Anholt c1cb75678d freedreno: Add more resinfo/ldgb testcases.
Since I'm going to start using the resinfo opcode, make sure we can disasm
the blob's instances of it that I've found.  And, since resinfo disasm
will impact ldgb on pre-a6xx, include some of those too.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Eric Anholt 5d4a911d8c freedreno: Fix printing of unused src in disasm of cat6 RESINFO.
Compare to QC's disasm right next to ours, and we clearly had an extra src
that wouldn't make sense.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Eric Anholt 4f02b48071 freedreno/a6xx: Fix the size of buffer image views.
We were using the size of the underlying buffer (in R8 elements), while we
need to be using the size of the image view (which may be a subset of the
underlying buffer, and may be in a different format from R8).

This fix means less dereferencing off of the end of shader image views for
buffer images, but more importantly is needed to get the right answer from
resinfo if we are to switch to that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3501>
2020-05-26 18:17:46 +00:00
Connor Abbott 3987e25c03 tu: Add missing storage image/texel buffer bits
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5122>
2020-05-26 11:16:09 +00:00
Connor Abbott 439a4ac025 tu: Respect VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT
This came up with some image tests that are enabled by the next commit.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5122>
2020-05-26 11:16:09 +00:00
Connor Abbott 08d22bb908 tu: Fix IBO descriptor for cubes
They act the same as 2D arrays when used as storage images, and we're
supposed to override the IBO descriptor to reflect this.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5122>
2020-05-26 11:16:09 +00:00
Marcin Ślusarz f7ab9c4eb1 glsl: cleanup vertex shader input checks
Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5133>
2020-05-26 10:15:17 +00:00
Marcin Ślusarz e89d34aaca glsl_to_tgsi: add fallthrough comments
All those cases are supposed to hit an assert in ir_binop_bit_or case.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5133>
2020-05-26 10:15:17 +00:00
Marek Olšák 38a4b86145 radeonsi/gfx10: implement most performance counters
PAL has all of them.

GE perf counters don't work - no idea why.
I only tested the few that I like to use.

There is no documentation, though most of the enums had already been
in the headers.

Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5184>
2020-05-26 06:00:54 -04:00