Commit Graph

670 Commits

Author SHA1 Message Date
Marek Olšák b688ea31fc gallium: add unbind_num_trailing_slots to set_sampler_views
Instead of calling this functions again to unbind trailing slots,
extend it to do it when binding. This reduces CPU overhead.

A lot of drivers ignore "start" and always unbind all slots after "count".
Such drivers don't need any changes here.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>
2021-01-27 23:53:35 +00:00
Marek Olšák 0278d1fa32 gallium: add unbind_num_trailing_slots to set_vertex_buffers
Instead of calling this functions again to unbind trailing slots,
extend it to do it as part of the call that sets vertex buffers.
This reduces CPU overhead. Only st/mesa benefits from this.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>
2021-01-27 23:53:34 +00:00
Marek Olšák a51d4b10f1 gallium: add take_ownership param into set_constant_buffer to eliminate atomics
We often do this:
    pipe->set_constant_buffer(pipe, shader, slot, &cb);
    pipe_resource_reference(&cb->buffer, NULL);

That results in atomic increment in set_constant_buffer followed by
atomic decrement after set_constant_buffer. This new interface
eliminates those atomics.

For the case above, this should be used instead:
    pipe->set_constant_buffer(pipe, shader, slot, true, &cb);
    cb->buffer = NULL; // if cb is not a local variable, else do nothing

AMD Zen benefits from this. The perf improvement is ~3% for Viewperf13/Catia.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8298>
2021-01-27 23:53:34 +00:00
Christian Gmeiner 81ab9fe2d0 etnaviv: handle NULL views in set_sampler_views
Passing NULL for the views parameter should be the same as passing an
array of NULL, according to the documentation. So let's respect that
detail.

This fixes a crash when using GALLIUM_HUD. The wrong handling of views
parameter was causing problems starting with
2813688f8d ("gallium/hud: don't use cso_context to restore VBs, constbuf 0 and sampler views").

Cc: <mesa-stable@lists.freedesktop.org>
Fixes: c9e8b49b88 ("etnaviv: gallium driver for Vivante GPUs")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8670>
2021-01-25 20:42:22 +00:00
Daniel Schürmann bd8e84eb8d nir: replace .lower_sub with .has_fsub and .has_isub
This allows a more fine-grained control about whether
a backend supports one of these instructions.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6597>
2021-01-11 19:13:51 +00:00
Christian Gmeiner a302de9a43 etnaviv: add set_stream_output_targets(..) stub
When running gles3 deqp's with ETNA_MESA_DEBUG=deqp we fake streamout support.
CSO thinks that streamout is supported and calls ctx->pipe->set_stream_output_targets(..)
in cso_destroy_context(..) which results in a null-pointer access.

Add a stub to make development easier.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8382>
2021-01-10 20:42:37 +00:00
Marek Olšák 8fc6a19765 gallium: skip draws with count == 0 or instance_count == 0 in drivers
Fixes: 85b6ba136b "st/mesa: implement Driver.DrawGallium callbacks"

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8345>
2021-01-09 06:53:00 +00:00
Marek Olšák 05f35a50e3 gallium: remove and emulate PIPE_CAP_MULTI_DRAW
To remove PIPE_CAP checking in the common code.

It's better if drivers lower multi draws even if the hardware doesn't
support it beause the multi draw loop can be moved deeper into the driver
to remove more overhead.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7679>
2021-01-04 19:22:33 -05:00
Adam Jackson 8ddddfb516 treewide: Disambiguate various variables named "debug_options"
Name them after what they control so 'vi -t' can take you somewhere
useful.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8165>
2021-01-04 20:51:28 +00:00
Marek Vasut 33a6c01e12 etnaviv: Fix rework ZSA into a derived state
In case the stencil is modified, it is also enabled. That was the
behavior of the original code, which was also the correct behavior,
so reinstate the behavior.

Fixes dEQP-GLES2.functional.fragment_ops.depth_stencil.* on STM32MP1 GC400T.

Fixes: b29fe26d43 ("etnaviv: rework ZSA into a derived state")
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8174>
2021-01-03 08:46:06 +01:00
Marek Olšák 912ba743b5 gallium: inline pipe_depth_state to decrease DSA state size by 4 bytes
Depth and alpha states are now packed together, interleaved somewhat.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>
2020-12-22 12:01:38 +00:00
Marek Olšák d0534cea7f gallium: inline pipe_alpha_state to enable better DSA bitfield packing
pipe_alpha_state and pipe_depth_state will be packed together
because they have only a few bitfields each. This will eventually
remove 4 bytes of padding in pipe_depth_stencil_alpha_state.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>
2020-12-22 12:01:38 +00:00
Marek Olšák b7f12a0452 gallium: pass pipe_stencil_ref by value (it has only 2 bytes)
This changes pipe_context::set_stencil_ref to pass the parameter by value.

Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7940>
2020-12-22 12:01:38 +00:00
Lucas Stach 0ba788d73b etnaviv: tex_state: fix miplevel selection
Fixes the piglit tex-miplevel-selection test by:
1. properly taking texture baselevel and maxlevel into account
2. only enable lodbias when mipmapping is enabled

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7634>
2020-12-15 15:43:23 +01:00
Christian Gmeiner a5f4be4fcd etnaviv: remove imm_ prefix from etna_shader_uniform_info members
This prefix is meaningless.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8062>
2020-12-14 15:13:13 +00:00
Christian Gmeiner fefbafb6ff etnaviv: rename from immedaite to uniform in some places
This naming change should clarify what we are actually doing here.

We are defining/managing what data is stored in the GPUs
uniform data storage area. A shader can access this area with
the ETNA_RGROUP_UNIFORM register group.

In this uniform data area we need to store const buffer data and
own immediate/constant data.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8062>
2020-12-14 15:13:13 +00:00
Marek Olšák 6b6cb44ec8 gallium: fix the PIPE_SHADER_CAP_SUPPORTED_IRS value for all drivers
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7826>
2020-12-07 20:55:28 +00:00
Christian Gmeiner 3f4325e44b etnaviv: update fallthrough comments
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7849>
2020-12-02 13:52:12 +00:00
Mark Janes a1281f8a99 meson: add idep_mesautil to components using simple_mtx.h
If valgrind is installed, these components need to find valgrind.h.

Fixes: 53f7d539cd ("util: Add helgrind support for simple_mtx")
Closes: #3876
Acked-by: Rob Clark <robclark@freedesktop.org>
2020-11-24 18:13:07 -08:00
Marek Olšák 1cd455b17b gallium: extend draw_vbo to support multi draws
Essentially rename multi_draw to draw_vbo and remove start and count
from pipe_draw_info.

This is only an interface change. It doesn't add multi draw support
anywhere.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:25 +00:00
Marek Olšák abe8ef862f gallium: make pipe_draw_indirect_info * a draw_vbo parameter
This removes 8 bytes from pipe_draw_info (think u_threaded_context)
and a lot of info->indirect pointer indirections.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Marek Olšák 1a717dca04 gallium: move count_from_stream_output into pipe_draw_indirect_info
This removes some overhead from tc_draw_vbo and increases the maximum number
of draws per batch from 153 to 192 in u_threaded_context.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7441>
2020-11-18 01:41:24 +00:00
Christian Gmeiner 6fd20a0281 etnaviv: drop nir_print_shader(..) call
It makes no sense to print the shader in the middle of some NIR passes.
Instead someone could use NIR_PRINT=1 and call it a day. Also there
is a nir_print_shader(..) before calling emit_shader(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7625>
2020-11-16 19:38:59 +01:00
Lucas Stach b479a1f03c etnaviv: fix disabling of INT filter for real
Missing a copy of the pipe_sampler_state into the etna_sampler_state object
lead to the texture_use_int_filter() to always see a max_anisotropy of 0, so
the INT filter wasn't disabled when necessary. Also state emission should
never change the state objects, as this might also lead to stale information
being kept around the in the state object.

Fixes: 89a41dae77 (etnaviv: do not use int filter when
                     anisotropic filtering is used)

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7638>
2020-11-16 18:11:56 +00:00
Christian Gmeiner 9b6516ac24 etnaviv: nir: do not run opt loop after nir_lower_bool_xxx(..)
Running the optimizations after bool to float/int lowering is not going
to work. Large portions of NIR are likely to blow up if they see
floats/ints in weird places. Most of the bool->float/int conversions
are direct instruction substitutions and it's not going to leave a lot
of garbage around to optimize.

Fixes nir.h:261: nir_const_value_as_bool: Assertion `i == 0 || i == -1' failed
dEQP-GLES2.functional.shaders.loops.while_constant_iterations.no_iterations_vertex

Here are shader-db results for GC2000:

instructions HURT:   shaders/tesseract/488.shader_test FRAG:           516 -> 524 (1.55%)
instructions HURT:   shaders/tesseract/491.shader_test FRAG:           248 -> 260 (4.84%)
instructions HURT:   shaders/tesseract/494.shader_test FRAG:           244 -> 256 (4.92%)
instructions HURT:   shaders/tesseract/238.shader_test FRAG:           232 -> 244 (5.17%)
instructions HURT:   shaders/tesseract/241.shader_test FRAG:           232 -> 244 (5.17%)
instructions HURT:   shaders/tesseract/127.shader_test FRAG:           76 -> 80 (5.26%)
instructions HURT:   shaders/tesseract/130.shader_test FRAG:           148 -> 156 (5.41%)
instructions HURT:   shaders/tesseract/226.shader_test FRAG:           192 -> 204 (6.25%)
instructions HURT:   shaders/tesseract/229.shader_test FRAG:           192 -> 204 (6.25%)
instructions HURT:   shaders/tesseract/217.shader_test FRAG:           152 -> 164 (7.89%)
instructions HURT:   shaders/tesseract/214.shader_test FRAG:           152 -> 164 (7.89%)
instructions HURT:   shaders/tesseract/205.shader_test FRAG:           112 -> 124 (10.71%)
instructions HURT:   shaders/tesseract/202.shader_test FRAG:           112 -> 124 (10.71%)
instructions HURT:   shaders/tesseract/169.shader_test FRAG:           32 -> 36 (12.50%)
instructions HURT:   shaders/tesseract/166.shader_test FRAG:           32 -> 36 (12.50%)
instructions HURT:   shaders/deqp_gles3/61312.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/deqp_gles3/61309.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/deqp_gles3/61324.shader_test FRAG:        448 -> 508 (13.39%)
instructions HURT:   shaders/tesseract/118.shader_test FRAG:           28 -> 32 (14.29%)
instructions HURT:   shaders/tesseract/181.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/178.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/121.shader_test FRAG:           52 -> 60 (15.38%)
instructions HURT:   shaders/tesseract/193.shader_test FRAG:           72 -> 84 (16.67%)
instructions HURT:   shaders/tesseract/190.shader_test FRAG:           72 -> 84 (16.67%)

total instructions in shared programs: 64220 -> 64572 (0.55%)
instructions in affected programs: 4924 -> 5276 (7.15%)
helped: 5
HURT: 24
helped stats (abs) min: 4 max: 8 x̄: 5.60 x̃: 4
helped stats (rel) min: 4.35% max: 5.41% x̄: 4.72% x̃: 4.35%
HURT stats (abs)   min: 4 max: 60 x̄: 15.83 x̃: 12
HURT stats (rel)   min: 1.55% max: 16.67% x̄: 10.04% x̃: 10.71%
95% mean confidence interval for instructions value: 5.39 18.89
95% mean confidence interval for instructions %-change: 4.81% 10.18%
Instructions are HURT.

total temps in shared programs: 2514 -> 2512 (-0.08%)
temps in affected programs: 9 -> 7 (-22.22%)
helped: 2
HURT: 0

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7624>
2020-11-15 13:14:15 +00:00
James Jones 6ee10ab3de gallium: Add pipe_screen::is_dmabuf_modifier_supported
Add a "do you support this modifier?" query to all
drivers which support format modifiers. This will
be used in a subsequent change to fully
encapsulate modifier validation and auxiliary plane
count calculation logic behind the driver
abstraction, which will in turn simplify the
addition of device-class-specific format modifiers
in the nouveau driver.

Signed-off-by: James Jones <jajones@nvidia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3723>
2020-11-11 10:51:37 +00:00
Lucas Stach b29fe26d43 etnaviv: rework ZSA into a derived state
The ZSA state is not fully self contained, as other states (mostly
shader using discard or writing depth information) have an influence
on whether we can use early Z test/write.

Rework the ZSA state into a derived state that gets updated whenever
a new ZSA or SHADER state is bound. This way we can automatically
enable/disable early Z as needed.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7396>
2020-11-06 10:10:59 +01:00
Lucas Stach 3c7fc95f4f etnaviv: expose shader discard usage in etna_shader_variant
The information about a shader using discard/kill is interesting
to other parts of the driver, as depth states need to programmed
differently depending on this. As we don't want to deal with
NIR/TGSI differences in other parts of the driver, track this
usage in the common etna_shader_variant.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7396>
2020-11-06 10:10:59 +01:00
Lucas Stach bff60d665b etnaviv: update headers from rnndb
Update to etna_viv commit c8ba5e0ba5da.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7396>
2020-11-06 10:10:58 +01:00
Lucas Stach 83c72cab7a etnaviv: flush depth cache when changing depth config
Some depth config states changes require the depth cache to be
flushed, leading to a GPU hang if not done. As the conditions that
require the flush are not toally clear, better be safe than sorry
and always flush the cache on depth state changes.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7396>
2020-11-06 10:10:58 +01:00
Lucas Stach 01e2ded11f etnaviv: emit RA_EARLY_DEPTH on dirty ZSA
The RA_EARLY_DEPTH is a depth state and so must be emitted on
dirty ZSA, instead of dirty SHADER.

Fixes: 785e2707b0 (etnaviv: Fix disabling early-z rejection on GC7000L)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7396>
2020-11-06 10:10:58 +01:00
Christian Gmeiner 98ebffc9f3 etnaviv: move etna_destroy_shader(..) to generic location
Before this change we had two identical etna_destroy_shader
functions - one for tgsi and one for nir.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7397>
2020-11-03 08:28:56 +00:00
Christian Gmeiner 2dc73d2c7f etnaviv: move etna_dump_shader(..) to generic location
Before this change we had two identical etna_dump_shader
functions - one for tgsi and one for nir.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7397>
2020-11-03 08:28:56 +00:00
Christian Gmeiner 3bef6dfe42 etnaviv: convert from tgsi semantic/index to varying-slot
Prep work to unify some tgsi and nir compiler functions.
No deqp and piglit regressions.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7397>
2020-11-03 08:28:56 +00:00
Lucas Stach a1d6c03e2f etnaviv: don't import allocated scanout resources via from_handle
etna_resource_from_handle() recomputes (or second guesses) a lot of
properties we already have available in the allocation call. To make
things a bit more easier to follow, just import the BO without going
through the full handle import.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach 3862cec314 etnaviv: pass correct layout to etna_resource_alloc for scanout resources
Since b962776530 (etnaviv: rework compatible render base) the base resource
may be linear and a render compatible resource is allocated as needed. As
scanout surfaces without a modifier are always assumed to be linear, make
sure to pass the correct layout to etna_resource_alloc().

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach ec21148311 etnaviv: simplify etna_screen_bo_from_handle
There is no need to have a out_stride parameter, as the only callsite
already has the winsys handle, which includes the stride, so there is
no need to pass the stride back and forth.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach 94ec412b26 etnaviv: do proper cpu prep/fini when clearing allocated buffer
The debug memset 0 of all allocated buffers did not sync the buffer for CPU
access as required by the UAPI.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach 181790117b etnaviv: cosmetic etna_resource_alloc fixes
Get rid if the local bo variable, we can just assign it to the pointer
in the etna_resource struct.
Get rid of superfluous clearing of the TS bo pointer, the struct is already
zero initialized.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Michael Tretter 98db7c4841 etnaviv: free tgsi tokens when shader state is deleted
The tokens are allocated using tgsi_dup_tokens when the shader state is
created, so we need to free them explicitly when deleting the shader state.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach 3fd512440b etnaviv: tex_desc: fix TS compression enable
The TX_CTRL register has a bit to enable TS compression, the setting in
TS_SAMPLER_CONFIG is ignored for descriptor based textures. Apparently
256B tile mode already implies enabled compression to the HW, as with
the larger tile mode with compression was working fine, only the 128B
tile mode needs this change to work correctly.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach cf871e9232 etnaviv: update headers from rnndb
Update to etna_viv commit c9a26f3b776a.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach 3ba753d9f5 etnaviv: blt: properly program surface TS offset for clears
We clear the wrong TS region for != level 0 surfaces or TS buffers
with a internal offset.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7367>
2020-10-30 13:27:44 +00:00
Lucas Stach 9d5ec7f6f2 etnaviv: stop leaking the dummy texure descriptor BO
Free the dummy texture descriptor BO on context destroy.

Fixes: eda73d7127 (etnaviv: GC7000: Texture descriptors)
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Cc: <mesa-stable@lists.freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6986>
2020-10-07 11:17:18 +02:00
Marek Olšák f5f0c012ad gallium/util: remove empty file u_half.h
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6987>
2020-10-06 21:07:11 -04:00
Marek Olšák b42c6ff6f6 util: remove util_float_to_half and util_half_to_float wrappers
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6987>
2020-10-06 21:07:07 -04:00
Matt Turner 1aac47db69 Revert F16C series (MR 6774)
This reverts commit 4fb2eddfdf.
This reverts commit 7a1deb16f8.
This reverts commit 2b6a172343.
This reverts commit 5af81393e4.
This reverts commit 87900afe5b.

A couple of problems were discovered after this series was merged that
cause breakage in different configurations:

   (1) It seems that using -mf16c also enables AVX, leading to SIGILL on
   platforms that do not support AVX.
   (2) Since clang only warns about unknown flags, and as I understand
   it Meson's handling in cc.has_argument() is broken, the F16C code is
   wrongly enabled when clang is used, even for example on ARM, leading
   to a compilation error.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3583
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6969>
2020-10-01 21:08:12 +00:00
Jason Ekstrand 0aa08ae2f6 nir: Split NIR_INTRINSIC_TYPE into separate src/dest indices
We're about to introduce conversion ops which are going to want two
different types.  We may as well just split the one we have rather than
end up with three.  There are a couple places where this is mildly
inconvenient but most of the time I find it to actually be nicer.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6945>
2020-10-01 18:36:53 +00:00
Marek Olšák 4fb2eddfdf gallium/util: remove empty file u_half.h
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Marek Olšák 2b6a172343 util: remove util_float_to_half and util_half_to_float wrappers
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Christian Gmeiner a7e3cc7a0e etnaviv: simplify linear stride implementation
As documented in the galcore kernel driver "only LOD0 is valid
for this register". This makes sense, as NTE's LINEAR_STRIDE is
only capable to store one linear stride value per sampler.
This fixes linear textures in sampler slot != 0.

Fixes: 34458c1cf6 ("etnaviv: add linear sampling support")
CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Michael Tretter <m.tretter@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3285>
2020-09-25 08:03:17 +00:00
Kenneth Graunke 140f53e646 Revert "nir: replace lower_ffma and fuse_ffma with has_ffma"
This reverts commit 939ddf3f67.

Intel has a separate pass for fusing FFMAs selectively.  We split
these flags in commit 1b72c31e1f and
the reasoning still stands.  The patch being reverted was just a
cleanup, so there should be no issue with reverting it.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6849>
2020-09-24 13:11:50 -07:00
Marek Olšák 939ddf3f67 nir: replace lower_ffma and fuse_ffma with has_ffma
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6756>
2020-09-24 12:29:11 +00:00
Marek Olšák 21174dedec nir: split fuse_ffma into fuse_ffma16/32/64
AMD wants different behavior for each bit size

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6756>
2020-09-24 12:29:11 +00:00
Michael Tretter 952cf95f8b etnaviv: fix comment for source of etna_mesa_debug
The file and the environment variables have different names than
described in the comment. Fix the comment to avoid confusion.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6661>
2020-09-22 14:24:25 +00:00
Marek Olšák 31765340fd gallium: rename transfer flags -> map flags in comments
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5749>
2020-09-22 03:20:54 +00:00
Marek Olšák 22253e6b65 gallium: rename PIPE_TRANSFER_* -> PIPE_MAP_*
Acked-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5749>
2020-09-22 03:20:54 +00:00
Christian Gmeiner 77af1ca690 etnaviv: add disk cache
Adds a shader disk-cache for shader variants.  Note that builds with
`-Dshader-cache=false` have no-op stubs with `disk_cache_create()` that
returns NULL.

This shader disk-cache gets used when using NIR only. Helps to save
about 1-2 minutes for a deqp run on gc2000.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6669>
2020-09-18 07:45:11 +00:00
Christian Gmeiner 6a0d7f6316 etnaviv: shuffle some variant fields
Just to group together the parts that will get serialized when we have
shader disk-cache.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6669>
2020-09-18 07:45:11 +00:00
Christian Gmeiner f3150abe5e etnaviv: call nir_opt_shrink_vectors(..) in opt loop
total instructions in shared programs: 105044 -> 103312 (-1.65%)
instructions in affected programs: 27328 -> 25596 (-6.34%)
helped: 55
HURT: 0
helped stats (abs) min: 4 max: 96 x̄: 31.49 x̃: 24
helped stats (rel) min: 1.18% max: 23.08% x̄: 8.26% x̃: 6.88%
95% mean confidence interval for instructions value: -37.81 -25.18
95% mean confidence interval for instructions %-change: -9.66% -6.85%
Instructions are helped.

total temps in shared programs: 2960 -> 2917 (-1.45%)
temps in affected programs: 425 -> 382 (-10.12%)
helped: 41
HURT: 6
helped stats (abs) min: 1 max: 3 x̄: 1.20 x̃: 1
helped stats (rel) min: 7.14% max: 25.00% x̄: 13.79% x̃: 12.50%
HURT stats (abs)   min: 1 max: 1 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 12.50% max: 25.00% x̄: 17.52% x̃: 16.67%
95% mean confidence interval for temps value: -1.17 -0.66
95% mean confidence interval for temps %-change: -13.30% -6.29%
Temps are helped.

total immediates in shared programs: 16772 -> 16468 (-1.81%)
immediates in affected programs: 4304 -> 4000 (-7.06%)
helped: 59
HURT: 0
helped stats (abs) min: 4 max: 16 x̄: 5.15 x̃: 4
helped stats (rel) min: 2.22% max: 33.33% x̄: 9.31% x̃: 7.14%
95% mean confidence interval for immediates value: -5.88 -4.43
95% mean confidence interval for immediates %-change: -11.14% -7.49%
Immediates are helped.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6572>
2020-09-14 18:49:26 +00:00
Jason Ekstrand 38a83a3048 nir/lower_indirect_derefs: Add a threshold
Instead of always lowering everything, we add a threshold such that if
the total indirected array size (AoA size) is above that threshold, it
won't lower.  It's assumed that the driver will sort things out somehow
by, for instance, lowering to scratch.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5909>
2020-09-03 14:26:49 +00:00
Eric Anholt f25e169897 nir/opt_vectorize: Add a callback for filtering of vectorizing.
For NIR-to-TGSI, we don't want to revectorize 64-bit ops that we split to
scalar beyond vec2 width.  We even have some ops that we would rather
retain as scalar due to TGSI opcodes being scalar, or having more unusual
requirements.

This could be used to do the vectorize_vec2_16bit filtering, but that
shader compiler option is also used in algebraic so leave it in place for
now.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6567>
2020-09-02 09:59:17 -07:00
Eric Anholt 65f484198a etnaviv: Fix unused var warning in release build from assertions.
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6462>
2020-08-28 22:45:08 +00:00
Marek Vasut 60975ebe58 etnaviv: Add lock around pending_ctx
The content of rsc->pending_ctx could be changed from multiple contexts
and thus from multiple threads. The per-context lock is not sufficient
to protect this list. Add per-resource lock to protect this list.

Fixes: e5cc66dfad ("etnaviv: Rework locking")
Signed-off-by: Marek Vasut <marex@denx.de>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6454>
2020-08-26 09:58:10 +00:00
Marek Vasut da660c90bf etnaviv: Remove etna_resource_get_status()
This function is not used, remove it.

Signed-off-by: Marek Vasut <marex@denx.de>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6454>
2020-08-26 09:58:10 +00:00
Lukas F. Hartmann 785e2707b0 etnaviv: Fix disabling early-z rejection on GC7000L (HALTI5)
The VIVS_PE_DEPTH_CONFIG_DISABLE_ZS in PE_DEPTH_CONFIG caused depth
write hangs on HALTI5.
This is because the 0x11000000 bits in RA have to be toggled on
when setting this bit to zero. This combination will disable
early-z rejection on GC7000L, which was previously done through
a different bit.
Tested only on GC7000L so far.

Signed-off-by: Lukas F. Hartmann <lukas@mntre.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5456>
2020-08-26 08:23:31 +00:00
Karol Herbst e5899c1e88 nir: rename nir_op_fne to nir_op_fneu
It was always fneu but naming it fne causes confusion from time to time. So
lets rename it. Later we also want to add other unordered and fne, this is
a smaller preparation for that.

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6377>
2020-08-21 17:26:21 +00:00
Christian Gmeiner 044b238507 etnaviv: completely turn off MSAA
MSAA worked before etnaviv landed in upstream mesa but got
broken over time. Disable MSAA completely until it is fixed again.

Fixes problems/crashes with applications that want to make use of MSAA.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5608>
2020-08-11 09:19:57 +00:00
Christian Gmeiner e63a7882a0 etnaviv: call nir_lower_bool_to_bitsize
Starting with commit 6f394343b1 ("nir/algebraic: i2f(f2i()) -> trunc()")
dEQP-GLES2.functional.shaders.operator.binary_operator.div.lowp_int_vertex
ends with an unsuppored flt instruction. Use nir_lower_bool_to_bitsize to
convert this flt to a flt32 which is supported. This fixes the introduced
regression.

Cc: 20.2 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6182>
2020-08-07 03:25:36 +00:00
Rob Clark c4e0cae90c gallium: replace 16BIT_TEMPS cap with 16BIT_CONSTS
All drivers that support mediump lowering should support 16BIT_TEMPS,
but some do not also want 16b consts to be lowered.  Replace the pipe
cap in preperation to remove LowerPrecisionTemporaries.

Note: also updates reference checksums for the arm64_a630_traces job,
due to lowering more to 16b

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6189>
2020-08-05 21:00:44 +00:00
Christian Gmeiner 6fc52739bb etnaviv: fix nir validation problem
Fixes the following validation problem:
  error: nir_intrinsic_align_offset(instr) < nir_intrinsic_align_mul(instr)

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Tested-by: Lukas F. Hartmann <lukas@mntmn.com>
Acked-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6127>
2020-08-03 20:05:20 +00:00
Jason Ekstrand 2956d53400 nir: Add nir_foreach_shader_in/out_variable helpers
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>
2020-07-29 17:38:57 +00:00
Christian Gmeiner 60915f87c7 etnaviv: do register setup only once
Register set setup should be done once at backend
initializaion, as ra_set_finalize is O(r^2*c^2).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5996>
2020-07-24 20:01:04 +00:00
Christian Gmeiner 7ee146aad4 etnaviv: move shader_count to etna_compiler
Also fix data race on making the shader's id.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5996>
2020-07-24 20:01:04 +00:00
Christian Gmeiner 5839a7d64a etnaviv: introduce struct etna_compiler
This struct will be used to for state saved across compiler
invocations.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5996>
2020-07-24 20:01:04 +00:00
Christian Gmeiner 8534f49bf9 etnaviv: explicitly set nir_variable_mode
No functional changes - fixes the following assert:
  nir_lower_io_impl: Assertion `!(modes & ~supported_modes)' failed.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5997>
2020-07-24 13:33:47 +00:00
Timothy Arceri 745aeba623 etnaviv: add missing fallthrough comments
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5799>
2020-07-10 00:32:51 +00:00
Marek Olšák 75b59bb1d6 gallium: add PIPE_SHADER_CAP_GLSL_16BIT_TEMPS for LowerPrecisionTemporaries
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5746>
2020-07-07 22:02:06 -04:00
Eric Anholt 377026e3ad etnaviv: Use the util_pack_color_union() helper.
This snuck in since I cleaned up the other instances of it.

Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5728>
2020-07-07 18:19:22 +00:00
Christian Gmeiner 01a1926fb9 etnaviv: replace prims-emitted query
As we do not support stream output buffers we only count the primitives
processed by the pipeline. Use the correct query type.

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5754>
2020-07-06 18:22:19 +00:00
Christian Gmeiner 64cdc1311b etnaviv: move ra into own file
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 027e9e8da3 etnaviv: move nir compiler related stuff into .c file
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner f1df033fcc etnaviv: move functions that generate asm to own file
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 79427a0190 etnaviv: drop emit macro
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 624b8b4a92 etnaviv: merge struct etna_compile and etna_state
I see no good architectural reason for this split.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 0f025e8b81 etnaviv: move liveness related stuff into own file
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 9ae96d32dd etnaviv: make more use of compile_error(..)
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 96670c8150 etnaviv: drop OPT_V define
Directly use NIR_PASS_V(..).

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 1636e14cfd etnaviv: move etna_lower_alu(..) to etnaviv_nir.c
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 7460d4863d etnaviv: get rid of etna_compile dependency
Needed prep change to be able to move alu lowering.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 12b15cbcbf etnaviv: move etna_lower_io(..) to etnaviv_nir.c
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner ea17cbf16f etnaviv: convert enums
Atm. it is not possible to move the enums to a header file
as they do not use an identifier but directly define an
object.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Christian Gmeiner 34f776386c etnaviv: delete not used struct
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5690>
2020-07-02 17:04:46 +00:00
Neil Roberts bb5fc90135 gallium: Add pipe cap for primitive restart with fixed index
Adds PIPE_CAP_PRIMITIVE_RESTART_FIXED_INDEX which is a subset of the
primitive restart cap for when the hardware can only support the fixed
indices specified in GLES.

The switch statements were automatically modified with this command:

find \( \( -name \*.cpp -o -name \*.c \) \! -type l \) \
 -exec sed -i -r \
 's/^(\s*case\s+PIPE_CAP_PRIMITIVE_RESTART)\s*:.*$/\0\n\1_FIXED_INDEX:/' \
 {} \;

v2: Add a note in screen.rst

Reviewed-by: Eric Anholt <eric@anholt.net> (v1)
Reviewed by: Erik Faye-Lund <erik.faye-lund@collabora.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5559>
2020-06-22 12:41:56 +00:00
Eric Engestrom bd5cf70d3d etnaviv: replace all dup() with os_dupfd_cloexec()
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5369>
2020-06-18 02:09:56 +00:00
Christian Gmeiner 7ec2582087 etnaviv: drop translate_blend(..)
PIPE_BLEND_* matches 1:1 the hardware defines.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4187>
2020-06-08 15:35:13 +00:00
Timothy Arceri 04dbf709ed nir: add callback to nir_remove_dead_variables()
This allows us to do API specific checks before removing variable
without filling nir_remove_dead_variables() with API specific code.

In the following patches we will use this to support the removal
of dead uniforms in GLSL.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4797>
2020-06-03 02:22:23 +00:00
Marek Olšák 1af8fe4ed5 gallium: add shader caps INT16 and FP16_DERIVATIVES
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5002>
2020-06-02 20:01:18 +00:00
Dylan Baker a8e2d79e02 meson: use gnu_symbol_visibility argument
This uses a meson builtin to handle -fvisibility=hidden. This is nice
because we don't need to track which languages are used, if C++ is
suddenly added meson just does the right thing.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Vinson Lee f047d585ee etnaviv: Fix memory leak on error path.
Fix warning reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable pq going out of scope leaks the storage it
points to.

Suggested-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Fixes: eed5a00989 ("etnaviv: convert perfmon queries to acc queries")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5220>
2020-05-30 01:04:30 +00:00