Commit Graph

127441 Commits

Author SHA1 Message Date
Eric Anholt b440c28b78 nir: Shrink store intrinsic num_components to the size used by the writemask.
This cuts a bunch of vector setup for undef components in the i965 vec4
backend.  Noticed while looking into codegen regressions in nir-to-tgsi.

brw results:
total instructions in shared programs: 3893221 -> 3881461 (-0.30%)
total cycles in shared programs: 113792154 -> 113810288 (0.02%)

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6054>
2020-08-20 16:44:08 +00:00
Eric Anholt 5f26c21e62 nir: Expand opt_undef to handle undef channels in a store intrinsic.
Instead of only handling all-undef stores, shrink the writemask to just
the defined channels.  Cleans up a bunch of writemasks on prog_to_nir
output in particular.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6054>
2020-08-20 16:44:08 +00:00
Eric Anholt a29b7b6ff5 nir/opt_undef: Handle a couple more normal store intrinsics.
They've got the value in the same slot as the others, and the same undef
behavior should be fine.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6054>
2020-08-20 16:44:08 +00:00
Eric Anholt b3c822a0a8 radv: Move nir_opt_shrink_vectors() into the opt loop.
Upcoming changes to opt_undef will result in this pass doing more work and
generating vector MOVs that need re-scalarizing (which is inside of the
main opt loop).

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6054>
2020-08-20 16:44:08 +00:00
Alyssa Rosenzweig 94f4ecba8d panfrost: Reduce attribute buffer allocations
With vertex ID / instance ID in use, vs->attribute_count will be
expanded appropriately. Without them in use, everything is 1:1 (or 1:2
in the worst case of NPOT everything).

Down to 3 slabs + 64184 bytes.

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:02 +02:00
Alyssa Rosenzweig 9a6934d67f panfrost: Don't reserve for NPOT w/o instancing
It's impossible. Down to 5 slabs + 45368.

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:02 +02:00
Alyssa Rosenzweig 09ea7c09cc panfrost: Don't overallocate attributes
We only need vertex ID / instance ID if the shader actually requests it.
Cuts -bideas's beginning from (7 slab + 63352 bytes) to (7 slabs +
32568).

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:02 +02:00
Alyssa Rosenzweig 3df90c7c27 panfrost: Fix attribute buffer underallocation
Breaks on the pathological where everything is NPOT.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: e646c861fc ("panfrost: Use packs for vertex attribute buffers")
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6373>
2020-08-20 18:15:02 +02: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 1cb47f8eea panfrost: Free batch->dependencies
On glmark2-es2 -bterrain:

594.05KB leaked over 9282 calls from:
    panfrost_batch_update_bo_access
      at ../src/gallium/drivers/panfrost/pan_job.c:462
      in /home/alyssa/rockchip_dri.so
    panfrost_batch_add_bo
      at ../src/gallium/drivers/panfrost/pan_job.c:560
    panfrost_batch_add_bo
      at ../src/gallium/drivers/panfrost/pan_job.c:519
      in /home/alyssa/rockchip_dri.so
    panfrost_batch_add_resource_bos
      at ../src/gallium/drivers/panfrost/pan_job.c:569
    panfrost_batch_add_fbo_bos
      at ../src/gallium/drivers/panfrost/pan_job.c:588
      in /home/alyssa/rockchip_dri.so
    panfrost_create_batch
      at ../src/gallium/drivers/panfrost/pan_job.c:126

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 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 9146f596ed panfrost: Free cloned NIR shader
Fixes heaptrack leak:

19.37KB leaked over 63 calls from:
    0xffff92bbefc3
      in ??
    nir_alu_instr_create
      at ../src/compiler/nir/nir.c:442
      in /home/alyssa/rockchip_dri.so
    clone_alu
      at ../src/compiler/nir/nir_clone.c:277
      in /home/alyssa/rockchip_dri.so
    clone_instr
      at ../src/compiler/nir/nir_clone.c:495
      in /home/alyssa/rockchip_dri.so
    clone_block
      at ../src/compiler/nir/nir_clone.c:544
    clone_cf_list
      at ../src/compiler/nir/nir_clone.c:594
    clone_function_impl
      at ../src/compiler/nir/nir_clone.c:672
      in /home/alyssa/rockchip_dri.so
    nir_shader_clone
      at ../src/compiler/nir/nir_clone.c:744
      in /home/alyssa/rockchip_dri.so
    panfrost_shader_compile
      at ../src/gallium/drivers/panfrost/pan_assemble.c:154
      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 ba4fc67812 panfrost: Fix blend leak for render targets 5-8
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fixes: 375d4c2c74 ("panfrost: Extend blending to MRT")
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 4ff4b04b50 panfrost: Keep finalized blend state constant
It's probably fine, but the writes to an uninitialized struct make me
nervous. Let's do the obvious thing instead.

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 93200ce4c6 panfrost: Drop depth-only case in blend finalize
Since last commit, we don't call this function at all if there's no
matching colour buffer (it wouldn't make sense to!)

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 8249e2b9a2 panfrost: Explicitly handle nr_cbufs=0 case
Avoids some indirection around colour buffer count.

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 dc7fbe114b panfrost: Drop implicit blend pooling
We dropped blend shader pools a long time ago for various reasons, but
the indirection required remained. Oops.

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 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
Kenneth Graunke 3fed1c75ef iris: Fix headerless sampler messages in compute shaders with preemption
We were failing to set the "Headerless Message for Preemptable Contexts"
bit in SAMPLER_MODE in the compute context.  Other drivers use a single
hardware context, so setting it on the render engine was sufficient to
flip it in both pipelines.  But iris uses a separate hardware context
for compute, so we were only getting these set for the render context.

Thanks to Jason Ekstrand for catching this bug.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6380>
2020-08-20 14:57:40 +00:00
Samuel Pitoiset 58817bda8b aco: fix file leak in ra_fail()
Fixes: c2b1978aa4 ("aco: rework the way various compilation/validation errors are reported")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6399>
2020-08-20 14:42:07 +00:00
Jason Ekstrand 74ac8f3f64 nir/opt_large_constants: Fix a type/deref_type typo
Fixes: df9596353a "nir/large_constants: Handle incomplete derefs"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6403>
2020-08-20 08:47:04 -05:00
Marcin Ślusarz e5bac3c669 gitlab: ask for more detailed info about GPU
PCIID is only printed by lspci/lshw on demand.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6345>
2020-08-20 11:56:19 +00:00
Rhys Perry b553c7dd96 radv: fix null memcpy and zero-sized malloc
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
2020-08-20 10:52:19 +00:00
Rhys Perry b50ae77014 radv: align pipeline cache entry and header sizes
Fixes UBSan error:
../src/amd/vulkan/radv_pipeline_cache.c:603:42: runtime error: member access within misaligned address 0x00000152ebcc for type 'struct cache_entry', which requires 8 byte alignment

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
2020-08-20 10:52:19 +00:00
Rhys Perry 4f08af6766 radv: don't pass null to _mesa_sha1_update
This could then pass NULL to memcpy. Fixes UBSan error:
../src/util/sha1/sha1.c:140:8: runtime error: null pointer passed as argument 2, which is declared to never be null

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
2020-08-20 10:52:19 +00:00
Rhys Perry 30fca3b2e6 nir: fix memory leak in nir_cf_list_clone
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
2020-08-20 10:52:19 +00:00
Rhys Perry 27ec38d746 nir: fix potential left shift of a negative value
Fixes UBSan error:
src/compiler/nir/nir_constant_expressions.c:36573:32: runtime error: left shift of negative value -1

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
2020-08-20 10:52:19 +00:00
Rhys Perry 391eeb7443 util: add a alignof() macro
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6206>
2020-08-20 10:52:19 +00:00
Rhys Perry 721cb6cc07 gitlab: ask inxi output to be in code blocks
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Acked-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6365>
2020-08-20 10:20:49 +00:00
Samuel Pitoiset e901b901cb radv,aco: report ACO errors/warnings back via VK_EXT_debug_report
To help developers.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6318>
2020-08-20 08:15:08 +02:00
Samuel Pitoiset c2b1978aa4 aco: rework the way various compilation/validation errors are reported
The upcoming change will allow to report all ACO errors (or warnings)
directly to the app via VK_EXT_debug_report. This is similar to what
we already do for reporting various SPIRV->NIR errors.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6318>
2020-08-20 08:15:06 +02:00
Samuel Pitoiset bc723dfda7 aco: rename DEBUG_VALIDATE to DEBUG_VALIDATE_IR
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6318>
2020-08-20 08:15:04 +02:00
Tapani Pälli 709dffa856 anv: null check for buffer before reading size
v2: move assignment under existing check (Nanley)

Fixes: b9a05447a1 ("anv: dynamic vertex input binding stride and size support")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6369>
2020-08-20 08:33:59 +03:00
Eric Anholt 8d38b25788 util: Explicitly call the unpack functions from inside bptc pack/unpack.
We were calling the table-based unpack functions from inside the pack and
unpack table's methods, so if anything included these pack functions (such
as a call to a table-based pack function), you'd pull in all of unpack as
well.

By calling them explicitly, we save some overhead in these functions
(switch statement, address math on the zero x,y arguments) anyway.

Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6307>
2020-08-20 05:03:16 +00:00
Eric Anholt edf0aeb3cd util: Expose rgba unpack/fetch functions as external functions as well.
Like we just did for pack functions for freedreno, it will be useful to be
able to pick out a specific rgba unpack function instead of going through
the table.

Reviewed-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6307>
2020-08-20 05:03:16 +00:00
Nanley Chery 9d503b36ca iris: Drop buffer support in resource_from_handle
The callers don't seem to pass targets of PIPE_BUFFER. Stop nesting an
if-else block by dropping support for this target.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6311>
2020-08-19 22:30:39 +00:00
Nanley Chery c54bb23967 iris: Add and use iris_resource_configure_main
Reduce duplication of ISL surface creation code for main surfaces. This
is similar to iris_resource_configure_aux.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6311>
2020-08-19 22:30:39 +00:00
Nanley Chery 51e42e2183 iris: Move size/offset calculations out of configure_aux
Not all callers want the result of the offset and size calculations.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6311>
2020-08-19 22:30:39 +00:00
Nanley Chery 8b2fc91959 iris: Drop old comment on clear color BO allocation
Iris hasn't used a clear color BO on gen9 since commit 1cd13ccee7.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6311>
2020-08-19 22:30:39 +00:00
Nanley Chery fd3c20674e iris: Drop unused resource allocation optimization
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6311>
2020-08-19 22:30:39 +00:00
Nanley Chery 2555321a10 iris: Drop iris_resource_alloc_separate_aux
When this function was called, the res->mod_info->aux_usage parameter
was ISL_AUX_USAGE_NONE. As a result, no aux buffer was ever allocated.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6311>
2020-08-19 22:30:39 +00:00
Eric Engestrom 0dc0a79a58 egl: drop another indentation level in _eglFindDisplay() by inverting an if
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6361>
2020-08-19 22:10:06 +00:00
Eric Engestrom 8b2fc1d1b5 egl: drop an indentation level in _eglFindDisplay() by replacing break/if with a goto
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6361>
2020-08-19 22:10:06 +00:00