Commit Graph

134104 Commits

Author SHA1 Message Date
Caio Marcelo de Oliveira Filho 47f7b262e1 anv: Refactor subgroup_size_type rules into a single function
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12946>
2021-09-21 21:35:20 +00:00
Caio Marcelo de Oliveira Filho 9add809e7f anv: Simplify subgroup_size_type rules for compute shaders
The populate_base_prog_key will set VARYING depending if the pipeline
flag is used.  Later, when full subgroups flag is set, it will flip to
UNIFORM -- which for compute shaders is effectively the same, so don't
bother setting it again.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12946>
2021-09-21 21:35:20 +00:00
Christian Gmeiner ca0f892191 compiler/isaspec: add alignment support
This helps to get a really nice and aligend disasm output.
Just use :align=X to define where in the line the field
should be printed.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner eae96d0c4c compiler/isaspec: keep track of written data
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner f0104a6c72 compiler/isaspec: add print(..) helper
To support field alignment we need to keep track of how much
data we have printed to our out FILE. This is a prep commit.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner bc2e806b0f freedreno/isa: move isaspec to a new home
This commit moves isaspec out of freedreno into a more
generic new home - src/compiler/isaspec.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 6801c300a8 freedreno/isa: add shbang and make executable
In a later change we will use mesons find_program(..) and this
only works if python files are executable and have a shbang.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner dbb9d3d0e3 freedreno/isa: encode: switch bitmask_t to BITSET_WORD's
This commit changes the underlying basetype of bitmask_t to a
BITSET_WORD based one.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 9dc2ef7200 freedreno/isa: decode: switch bitmask_t to BITSET_WORD's
This commit changes the underlying basetype of bitmask_t to a
BITSET_WORD based one.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 430dc08755 freedreno/isa: add split_bits(..) methods
Will be used to split a value into needed number of 32 bit words.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 1a8048954d freedreno/isa: generate marcos used for printf(..)
Generate correct BITSET_FORMAT and BITSET_VALUE macros based
on the maximum needed ISA bits.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner a6b82d1c8c freedreno/isa: add store_instruction(..)
Makes it possible to store an encoded instruction in a
generic ISA specific way.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner a5bbd08775 freedreno/isa: add BITMASK_WORDS define
This new define will be used by a more generic deocde(..)
and encode(..) functions.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner ea42a3bee5 freedreno/isa: add bitmask to/from uint64_t helper
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 35877cd7b8 freedreno/isa: add bitmask_t to encode.py
Prep work for the next change.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 3c634e956b freedreno/isa: generate isaspec-decode.h
Generate a 'glue' header file to be able to support different
ISAs.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 59e6258e4f freedreno/isa: generate ir3-isa.h
This header contains the bitmask_t struct typedef that will be
used by the isaspec.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 3d6a3b3c7c freedreno/isa: store max size for needed bitset
We will use this information later to create a correctly
sized BITSET.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner d29a6e2db5 freedreno/isa: add defines for fprintf(..) usage
In the long run they will be replaces with some generated
defines. If we do this early it keeps the diffs of the next
changes small.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 6c3befdd70 freedreno/isa: add next_instruction(..)
In during the next commits we will change to a generated
version of next_instruction(..) based on the actual isa.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner c3b14ade55 freedreno/isa: simplify custom_target
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 3b52d64474 freedreno/isa: add leading zero's
Changes the output format slightly but its needed when we
want to switch to more generic version of isaspec.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 54ea23da51 util/tests: add set bit range test
This simple test validates that it is possible to set bits
across word bounary.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner b3b03e33c9 util/bitset: add BITSET_SET_RANGE(..)
This version works across word boundary.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 3d65cea6ee util/bitset: s/BITSET_SET_RANGE/BITSET_SET_RANGE_INSIDE_WORD
Prep work for the next commit.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 3d3a4b9b01 util/tests: add bitset SHL tests
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 6171bc2243 util/bitset: add left shift
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 0c243b3f98 util/tests: add bitset SHR tests
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 7b62fb4558 util/bitset: add right shift
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner 79067c4744 util/tests: add bitwise AND, OR and NOT tests
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner cfa8828c62 util/bitset: add bitwise AND, OR and NOT
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Christian Gmeiner f8ea9fa0f8 util/tests: rename bitset test names
Imho they are quite hard to read with the added '_'.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11321>
2021-09-21 20:25:31 +00:00
Jason Ekstrand 35ac184de0 intel/fs: Handle required subgroup sizes specified in the SPIR-V
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12959>
2021-09-21 18:34:59 +00:00
Jason Ekstrand 518693c3ec spirv: Handle the SubgroupSize execution mode
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12959>
2021-09-21 18:34:59 +00:00
Charmaine Lee e5dc900226 svga: fix render target views leak
Use create_backed_surface_view helper function to create/reuse
alternate surface view when the to-be-bound surface view was created
in a different context. This fixes render target views leak running gazebo.

Cc: mesa-stable
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12952>
2021-09-21 18:02:17 +00:00
Emma Anholt 590ac4789d freedreno/a5xx+: Set the IJ_LINEAR_* request bits if we need the regs.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12949>
2021-09-21 17:11:42 +00:00
Emma Anholt 3f99916433 freedreno/a5xx+: Rename GRAS_CNTL/RB_RENDER_CONTROL0 IJ_LINEAR_* bits.
This is what they actually enable.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12949>
2021-09-21 17:11:42 +00:00
Boris Brezillon d3511e8af2 panvk: Implement vkCmdUpdateBuffer()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:42 +02:00
Boris Brezillon a560890284 panvk: Implement vkCmdFillBuffer()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:32 +02:00
Boris Brezillon b37eb5854c panvk: Implement vkCmdCopyBuffer()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:27 +02:00
Boris Brezillon f73ae1a6b5 panvk: Implement vkCmdCopyImageToBuffer()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:23 +02:00
Boris Brezillon 4ce85cd25a panvk: Implement vkCmdCopyBufferToImage()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:19 +02:00
Boris Brezillon 5b9cbd39ec panvk: Implement vkCmdCopyImage()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:15 +02:00
Boris Brezillon a0cbe50566 panvk: Implement vkCmdClear{DepthStencil,Color}Image()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:10 +02:00
Boris Brezillon 5d4c405257 panvk: Issue a fragment job if at least one target is cleared
This way clear meta helpers don't have to allocate fragment job
themselves.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:04 +02:00
Boris Brezillon 2cdcaf08a1 panvk: Stop dereferencing the subpass in panvk_cmd_close_batch()
So we can call this function from the meta helpers which won't bind
a subpass to the cmd state.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:01:00 +02:00
Boris Brezillon b882c3b677 panvk: Add a panvk_cmd_prepare_tiler_context() helper
So we can create tiler contexts from meta helpers.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:00:55 +02:00
Boris Brezillon 285197df28 panvk: Make panvk_cmd_alloc_tls_desc() more generic
panvk_cmd_alloc_tls_desc() will soon be called from meta helpers which
don't bind a pipeline to the cmdbuf state. Let's pass the gfx/compute
info directly.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:00:50 +02:00
Boris Brezillon e7af84899e panvk: Don't check the bind_point in panvk_cmd_prepare_fragment_job()
We are about to call panvk_cmd_close_batch() from meta helpers, and
those don't bind a pipeline, so let's drop the check in
panvk_cmd_prepare_fragment_job().

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:00:46 +02:00
Boris Brezillon 821eb2a73b panvk: Don't use the subpass to calculate the FB descriptor size
This way we will be able to re-use panvk_cmd_alloc_fb_desc() for
meta stuff.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12095>
2021-09-21 15:00:40 +02:00