Commit Graph

1819 Commits

Author SHA1 Message Date
Alyssa Rosenzweig d6a5df0db0 panfrost: Add XML for mali_vertex_tiler_postfix
This is a bit of everything but overall sets up the draw state.
Translating fairly directly from the header. Main structural change is
breaking out a 2-bit enum for occlusion query mode instead of
maintaining separate booleans for the modes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig e213a864e5 panfrost: Add padded type for instance fields
Mali has a special 5:3 encoding representing a subset of the natural
numbers, of the form:

   a * (2^b)

for a odd and b natural/zero. It is used for padding out instance sizes,
as well as in attribute records so it's worth representing as a native
type as opposed to having manual packs/unpacks in various places.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
2020-08-28 14:53:53 +00:00
Alyssa Rosenzweig 75a274de06 panfrost: Add opaque midgard_blend XML
Just to ensure write ordering is sane.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6476>
2020-08-28 14:53:52 +00:00
Alyssa Rosenzweig 3cda33360e panfrost: Drop mali_shader_meta
Now completely replaced by XML versions.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:39 +02:00
Alyssa Rosenzweig 3d7ce13416 pan/decode: Use unpacks for state descriptor
This is a win in terms of line of decoder code, but it's a regression in
terms of verbosity. That will be fixed when we teach the decode
autogeneration about defaults and non-canonical fields.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:39 +02:00
Alyssa Rosenzweig 100b15cdc8 panfrost: Add optional opaque packs to GenXML
These special OPAQUE packs use packed structs in the struct template,
instead of struct templates. The use case is packing nested structs
out-of-band, to fit into the CSO model.

A more conventional GenXML solution would be an overlapping uint, but
this breaks our assumptions about struct packing which are otherwise
correct, so this seemed less intrusive than risk disrupting the main
pack routines.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:39 +02:00
Alyssa Rosenzweig a7b2317d0a panfrost: Use pack for Bifrost test state
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:38 +02:00
Alyssa Rosenzweig 5b3b2a6697 panfrost: Use pack for blit shaders
This is quite a bit cleaner, I think, and validates the XML in
preparation for moving over the main driver.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:38 +02:00
Alyssa Rosenzweig a36ac2b9b0 panfrost: Inherit default values from structs
Nesting can be useful sometimes.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:38 +02:00
Alyssa Rosenzweig 754d543829 panfrost: XMLify the rest of shader_meta
This contains a bit of everything, so just XML for this commit. The rest
of the series will be slowly moving over to this representation.

The one noteworthy addition is the rename of "No MSAA" to
"Single-sampled lines". This came about due to a buggy branch that
forgot to set this bit. Ths worked, with the caveat of the following
tests failing with a single-sampled framebuffer:

   dEQP-GLES2.functional.rasterization.interpolation.basic.line_loop_wide
   dEQP-GLES2.functional.rasterization.interpolation.basic.line_strip_wide
   dEQP-GLES2.functional.rasterization.interpolation.basic.lines_wide
   dEQP-GLES2.functional.rasterization.interpolation.projected.line_loop_wide
   dEQP-GLES2.functional.rasterization.interpolation.projected.line_strip_wide
   dEQP-GLES2.functional.rasterization.interpolation.projected.lines_wide
   dEQP-GLES2.functional.rasterization.primitives.line_loop
   dEQP-GLES2.functional.rasterization.primitives.line_loop_wide
   dEQP-GLES2.functional.rasterization.primitives.line_strip
   dEQP-GLES2.functional.rasterization.primitives.line_strip_wide
   dEQP-GLES2.functional.rasterization.primitives.lines
   dEQP-GLES2.functional.rasterization.primitives.lines_wide

That is, this bit controls the behaviour of line rasterization with
multisampling. This is required to implement the divergent behaviours
described in the OpenGL ES 3.2 specification sections 13.6.1 ("Basic
Line Segment Rasterization") and 13.6.4 ("Line Multisample
Rasterization"), where setting this bit corresponds to the former
(single-sampled) behaviour.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:38 +02:00
Alyssa Rosenzweig 661b46958d panfrost: XMLify beginning of shader descriptor
We have just enough abstracted now to pack this ahead-of-time, during
the CSO create, instead of at draw-time. But it's only a start.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:37 +02:00
Alyssa Rosenzweig d353b15bee panfrost: Quiet pandecode error
The smallest job descriptor is smaller than 256, and with the
tighter packing, pandecode can sometimes error nowadays.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:37 +02:00
Alyssa Rosenzweig a0857e9d9e panfrost: Support SHADERLESS mode everywhere
Now that the missing bits on SFBD are identified, and we have a
reasonable way to pack the properties for Bifrost, we can probably do
this everywhere to generalize the optimization and drop the quirk.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:36 +02:00
Alyssa Rosenzweig c9858fb941 panfrost: Identify additional SFBD flags
These are analogues to the flags we have in the blend structure on
T760+, which enables us to fix shaderless and sRGB operation on T720.

Closes #2771

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: a64599a303 ("panfrost: Pass the sampler view format when creating a tex descriptor")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:36 +02:00
Alyssa Rosenzweig 7a95ed2ecf panfrost: XMLify Bifrost preload
There's a lot of code here since the meaning of this field changes
depending on shader state. The good news is that our careful handling
allows preload registers to be decoded now, which pandecode could not
previously do. Likewise, the cmdstream code to emit this is now much
more obvious.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:36 +02:00
Alyssa Rosenzweig acf77cbb39 panfrost: XMLify bifrost1
It's so poorly understood there's not much to do in this commit, sadly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:36 +02:00
Alyssa Rosenzweig 1b7d4f1940 panfrost: Remove midgard1 bitfield
It is now entirely XML, including for decoding. Woo!

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:36 +02:00
Alyssa Rosenzweig 87c59514e9 panfrost: XMLify Midgard properties
In a long journey to a full XML representation of mali_shader_meta,
let's start with the fourth word, containing some shader properties.
This is a translation from panfrost-job.h, with the exception of
widening the uniform buffer count field [1]

The other noteworthy change is combining the unknown 0x20 flag with the
WRITES_Z flag to form a 2-bit depth source. This papers over the fact
that the blob zeroes this field for non-fragment shaders. Given the
proximity, this is a reasonable guess and avoids an ugly "is_fragment"
bit.

[1] Justified by the increased limit advertised by the Vulkan blob
(maxDescriptorSetUniformBuffers on
https://vulkan.gpuinfo.org/displayreport.php?id=5602#limits). Not
actually supported in Panfrost right now.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:35 +02:00
Alyssa Rosenzweig bf6d548787 panfrost: XMLify blend equation
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:34 +02:00
Alyssa Rosenzweig 94c9f87df1 panfrost: XMLify blend flags
Shared between Midgard/Bifrost. We get printing this way!

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:33 +02:00
Alyssa Rosenzweig 6fd62215fa panfrost: Decode nested structs correctly
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 75cc5b8c29 ("panfrost: Adopt gen_pack_header.py via v3d")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:33 +02:00
Alyssa Rosenzweig aac5a559cc pan/decode: Drop legacy 32-bit job support
We already dropped support for this a long time ago, this is a vestigial
artefact that we missed.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6440>
2020-08-25 17:05:33 +02: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
Rhys Perry 85b7403909 bifrost: use nir_intrinsic_has_type
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6402>
2020-08-21 16:47:00 +00:00
Alyssa Rosenzweig 1cfbc5cff5 panfrost: Fix alignment on Bifrost
This was real "fun" to debug...

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 373a204bdd ("panfrost: Pass alignments explicitly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6410>
2020-08-20 19:37:08 +00:00
Alyssa Rosenzweig 373a204bdd panfrost: Pass alignments explicitly
In most cases, GPU data structures need only be self-aligned; the
worst-case 128 byte alignment is wasteful. By passing explicit
alignments, we can reduce memory usage, avoid extra allocations, and
improve descriptor cache locality.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:01 +02:00
Alyssa Rosenzweig 680fb05f99 panfrost: Use memctx for sysvals
8.74KB leaked over 52 calls from:
    0xffffbb5b9fc3
      in ??
    _mesa_hash_table_init
      at ../src/util/hash_table.c:163
      in /home/alyssa/rockchip_dri.so
    _mesa_hash_table_create
      at ../src/util/hash_table.c:186
    _mesa_hash_table_u64_create
      at ../src/util/hash_table.c:701
      in /home/alyssa/rockchip_dri.so
    panfrost_nir_assign_sysvals
      at ../src/panfrost/util/pan_sysval.c:130
      in /home/alyssa/rockchip_dri.so
    midgard_compile_shader_nir
      at ../src/panfrost/midgard/midgard_compile.c:2905
      in /home/alyssa/rockchip_dri.so

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:01 +02:00
Alyssa Rosenzweig 8dd38e5a3e pan/mdg: Free previous liveness
Before we drop the reference.

160 calls with 0B peak consumption from:
    0xffffbd9d2fc3
      in ??
    pan_compute_liveness
      at ../src/panfrost/util/pan_liveness.c:127
      in /home/alyssa/rockchip_dri.so
    mir_compute_liveness
      at ../src/panfrost/midgard/midgard_liveness.c:55
      in /home/alyssa/rockchip_dri.so
    midgard_opt_dead_code_eliminate
      at ../src/panfrost/midgard/midgard_opt_dce.c:118
      in /home/alyssa/rockchip_dri.so

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:01 +02:00
Alyssa Rosenzweig 62637a913a panfrost: Free hash_to_temp map
No need to put it on the context, we can keep it local in mir_squeeze
and drop when we're done.

15.77KB leaked over 85 calls from:
    0xffffaed3bfc3
      in ??
    _mesa_hash_table_rehash
      at ../src/util/hash_table.c:368
      in /home/alyssa/rockchip_dri.so
    hash_table_insert
      at ../src/util/hash_table.c:403
      in /home/alyssa/rockchip_dri.so
    find_or_allocate_temp
      at ../src/panfrost/midgard/mir_squeeze.c:48
      in /home/alyssa/rockchip_dri.so
    find_or_allocate_temp
      at ../src/panfrost/midgard/mir_squeeze.c:35
      in /home/alyssa/rockchip_dri.so
    mir_squeeze_index
      at ../src/panfrost/midgard/mir_squeeze.c:76

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:01 +02:00
Alyssa Rosenzweig da6d0e3fac panfrost: Free NIR of blit shaders
After we compile from NIR to a native binary, we can throw away the NIR.

17.47KB leaked over 104 calls from:
    0xffff87dcafc3
      in ??
    _mesa_hash_table_init
      at ../src/util/hash_table.c:163
      in /home/alyssa/rockchip_dri.so
    _mesa_hash_table_create
      at ../src/util/hash_table.c:186
    nir_lower_vars_to_ssa_impl
      at ../src/compiler/nir/nir_lower_vars_to_ssa.c:717
      in /home/alyssa/rockchip_dri.so
    nir_lower_vars_to_ssa
      at ../src/compiler/nir/nir_lower_vars_to_ssa.c:817
    optimise_nir
      at ../src/panfrost/midgard/midgard_compile.c:504
      in /home/alyssa/rockchip_dri.so
    midgard_compile_shader_nir
      at ../src/panfrost/midgard/midgard_compile.c:2895
      in /home/alyssa/rockchip_dri.so
    panfrost_build_blit_shader
      at ../src/panfrost/lib/pan_blit.c:103
      in /home/alyssa/rockchip_dri.so

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Cc: mesa-stable
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:01 +02:00
Alyssa Rosenzweig d8deb1eb6a panfrost: Share tiler_heap across batches/contexts
There's only one tiler, so this is safe. (The blob does the same
optimization.) This avoids allocating multiple heaps for multiple
batches, which wastes memory and CPU time.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:00 +02:00
Alyssa Rosenzweig 01d12c353e pan/decode: Don't try to dereference heap mapping
It might not be mapped from our perspective, we shouldn't crash on that
just for a validation that isn't actually correct.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:00 +02:00
Alyssa Rosenzweig b41692caf4 panfrost: Avoid minimum stack allocations
If stack isn't used, don't allocate it - simple as that.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:00 +02:00
Alyssa Rosenzweig 17c617cdb7 panfrost: Introduce invisible pool
Whereas the main batch->pool is CPU read/write, the new
batch->invisible_pool is not. This enables GPU-internal structures that
the CPU must allocate from a pool dynamically but does not read,
corresponding to the BO_INVISIBLE create flag.

The use case is speeding up varying allocation by skipping the
CPU-side mmap/munmap.

We simultaneously half the pool's minimal allocation to avoid negatively
affecting memory usage.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:00 +02:00
Alyssa Rosenzweig 40c0d7a13d panfrost: Pre-allocate memory for pool
Seeing random BO creates in the middle of command stream generation is
annoying, let's preallocate memory so CPU profiling is less random.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:00 +02:00
Alyssa Rosenzweig ff3ea3b3bb pan/mdg: Fix auxiliary load/store swizzle packing
It needs to respect the existing swizzle, as well as the type size.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6321>
2020-08-19 12:08:51 +00:00
Alyssa Rosenzweig 529f79d639 pan/mdg: Fix printing of r26 ld/st sources post-RA
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6321>
2020-08-19 12:08:51 +00:00
Alyssa Rosenzweig 14e774929e pan/mdg: Identify barrier out-of-order field
All barrier types are implied regardless, this is an optimization for
out-of-order.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6321>
2020-08-19 12:08:51 +00:00
Alyssa Rosenzweig af97331aba pan/mdg: Handle 32-bit offsets from store_shared
Implicitly zero-extended for the 64-bit address.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6321>
2020-08-19 12:08:51 +00:00
Alyssa Rosenzweig 06c31031e7 pan/mdg: Ensure barrier op is set on texture
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Fixes: 92c808cd47 ("pan/mdg: eliminate references to ins->texture.op")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6321>
2020-08-19 12:08:51 +00:00
Alyssa Rosenzweig 7a13351234 panfrost: Drop union mali_attr
Now replaced by the XML translation. I left the comment explaining
instancing since this is still very good information about how to
calculate these fields.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig 4e3fe54e2e panfrost: Drop hand-rolled pandecode for attribute buffers
Sadly, we lose some of the validation, but indeed, much of the
validation has turend out to be wrong after enough development so... meh

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig 9732b64862 panfrost: Remove mali_attr_meta
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig eb2762a837 pan/bit: Use packs for Bifrost unit tests
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig 44397c580c panfrost: Use packs for vertex built-ins
These probably need a bigger cleanup at some point but let's handle one
thing at a time.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig c9bb5dc911 panfrost: Inline panfrost_vertex_instanced
We'd like to have attribute code in one place together so we can
refactor effectively; this routine as-is wouldn't fit perfectly outside
Gallium anyway so let's do the simple thing.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig 4fc90f7c3c panfrost: Use better packs for blits
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig 3e7fd2a034 panfrost: Add XML for attribute buffers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig 2c8a722b85 panfrost: XMLify attributes
To keep review manageable, this only ports over pandecode and blitting.
The main uses for vertex data and varying linkage will come next, as
they touch considerably more code.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig cdc3276317 panfrost: XMLify mali_channel
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig 668ec24bfd panfrost: Squash 22-bit format field in attr_meta
This is an intermediate step to support v7 style formats. Now we don't
see the mali_format alone, instead together with the swizzle (and sRGB
flag, unused for attributes of course).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Alyssa Rosenzweig c5f18ce144 panfrost: Drop NXR format
It's not clear this was ever exposed under any GL/DX/CL/VK/... extension
whatsoever...

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6326>
2020-08-17 11:43:52 +00:00
Mauro Rossi acf756a64f android: panfrost: Redirect cmdstream includes through GenXML (v2)
bifrost requires both "pafrost/lib/midgard_pack.h" and "midgard_pack.h" headers

Fixes the following building error:

In file included from external/mesa/src/panfrost/bifrost/cmdline.c:33:
In file included from external/mesa/src/panfrost/bifrost/test/bit.h:31:
external/mesa/src/panfrost/lib/pan_device.h:40:10: fatal error: 'midgard_pack.h' file not found
#include <midgard_pack.h>
         ^~~~~~~~~~~~~~~~
1 error generated.

Fixes: bce1a7e9 ("android: panfrost: Redirect cmdstream includes through GenXML")
Fixes: 88dc4c21 ("panfrost: Redirect cmdstream includes through GenXML")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6322>
2020-08-14 19:01:38 +02:00
Mauro Rossi 99372547be android: panfrost/bifrost: add libpanfrost_lib static dependency
Fixes the following building error:

external/mesa/src/panfrost/bifrost/test/bit.h:30:10: fatal error: 'panfrost/lib/midgard_pack.h' file not found
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.

Fixes: 88dc4c21e ("panfrost: Redirect cmdstream includes through GenXML")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6317>
2020-08-14 15:19:36 +02:00
Mauro Rossi bce1a7e97f android: panfrost: Redirect cmdstream includes through GenXML
Fixes the following building error:

external/mesa/src/panfrost/lib/decode.c:26:10: fatal error: 'midgard_pack.h' file not found
         ^~~~~~~~~~~~~~~~
1 error generated.

Fixes: 88dc4c21e ("panfrost: Redirect cmdstream includes through GenXML")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6317>
2020-08-14 15:19:31 +02:00
Jonathan Marek a322924d9c panfrost: add missing dependency on midgard_pack.h
Fixes build failing when libpanfrost is built before midgard_pack.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6093>
2020-08-13 16:54:06 +00:00
Alyssa Rosenzweig 0c621dcf0e panfrost: XMLify enum mali_format
Note we are just handling the index part of the format. This is *not*
the full format, which would include the swizzle (or v7 equivalent) and
the sRGB flag. But in the interest of incremental progress, let's move
this part over first and save on decoding complexity.

To avoid substantial churn from prefixing FORMAT to format names, we
special case the enums to avoid the prefix. This is undesirable but
reduces churn, especially since format handling is slated for an
overhaul soon to accomodate v7

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig 78445ce695 panfrost: XMLify exception access
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig 99d17fb771 panfrost: XMLify MSAA writeout mode
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig c9bdba26b0 panfrost: XMLify Block Format
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:17 +02:00
Alyssa Rosenzweig 8c1ac96eb6 panfrost: Drop unused mali_channel_swizzle
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig ad0b32cdbd panfrost: XMLify Bifrost textures
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig f008a6314c panfrost: XMLify Midgard textures
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig b10c3c869d panfrost: XMLify Bifrost samplers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig f74186baa5 panfrost: XMLify Midgard samplers
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig c4c8c8e8fb panfrost: Don't mask coverage mask to 4-bits
While it is correct for MSAA 4x, it will break for MSAA 8x and 16x, and
it is only dubiously correct for no-MSAA. Drop the mask.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig 6afd4addef panfrost: Simplify depth/stencil/alpha
The alpha test is lowered by the frontend so we can drop that unused
code path, and stencil state can be computed at CSO create time to
reduce draw-time complexity.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig 931e7b4c7a panfrost: XMLify stencil test
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig fa949678c1 panfrost: XMLify UBOs
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:16 +02:00
Alyssa Rosenzweig 7f487e087f panfrost: XMLify viewport
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig ef20691e3d panfrost: XMLify wrap modes
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig e9ca320461 panfrost: XMLify stencil op
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig d182a6057f panfrost: XMLify mali_func
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 32dbc80979 panfrost: XMLify draw_mode
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 4b7056b8c8 panfrost: XMLify job_type
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig d2ddd4d565 pan/decode: Add helper to dump GPU structures
Based on generating unpack/print.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 88dc4c21e6 panfrost: Redirect cmdstream includes through GenXML
This will provide a way to incrementally upgrade.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 1ad921956d panfrost: Build midgard_pack.h via meson
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 75cc5b8c29 panfrost: Adopt gen_pack_header.py via v3d
We fork gen_pack_header.py from v3d, which in turn forks GenXML from
Intel. Selected changes for Mali:

* Custom prefix/vendoring
* Cull supported types
* Drop <register> and <packet> support (no cmdstream)
* Pack 32-bit words instead of 8-bit bytes
* Inline packing helpers
* Introduce exact attribute
* Introduce general minus(..) and shr(..) modifiers
* Introduce word:bit syntax
* Introduce prettyprinters

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:15 +02:00
Alyssa Rosenzweig 9cb3a9e72e panfrost: Add stub midgard.xml
This will be filled in incrementally.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6195>
2020-08-13 08:55:14 +02:00
Alyssa Rosenzweig d285ea6467 panfrost: Implement YTR availability check
Depends on format.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>
2020-08-12 09:59:20 -04:00
Alyssa Rosenzweig acb8dcfebd panfrost: Choose AFBC when available
There are lots of reasons we might fallback on u-interleaved tiling, but
when we can use AFBC, it's a big win.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>
2020-08-12 09:59:20 -04:00
Alyssa Rosenzweig 348d374d01 panfrost: Respect modifiers in resource management
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>
2020-08-12 09:59:20 -04:00
Alyssa Rosenzweig 965537df2a panfrost: Use modifier instead of layout throughout
Instead of converting back and forth we should stick with fourcc codes
as the canonical layout definition. Furthermore modifiers allow all the
variants of AFBC to be encoded canonically, whereas the previous enum
does not (info about YTR is encoded out of band, for instance).

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Icecream95 <ixn@keemail.me>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6159>
2020-08-12 09:59:20 -04:00
Mauro Rossi 166630f759 android: pan/bi: Separate disasm/compiler targets
Fixes the following building errors:

ld.lld: error: undefined symbol: bi_interp_mode_name
>>> referenced by bi_print.c:207 (external/mesa/src/panfrost/bifrost/bi_print.c:207)
...
ld.lld: error: undefined symbol: bi_round_mode_name
>>> referenced by bi_print.c:285 (external/mesa/src/panfrost/bifrost/bi_print.c:285)

ld.lld: error: undefined symbol: bi_clause_type_name
>>> referenced by disassemble.c:142 (external/mesa/src/panfrost/bifrost/disassemble.c:142)
...
ld.lld: error: undefined symbol: bi_ldst_type_name
>>> referenced by disassemble.c:0 (external/mesa/src/panfrost/bifrost/disassemble.c:0)

Fixes: 14bb72c68 ("pan/bi: Separate disasm/compiler targets")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6261>
2020-08-10 21:35:31 +02:00
Mauro Rossi 41c9a2e740 android: pan/mdg: Separate disassembler and compiler targets
Fixes the following building errors:

ld.lld: error: undefined symbol: mir_print_constant_component
>>> referenced by disassemble.c:356 (external/mesa/src/panfrost/midgard/disassemble.c:356)
...
ld.lld: error: undefined symbol: mir_print_constant_component
>>> referenced by disassemble.c:416 (external/mesa/src/panfrost/midgard/disassemble.c:416)

Fixes: b792d613e ("pan/mdg: Separate disassembler and compiler targets")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6261>
2020-08-10 21:35:31 +02:00
Mauro Rossi b9e58be347 android: panfrost: Move pandecode into lib/
Fixes the following building errors:

target  C: libpanfrost_decode <= external/mesa/src/panfrost/pandecode/common.c
...
clang: error: no such file or directory: 'external/mesa/src/panfrost/pandecode/common.c'
clang: error: no input files

Fixes: d62a6e7c5 ("panfrost: Move pandecode into lib/")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6261>
2020-08-10 21:35:31 +02:00
Mauro Rossi de352f58c3 android: panfrost: Rename encoder/ to lib/
Fixes the following building errors:

target  C: libpanfrost_encoder <= external/mesa/src/panfrost/encoder/pan_attributes.c
...
clang: error: no such file or directory: 'external/mesa/src/panfrost/encoder/pan_attributes.c'
clang: error: no input files

target  C: libpanfrost_encoder <= external/mesa/src/panfrost/encoder/pan_afbc.c
...
clang: error: no such file or directory: 'external/mesa/src/panfrost/encoder/pan_afbc.c'
clang: error: no input files

Fixes: 1c62b5528 ("panfrost: Rename encoder/ to lib/")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6261>
2020-08-10 21:35:31 +02:00
Alyssa Rosenzweig c5b2319628 panfrost: Drop compiler cmdstream deps
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 1d0b3ef051 panfrost: Treat texture dimension as first-class
Instead of hiding behind a cmdstream enum. The raw values have a very
simple interpretation as dimension.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 5a3088e85f panfrost: Inline max rt into compilers
Another dep.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 54f96544ec pan/bi: Drop use of MALI_POSITIVE
Contributing to a dep on the main cmdstream. It's a fancy word for
subtract one...

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig c94013c819 panfrost: Add panloader/ to .gitignore
For out-of-tree trace infrastructure.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 52e3a67bb1 panfrost: Reduce bit dependency to disassembly only
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 14bb72c68b pan/bi: Separate disasm/compiler targets
Likewise.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig b792d613e6 pan/mdg: Separate disassembler and compiler targets
The compiler depends on the disassembler, which is okay. But the
disassembler now no longer depends on the compiler circularly, avoiding
the need to being in GLSL/NIR.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig d62a6e7c5f panfrost: Move pandecode into lib/
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 1c62b5528a panfrost: Rename encoder/ to lib/
We'll want both encoding and decoding here, as a generic hardware
interface library based on GenXML.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 956b09653c panfrost: Don't export exception_status
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 4ddc6e543c panfrost: Remove panfrost-misc.h
Now unused.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 64f3c9da87 panfrost: Inline panfrost-misc.h into panfrost-job.h
We only need a small subset of the defines here.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig ebf7e87f2c pan/decode: Remove shader replacement artefact
Did this ever work?

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig e4df95bf9f panfrost: Move format stringify to decode.c
Let's simplify pandecode before moving it around. We don't need to share
this routine right now, and we'll be generating it soon.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig b80e753940 panfrost: Remove blend prettyprinters
Unused and mostly wrong too.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6196>
2020-08-06 23:54:24 +00:00
Alyssa Rosenzweig 2c47993b69 panfrost: Add MSAA mode selection field
This field enables MSAA, either writing samples to separate surfaces, to
a single large-bpp surface, or implicitly resolved and to a single
surface.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6161>
2020-08-04 18:39:24 +00:00
Alyssa Rosenzweig b2f475251e pan/mdg: Test for SSA before chasing addresses
It's possible an SSA value depends on a register; in this case, chasing
the source would result in a crash as the chase helper in NIR asserts
is_ssa. Instead we should check a priori that all the argments are in
fact SSA, bailing otherwise.

In the piglit shader exhibiting this bug (by looping over the index),
bailing on the ishl instruction is -necessary-. This is not merely us
being cowardly to avoid seeing through the registers; indeed, if we
wrote away the ishl instruction, the shift itself would have to be
stored in a load/store register (r26/r27) which would preclude reading
it in the loop, creating a register allocation failure later in the
compile. So this is the correct solution due to the restricted
semantics.

Closes #3286

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Icecream95 <ixn@keemail.me>
Fixes: f5401cb886 ("pan/midgard: Add address analysis framework")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6144>
2020-08-03 09:43:47 -04:00
Alyssa Rosenzweig b4de9e035a pan/mdg: Mask spills from texture write
This prevents RA failures the results of reading multiple textures that
require less than 4 channels, as seen in a number of GL 3 WebRender shaders.

Closes: #3342

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reported-by: Icecream95 <ixn@keemail.me>
Tested-by: Icecream95 <ixn@keemail.me>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6144>
2020-08-03 09:43:37 -04:00
Alyssa Rosenzweig 2dec9092be pan/bit: Remove BI_SHIFT stub
Fixes compile error with -Dtools=panfrost

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 946ff9b439 ("bifrost: Add support for nir_op_ishl")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6142>
2020-07-31 10:15:00 -04:00
Alyssa Rosenzweig aa989aed6d pan/bit: Update f32->f16 convert test
Needs a second argument to be consistent with the real IR and the
hardware instruction.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 8a4efe2d73 ("pan/bi: Pack second argument of F32_TO_F16")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6142>
2020-07-31 10:14:59 -04:00
Italo Nicola a91011c9ec pan/mdg: emit REGISTER_UNUSED on unused ALU src2
This saves power and time by skipping a roundtrip to the register file.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6128>
2020-07-31 00:25:21 +00:00
Italo Nicola 3d4deb659e pan/mdg: remove ins->br_compact and ins->branch_extended
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 8150c1d632 pan/mdg: defer branch packing
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 140185eb04 pan/mdg: refactor emit_alu_bundle
This refactor prepares emit_alu_bundle() for the next commit that
reconstructs branch instructions right before emission.
It also simplifies the code since the previous control flow was only
better when we had the prepacked fields in midgard_instruction.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 0f0f9ee710 pan/mdg: remove ins->alu
This commit removes the `ins->alu` field from midgard_instruction,
simplifying the code by just recreating midgard_vector_alu later when we
have to emit it.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 5299239c2e pan/mdg: externalize mir_pack_mod
midgard_print.c requires mir_pack_mod to remove references to ins->alu.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 1a4d165683 pan/mdg: defer register packing
This commit moves the packing of registers and other things from
install_registers_instr() to midgard_emit.c, right before emitting the
binary.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola bea6a652db pan/mdg: eliminate references to ins->load_store.op
This commit makes `ins->op` the correct field to use with load_store
instructions.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 92c808cd47 pan/mdg: eliminate references to ins->texture.op
This commit makes the `ins->op` the correct field to use with texture
instructions.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 83592de7ad pan/mdg: apply float outmods to textures
Texture instructions in midgard support float outmods, this commit makes
it so these instructions are emitted when the conditions are met.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 5011373e2b pan/mdg: eliminate references to ins->alu.outmod
In an effort to simplify MIR by not prepacking instructions, this commit
removes references to `ins->alu.outmod` so that we can later remove the
`ins->alu` field from midgard_instruction.
Every place that was using `ins->alu.outmod` was changed to now use the
generic `ins->outmod` field instead.
We then reconstruct the outmod field right before emission.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola f34815c6be pan/mdg: fix comment
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 5f7e0185cd pan/mdg: eliminate references to ins->alu.reg_mode
In an effort to simplify MIR by not prepacking instructions, this commit
removes references to `ins->alu.reg_mode` so that we can later remove
the `ins->alu` field from midgard_instruction.
Every place that was using reg_mode was changed to now use the generic
`ins->src_type` field instead.
We then reconstruct the reg_mode field right before emission.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola f4c89bf9bd pan/mdg: eliminate references to ins->alu.op
In an effort to simplify MIR by not prepacking instructions, this commit
removes references to `ins->alu.op` so that we can later remove the
`ins->alu` field from midgard_instruction.
Every place that was using ins->op was changed to now use the generic
`ins->op` field instead.
We then reconstruct the `alu.op` field right before emission.
This new field is generic and can contain opcodes for ALU, texture or
load/store instructions. It should be used in conjunction with
`ins->type`, just like the current prepacked `op` field.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola 598527f2fe pan/mdg: prepare effective_writemask()
In the next commits we will be removing the `alu` field from
midgard_instruction in order to simplify the code.
effective_writemask() doesn't actually use `alu` for anything, it only
needs to know the opcode.

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Italo Nicola b1b0ce04b3 pan/mdg: fix src_type in instructions that need a implicit zero
We were incorrectly assuming uint32 for src_type[1] regardless of
src_type[0].

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5933>
2020-07-30 22:55:36 +00:00
Jason Ekstrand 94f0bae4de panfrost/midgard: Make search_var take a nir_shader and mode
Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5966>
2020-07-29 17:38:58 +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
Chris Forbes c7626ac8ba bifrost: Fix packing of ADD_FEXP2_FAST
This was being packed as 1-src and so the Src1 was not set up properly.
It only worked by accident.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6111>
2020-07-28 14:46:41 -07:00
Chris Forbes a618631f2d bifrost: Honor src swizzle in special math ops
Most ops use the common handling in emit_alu in order to convert NIR
sources to bifrost sources, but the "special" math op lowering handrolls
the conversion (due to needing to reference the same source multiple
times).

Unfortunately, that handrolled lowering did not consider that there
might be a non-identity swizzle on the source. In this case we would
reference the wrong component of the source and generate garbage.

Fixes all but two of the remaining failures on G31 in:
  dEQP-GLES2.functional.shaders.operator.exponential.*highp*

The following tests are still broken due to some other issue:
  dEQP-GLES2.functional.shaders.operator.exponential.exp2.highp_float_fragment
  dEQP-GLES2.functional.shaders.operator.exponential.exp2.highp_vec2_fragment

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6108>
2020-07-28 13:45:20 -07:00
Chris Forbes 1882b1e5a7 bifrost: Add support for nir_op_iabs
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6098>
2020-07-28 15:40:00 +00:00
Chris Forbes a0a70879c5 bifrost: Add support for nir_op_imul
Unfortunately this doesn't map nicely to the existing instruction
classes, so we'll make a new one for now.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6091>
2020-07-28 01:13:09 +00:00
Chris Forbes 718d444e51 bifrost: Add support for nir_op_uge
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6091>
2020-07-28 01:13:09 +00:00
Chris Forbes 946ff9b439 bifrost: Add support for nir_op_ishl
Bifrost's bitwise ops include the shift capability. Previously we had
hardcoded the shift to zero in all cases.

There's room in future to emit slightly better code if a shift and a
bitwise operation can be folded together, but not going after that for
now.

This change also removes the separate BI_SHIFT instruction class as
BI_BITWISE can cover both cases.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6091>
2020-07-28 01:13:09 +00:00
Chris Forbes 539ea08736 bifrost: Add support for nir_op_inot
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6091>
2020-07-28 01:13:09 +00:00
Chris Forbes ef781880eb bifrost: Add lowering for b2i32
Since the bool representation is 0/~0, we can convert to int
just by &1.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6079>
2020-07-27 16:53:52 +00:00
Chris Forbes 1a168c90a0 bifrost: Document d3d/gl comparison control bit
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6079>
2020-07-27 16:53:52 +00:00
Chris Forbes ec37c7126d bifrost: Emit "d3d" variant of comparison instructions
The "d3d" variant uses ~0 as the true value. This is consistent
with NIR's nir_lower_bool_to_int32 pass.

Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6079>
2020-07-27 16:53:52 +00:00
Chris Forbes 0ffefad791 bifrost: Lower x->bool conversions to != 0
Signed-off-by: Chris Forbes <chrisforbes@google.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6079>
2020-07-27 16:53:52 +00:00
Icecream95 e764192f40 pan/mdg: Use the blend RT for blend shader framebuffer fetches
Fixes piglit test fbo-drawbuffers-blend-add when fixed-function
blending is disabled in panfrost_get_blend_for_context.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5892>
2020-07-20 14:15:49 +00:00
Icecream95 3ec252a3b2 panfrost: 8x MRT support
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5892>
2020-07-20 14:15:49 +00:00
Mauro Rossi 9e9c8e2f79 android: panfrost/encoder: add libmesa_nir static dependency
Fixes the following build error:

In file included from external/mesa/src/panfrost/encoder/pan_blit.c:34:
In file included from external/mesa/src/panfrost/encoder/../midgard/midgard_compile.h:27:
external/mesa/src/compiler/nir/nir.h:52:10: fatal error: 'nir_opcodes.h' file not found
         ^~~~~~~~~~~~~~~
1 error generated.

Fixes: 293f251871 ("panfrost: Use Midgard-specific reloads")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5961>
2020-07-18 08:28:27 +02:00
Icecream95 858cc13eb2 panfrost: Make panfrost_bo_wait take a wait_readers bool
panfrost_bo_wait is often used after
panfrost_flush_batches_accessing_bo, so make them take similar
arguments for consistency.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5962>
2020-07-18 01:36:59 +00:00
Alyssa Rosenzweig 610af7e1ac panfrost: Enable FP16 by default
I see no reason to hide this. The small hit in cycle count is offset in
practice by the increase in thread count. So let's ship it and get some
testing.

If this regresses a workload:

1. Open an issue on the tracker and attach an apitrace.
2. In the meantime set PAN_MESA_DEBUG=nofp16 to override.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5960>
2020-07-17 23:37:13 +00:00
Icecream95 c20d166b4e pan/mdg: Do per-sample framebuffer loads
EXT_shader_framebuffer_fetch requires the fetched value to be per-sample, so we
need to load the sample id when in a fragment shader.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5930>
2020-07-17 14:34:47 +00:00
Icecream95 25747cea67 panfrost: Rename lower_store to is_blend in pan_lower_framebuffer
The bool will be used for deciding whether to do a per-sample load.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5930>
2020-07-17 14:34:47 +00:00
Icecream95 4a8ad1e08f pan/mdg: Don't disassemble blit shaders
There are a lot of them and they are mostly uninteresting, so don't
disassemble them or print shader-db results.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5948>
2020-07-17 09:37:31 -04:00
Icecream95 01d60d3d75 pan/decode: Open the dump file later
Opening the dump file in pandecode_jc instead of doing it in
pandecode_next_frame avoids creating zero sized files when
applications exit.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5931>
2020-07-16 21:33:13 +00:00
Alyssa Rosenzweig 96fa8d70bc panfrost: Report CAPs more honestly
We're overreporting on some chips and underreporting on others. Let's be
more honest.

This exposes OpenGL ES 3.0 on Mali T760 through T860.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5858>
2020-07-16 19:59:43 +00:00
Alyssa Rosenzweig cce3d925d2 panfrost: Implement Z32F_S8 blits
Requires the ability to texture the stencil-only portion, and then
u_blitter kicks in for the rest.

v2: Fix dEQP-GLES31.functional.stencil_texturing.*

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5858>
2020-07-16 19:59:43 +00:00
Alyssa Rosenzweig 293f251871 panfrost: Use Midgard-specific reloads
v2: Be more explicit about sampler types. Prefer the term "load" to
"resolve" to match VK convention. Generate shaders for MRT 8x.  Blit
shader generation adds about 6ms to startup cost. We could cache thes.
shaders to disk if we needed to (or indeed, ship binaries).

v3: Fallback on u_blitter on Bifrost so Bifrost continues to work.
KHR_partial_update support is mostly no-oped on Bifrost now, but that's
okay for now - compositors are still functional.

v4: Specialize on multisample state as well to enable reloads of MSAA
textures. This requires 2x the shader variants, so I assume we're up to
12ms startup cost for generation. Annoying. Also fix interactions with
depth- or stencil-only clears of combined depth-stencil surfaces.

v5: Cache to the device (screen) instead of the context, reducing
duplicated work in apps that create many contexts (e.g. Chromium)

v6: Squash in KHR_partial_update cleanup to fix intermediate
regressions on a few tests.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5824>
2020-07-16 15:10:55 +00:00
Alyssa Rosenzweig e061bf004b panfrost: Identify zs_samples field
For MSAA depth/stencil.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
2020-07-15 22:19:37 +00:00
Alyssa Rosenzweig 6088891ef7 panfrost: Include sample count in payload estimates
Otherwise we might not reserve enough space.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
2020-07-15 22:19:37 +00:00
Alyssa Rosenzweig 5c65a27adc panfrost: Add MALI_PER_SAMPLE bit
For gl_SampleID reads.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
2020-07-15 22:19:37 +00:00
Alyssa Rosenzweig da2eed36f3 pan/mdg: Implement gl_SampleID
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
2020-07-15 22:19:37 +00:00
Alyssa Rosenzweig b2749c141d pan/mdg: Identify per-sample interpolation mode
So this is what .interp0 was this whole time.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
2020-07-15 22:19:36 +00:00
Alyssa Rosenzweig 59308a3a64 pan/mdg: Bump compiler RT maximum
We don't actually support MRT 8x yet but we would like to soon, so bump
it in the compiler.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5929>
2020-07-15 22:19:36 +00:00
Icecream95 334dab0576 pan/mdg: Skip z/s combining for dual-source writes
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5620>
2020-07-15 01:30:00 +00:00
Icecream95 85954ecfef pan/mdg: Dual source blend input/writeout support
We write to r2, which is preseved through to the blend shader, from
where it is read. We won't worry about MRT to keep things simple.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5620>
2020-07-15 01:30:00 +00:00
Icecream95 0ff6263534 pan/mdg: Add a nir pass to reorder store_output intrinsics
Real writeout stores, which break execution, need to be moved to after
dual-source stores, which are just standard register writes.

v2: Don't move stores forward, to avoid moving them to before where
    their source is written.

v3: Only reorder past dual-source stores.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5620>
2020-07-15 01:30:00 +00:00
Icecream95 6493d29f21 pan/mdg: Fix non-debug compiliation
Fixes error when the assert is optimized out:

   ../src/panfrost/midgard/midgard_compile.c: In function ‘output_load_rt_addr’:
   ../src/panfrost/midgard/midgard_compile.c:1644:1: error: control reaches end of non-void function [-Werror=return-type]
    }

Closes #3270

Fixes: 7781d2c2ea ("pan/mdg: Support MRT in output load lowering")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5895>
2020-07-14 15:54:41 +00:00
Italo Nicola 2096903a05 panfrost: Fix outmods on int to float conversions
No shader-db changes (Alyssa).

Signed-off-by: Italo Nicola <italonicola@collabora.com>
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5883>
2020-07-13 20:38:03 +00:00
Alyssa Rosenzweig f34b8d3609 panfrost: Map PIPE_{DXT, RGTC, BPTC} to MALI_BCn
Mali (and Vulkan) uses D3D naming conventions for these formats where
Gallium/Mesa uses OpenGL names, but the formats are equivalent. sRGB is
communicated out-of-band on Mali; otherwise, it appears to be a 1:1
mapping.

On supported devices, this exposes GL_EXT_texture_compression_rgtc and
GL_ARB_texture_compression_bptc, so update features.txt

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>
2020-07-13 11:24:41 -04:00
Alyssa Rosenzweig 407a052ced panfrost: Pipe in compressed texture feature mask
So we can query at run-time as part of Gallium's checks.

v2: More explicit naming.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>
2020-07-13 11:21:59 -04:00
Alyssa Rosenzweig d5a9cd1b7d panfrost: Add format codes for new compressed textures
Compressed formats line up with CONFIG_TEX_COMPRESSED_FORMAT_ENABLE
documented on
https://releases.linaro.org/archive/14.07/android/images/armv8-android-juno-lsk/

None of the new formats have been seen in the wild.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5856>
2020-07-13 11:21:35 -04:00
Alyssa Rosenzweig 64608b4bcf panfrost: Compact unused BO flag bits
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
2020-07-13 14:42:33 +00:00
Alyssa Rosenzweig 62ec4e02f6 panfrost: Remove PAN_BO_DONT_REUSE
Equivalent to SHARED.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
2020-07-13 14:42:33 +00:00
Alyssa Rosenzweig d6e3808e7e panfrost: Remove PAN_BO_COHERENT_LOCAL
Ancient relic from kbase. Panfrost kernel doesn't need this.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
2020-07-13 14:42:33 +00:00
Alyssa Rosenzweig baa1a8fbba panfrost: Merge PAN_BO_IMPORTED/PAN_BO_EXPORTED
Always checked together and really signal the same property from
different perspectives.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
2020-07-13 14:42:33 +00:00
Alyssa Rosenzweig 0aa6de967b panfrost: Index BOs from the BO map sparse array
Now we have a central store of them, so we may remove active_bo.

v2: Squash two patches together to prevent a race condition mid-series.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
2020-07-13 14:42:33 +00:00
Alyssa Rosenzweig 169dbb5b08 panfrost: Add a sparse array to map GEM handles to BOs
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
2020-07-13 14:42:33 +00:00
Alyssa Rosenzweig 37d89e0f93 panfrost: Fix write to free'd memory
No clue how this worked before.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Fixes: 82f18b713a ("panfrost: Keep track of active BOs")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5859>
2020-07-13 14:42:33 +00:00
Alyssa Rosenzweig 317be5a16d panfrost: Extend fetched framebuffer results
So NIR doesn't complain about invalid swizzles when reading a format
with less than 4 channels.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:11 +00:00
Alyssa Rosenzweig d94584c5a6 panfrost: Always use SOFTWARE for pure formats
Otherwise we end up implicitly converting ints to floating point.
Likewise for floats which again have strange interactions.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:11 +00:00
Icecream95 a3952e927e panfrost: Use f2fmp for framebuffer lowering conversions
This allows the conversion to be removed when the output is needed as
f32 anyway, for example for highp framebuffer fetch.

v2: Also change operations such as i2i16 to i2imp (Alyssa).

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:11 +00:00
Icecream95 d16d136734 panfrost: Stop keying on rt format when using native loads
Native loads are the same for any format, so we can use the same
shader variant for all framebuffer formats with a native load.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:11 +00:00
Icecream95 2fbe7ca9d9 pan/mdg: Use a 32-bit ld_color_buffer op when needed
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:11 +00:00
Icecream95 18059f48f8 pan/mdg: Set the z/s store intrinsic base correctly
When EXT_shader_framebuffer_fetch is used and only depth and/or
stencil are written, we can't rely on the first output being to
depth/stencil.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:11 +00:00
Icecream95 7781d2c2ea pan/mdg: Support MRT in output load lowering
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Icecream95 2fa60b70e0 pan/mdg: Handle non-blend framebuffer lowering
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Icecream95 ed4d2739fe pan/mdg: Emit a tilebuffer wait loop when needed
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Icecream95 1e1eee992e pan/mdg: Do the pan_lower_framebuffer pass later
The pass is useful for EXT_shader_framebuffer_fetch, not just blend
shaders, so we should do it with the other lowering passes in
midgard_compile_shader_nir.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Icecream95 75018f6495 panfrost: Add rt formats to shader state
load_output lowering will depend on the framebuffer formats.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Icecream95 f2eced9660 pan/mdg: Use the writeout tag for tilebuffer wait loops
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Icecream95 61dfc3c693 pan/mdg: Handle tilebuffer wait loops
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Icecream95 4141d26ee1 panfrost: Fix MALI_READS_TILEBUFFER
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5755>
2020-07-13 13:35:10 +00:00
Alyssa Rosenzweig 816af26f02 panfrost: Handle PIPE_FORMAT_S8_UINT
For wallpaper blits with separate stencil.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>
2020-07-09 12:20:27 -04:00
Alyssa Rosenzweig 4c89148834 panfrost: Handle PIPE_FORMAT_X24S8_UINT
We can treat it as RGBA32UI and swizzle away everything but R, like the
blob does. Maybe not the most efficient thing in the world.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>
2020-07-09 12:20:27 -04:00
Alyssa Rosenzweig 1fdeef5e4a panfrost: Move scoreboarding routines to common
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5827>
2020-07-09 12:03:08 -04:00
Alyssa Rosenzweig c8d848b278 panfrost: Move pool routines to common code
We finally have it decoupled from Galliumisms (and OpenGLisms, indeed)
so we can share the file.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>
2020-07-09 14:54:38 +00:00
Alyssa Rosenzweig 1d88f07820 panfrost: Drop Gallium-local pan_bo_create wrapper
We can handle pandecode in shared code now, which will matter for
tracing non-Gallium drivers.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>
2020-07-09 14:54:38 +00:00
Alyssa Rosenzweig ed1910dc68 panfrost: Move debug flags into the device
Removes random global state flying about which doesn't really work for
common code. We cleanup some debug messages while we're at it because
the mostly-unused DBG macro relies on magic state.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5794>
2020-07-09 14:54:38 +00:00
Timothy Arceri 3cb2438284 panfrost: add some missing fallthrough comments to bi_pack.c
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>
2020-07-08 03:04:03 +00:00
Timothy Arceri 2286c9ac21 panfrost: hide more unused code in bi_lower_combine.c
Fixes some unused-function warnings.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>
2020-07-08 03:04:03 +00:00
Timothy Arceri f35283d32e panfrost: add some missing fallthrough comments
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5766>
2020-07-08 03:04:03 +00:00
Icecream95 ef67218325 pan/decode: Make mapped memory read-only while decoding
This will help catch any bugs where descriptors are accidentally
modified.

v2: Use a dynarray of ro memory mappings rather than iterating through
    the mmap hash table.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5590>
2020-07-07 02:29:52 +00:00
Alyssa Rosenzweig 5e38d956ab panfrost: Identify depth/stencil layer strides
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
2020-07-07 01:13:39 +00:00
Alyssa Rosenzweig 490fbce239 panfrost: Implement alpha-to-coverage
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
2020-07-07 01:13:39 +00:00
Alyssa Rosenzweig 3e251328fa panfrost: Identify coverage_mask
The driver specifies the mask directly.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
2020-07-07 01:13:39 +00:00
Alyssa Rosenzweig 937d3687ac panfrost: Include pointer for each sample
Treating it like an array/3D texture.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
2020-07-07 01:13:39 +00:00
Alyssa Rosenzweig 41c06deb63 panfrost: Index texture by sample
This will allow MSAA to route through.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5782>
2020-07-07 01:13:39 +00:00