Commit Graph

124353 Commits

Author SHA1 Message Date
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
Marek Olšák 2a3806ffa3 amd: replace SH -> SA (shader array) in comments
Reviewed-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
Marek Olšák 2cf46f2e3d ac/gpu_info: replace num_good_cu_per_sh with min/max_good_cu_per_sa
Perf counters use the new max number.

Reviewed-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
Marek Olšák 8c3fe285c9 radeonsi: don't hardcode most perf counter block counts
Reviewed-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
Erik Faye-Lund f3c1833b77 docs/features: mark GL_ARB_texture_multisample as done for zink
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5159>
2020-05-26 07:55:17 +00:00
Erik Faye-Lund cd1639cbe3 zink: expose PIPE_CAP_TEXTURE_MULTISAMPLE
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5159>
2020-05-26 07:55:17 +00:00
Erik Faye-Lund 4f90e818c8 zink: implement nir_texop_txf_ms
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5159>
2020-05-26 07:55:17 +00:00
Gert Wollny caa83e4d79 r600/sfn: remove debug output leftover
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5187>
2020-05-26 06:17:42 +00:00
Gert Wollny cead23cb8a r600/sfn: Correctly update the number of literals when forcing a new
group

When forcing a new instruction group by adding a ALU_OP_NOP, the
literals for the instruction that triggered this must be taken into
account for the next group, so update the number of literals
accordingly.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5187>
2020-05-26 06:17:42 +00:00
Gert Wollny 12381a0410 r600/sfn: use modern c++ in printing LDS read instruction
Closes #3021

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5187>
2020-05-26 06:17:42 +00:00
Gert Wollny eccf939b6f r600/sfn: Fix mapping for f32tof64 and f64tof32
We define the mapping based on the vector unit opcode.

Closes #3013

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5187>
2020-05-26 06:17:42 +00:00
Gert Wollny 901793d558 r600: Fix duplicated subexpression in r600_asm.c
Fixes: 4422ce1b04
    r600: force new CF with TEX only if any texture value is written

Closes #3012

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5187>
2020-05-26 06:17:42 +00:00
Rob Clark ceab349483 freedreno/drm: disallow exported buffers in bo cache
Otherwise we can MADVISE(WONTNEED) a bo that someone else is still
using.  We already handled that in the dma-buf and flink-name export
paths.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5204>
2020-05-25 20:47:24 +00:00
Vinson Lee 1241f8cb4c r600/sfn: Use correct setter method.
Fix warning reported by Coverity Scan.

Useless call (USELESS_CALL)
side_effect_free: Calling v->pin_to_channel() is only useful for its
return value, which is ignored.

Fixes: 5d10e3ec60 ("r600/nir: Pin interpolation results to channel")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5197>
2020-05-25 20:34:36 +00:00
Erik Faye-Lund ed1fd7bcc6 zink: pass batch instead of context for queries
This makes things a bit more consistent IMO.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5141>
2020-05-25 20:20:49 +00:00
Erik Faye-Lund 43c691b5b0 zink: do not dig into resource for nr_samples
The pipe_surface also know this, so no point in digging so deep.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5141>
2020-05-25 20:20:49 +00:00