Commit Graph

127203 Commits

Author SHA1 Message Date
Bas Nieuwenhuizen 371f6f42ad radv: Update CI expectations for the recent descriptor indexing regressions.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6285>
2020-08-12 11:15:42 +00:00
Jason Ekstrand 3d7d76c152 iris: Add support for MESA_SHADER_KERNEL in the disk cache
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand 65eeb06a7f iris: Upload kernel inputs with system values
Clover doesn't upload a cbuf0 but instead provides the kernel inputs as
part of the pipe_grid.  The most obvious thing to do is to upload them
along with system values.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand f5e7be386f iris: Copy dest size from the original intrinsic in setup_uniforms
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand 43429efc61 iris/disk_cache: Stop assuming stage == cache_id
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand 6dfe41c54e iris: Add a kernel_input_size field for compiled shaders
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand e39326e617 iris: Use blob_write_uint32 for num_system_values
We read it with blob_read_uint32; we should write it as uint32 as well.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand 003b04e266 intel/compiler: Allow MESA_SHADER_KERNEL
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Caio Marcelo de Oliveira Filho e2b6ccbdad intel/compiler: Use C99 array initializers for prog_data/key sizes
This is way better than a pile of STATIC_ASSERTs.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand 8e1de8e5ac intel/cs_intrinsics: Handle 64-bit intrinsics
It's safe to do the math in 32 bits because they're all local workgroup
calculations.  We just need to do a conversion at the end.  For a couple
of intrinsics, we just turn them into 32-bit intrinsics and add a u2u64.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand 8d62735b47 iris: Add support for serialized NIR
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand baa4cf9b8e iris: Implement set_global_binding
All this has to do is track which globals are bound and make sure the
batch references them every time.  We use A64 messages to access them so
there are no binding table entries to manage.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Jason Ekstrand 17280a8ef1 iris: no-op implement set_compute_resources
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6280>
2020-08-12 10:11:06 +00:00
Samuel Pitoiset ac6e207ee0 gitlab-ci: test Fossilize with GFX1030
To make sure we don't completely break ACO GFX1030 support.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6257>
2020-08-12 09:45:57 +00:00
Samuel Pitoiset 431a3cf239 radv/winsys: add null winsys entries for Sienna Cichild/Navy Flounder
We don't know the PCI ID yet.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6257>
2020-08-12 09:45:57 +00:00
Samuel Pitoiset 638a09b827 radv: fix emitting the border color pointer on the compute queue
This was just missing.

Fixes: 57e796a12a ("radv: Implement VK_EXT_custom_border_color")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: John Galt <johngaltfirstrun@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6276>
2020-08-12 09:13:11 +02:00
Vinson Lee 96cfc684e6 util: Fix memory leaks in unit test.
Fix warnings reported by Coverity Scan.

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

Fixes: d0d14f3f64 ("util: Add unit test for stack backtrace caputure")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6246>
2020-08-11 14:11:01 -07:00
Yogesh Mohan Marimuthu ef66e02a40 src/mesa: add GL_NV_half_float extension support (v2)
This patch adds support for GL_NV_half_float
extension.

v2: fix main_test failure

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6219>
2020-08-11 19:55:22 +00:00
Nanley Chery 8abf59ff98 dri_util: Update internal_format to GL_RGB8 for MESA_FORMAT_B8G8R8X8_UNORM
Port the change done for RGBX8888 in
02a1f95386.

If XR24 images are considered to be VIEW_CLASS_24_BITS-compatible, it's
reasonable to assume that XB24 images would be as well.

Fixes: bf576772ab ("dri_util: add driImageFormatToSizedInternalGLFormat function")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6095>
2020-08-11 19:35:03 +00:00
Daniel Schürmann fdb97d3d29 aco: execute branch instructions in WQM if necessary
It could happen that only the branch condition was computed in WQM
and not the branch instruction.
There is now some rendundancy which should be cleaned up.

Fixes: 3817fa7a4d ('aco: fix WQM handling in nested loops')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6260>
2020-08-11 15:35:59 +00:00
Jesse Natalie 678cb6d248 nir: nir_range_analysis needs to be updated for vec16
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6275>
2020-08-11 14:38:34 +00:00
Rhys Perry 7b4c24eb67 aco: don't move memory accesses to before control barriers
Fixes random failures of dEQP-VK.image.qualifiers.volatile.cube_array.r32i
and similar tests on Vega.

fossil-db (Navi):
Totals from 6 (0.00% of 135946) affected shaders:
VMEM: 1218 -> 1110 (-8.87%); split: +2.46%, -11.33%
SMEM: 174 -> 189 (+8.62%)
Copies: 84 -> 87 (+3.57%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: cd392a10d0 ('radv/aco,aco: use scoped barriers')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6174>
2020-08-11 14:16:00 +01:00
Samuel Pitoiset e4c6204d65 radv: limit LATE_ALLOC_GS to prevent a GPU hang on GFX10
Found by inspection, doesn't fix anything known.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6279>
2020-08-11 12:47:33 +00:00
Samuel Pitoiset 0256250547 radv/gfx10: add missing initialization of registers
Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6277>
2020-08-11 13:48:32 +02:00
Christian Gmeiner 044b238507 etnaviv: completely turn off MSAA
MSAA worked before etnaviv landed in upstream mesa but got
broken over time. Disable MSAA completely until it is fixed again.

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

Cc: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5608>
2020-08-11 09:19:57 +00:00
Alyssa Rosenzweig 5cf7eec6b1 nir/lower_ssbo: Don't set align_* for atomics
Fixes crashes when lowering atomic SSBOs:

   run: ../src/compiler/nir/nir.h:1875: nir_intrinsic_align_mul: Assertion `info->index_map[NIR_INTRINSIC_ALIGN_MUL] > 0' failed.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6204>
2020-08-11 09:00:11 +00:00
Tapani Pälli 2d010d3dc5 anv: add a check for depthStencilState before using it
v2: move the code under existing correct check!

Fixes: e4590c0750 ("anv: depth/stencil dynamic state support")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3375
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Brian Paul <brianp@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6240>
2020-08-11 11:36:11 +03:00
Lionel Landwerlin ffc8f2ba4c anv: fix up dynamic clip emission
There were 2 issues :

   * We were not emitting the clip state when the pipeline changed

   * On Gen7 we did not program the front facing & cull mode dynamic
     values in the clip state

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: c34d8ac26e ("anv: handle dynamic viewport count")
Closes https://gitlab.freedesktop.org/mesa/mesa/-/issues/3379

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6265>
2020-08-11 10:07:08 +03:00
Lionel Landwerlin 240c0746d1 anv: centralize vk to gen arrays
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6265>
2020-08-11 10:07:08 +03:00
Rob Clark 3d6e4a201a freedreno/decode: try harder to not crash in disasm
Move the handling for catching asserts when we start decoding garbage
into disasm-a3xx.  This way it can also cover other cases where cffdec
tries to disassemble memory, such as SP_xS_OBJ_START.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6242>
2020-08-11 03:13:42 +00:00
Rob Clark cbfce486f2 freedreno/crashdec: handle section name typos
The fixes tag isn't so much because it was incorrect before, but because
I'm going to send a kernel patch to fix the typo, and that will break
old crashdec.

Fixes: 1ea4ef0d3b ("freedreno: slurp in decode tools")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6242>
2020-08-11 03:13:42 +00:00
Rob Clark 8d437b2194 freedreno/ir3: add more disasm stats
Add tracking for # of instructions per category, similar to the last
patch.  Also add a few other shader-db stats that were missing on the
disasm side, to make it easier to compare to shaders from cmdstream
traces.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6243>
2020-08-11 01:12:18 +00:00
Rob Clark 7aa74ab792 freedreno/ir3: add tracking for # of instructions per category
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6243>
2020-08-11 01:12:18 +00:00
Mike Blumenkrantz 2cd0c8d8ea gallium/u_transfer_helper: add util functions for doing deinterleaving during map
in some cases (e.g., zink and d3d12) we only want to split the depth and stencil
buffers when we're mapping them, and we can handle packed buffers in other cases,
so being able to reuse the u_transfer_helper functionality is still desired but
only if we can preserve the underlying buffer the rest of the time

Kenneth Graunke notes during post-review:
Vulkan reads/copies on packed Z24S8 only return depth, so we need to use separate
Z24 and S8 reads and do packing tricks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5338>
2020-08-10 23:25:57 +00:00
Mike Blumenkrantz 2368813ce6 gallium: add pipe_transfer_usage for z/s only mappings
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5338>
2020-08-10 23:25:57 +00:00
Mark Janes cf52b40fb0 intel/fs: work around gen12 lower-precision source modifier limitation
GEN:BUG:1604601757 prevents source modifiers for multiplication of
lower precision integers.

lower_mul_dword_inst() splits 32x32 multiplication into 32x16, and
needs to eliminate source modifiers in this case.

Closes: #3329
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2020-08-10 13:30:45 -07:00
Mark Janes ee06e47c5b intel/fs: Assert if lower_source_modifiers converts 32x16 to 32x32 multiplication
Lowering source modifiers will convert a 16bit source to a 32bit
value.  In the case of integer multiplication, this will reverse
previous lowering performed by lower_mul_dword_inst.

Assert to prevent an illegal DxD operation (and GPU hang).

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
2020-08-10 13:29:56 -07: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
Rhys Perry 6e70508151 aco: set constant_data_offset correctly in the case of merged shaders
setup_nir() is done for all shaders before any of them are selected, so
constant_data_offset could be incorrect for the first shader.

Fixes incorrect geometry in Mafia III and Max Payne 3.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2768
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6205>
2020-08-10 18:21:47 +00:00
Thong Thai 0f8ef37f65 radeon/vcn: fix jpeg decode for navi10
Fixes an issue where the JPEG decode would timeout when decoding certain JPEG files.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <boyuan.zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6249>
2020-08-10 16:39:48 +00:00
Bas Nieuwenhuizen e362ccb20c radv: Do not consider layouts fast-clearable on compute queue.
We cannot decompress from the compute queue. While I'm pretty sure
VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL is only useful on the
graphics queue, I cannot find a VU that prevents the transition
from happening on another queue, so we need to be careful here.

This patch ensures we do the decompression on the barrier that changes
the queue ownership.

Another problem was that DCC images were considered fast-clearable
when not DCC compressed, which resulted in a mess with concurrent
queue ownership.

Cc: <mesa-stable@lists.freedesktop.org>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3387
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6252>
2020-08-10 16:24:38 +00:00
Bas Nieuwenhuizen 2fa83dc64d radv: Add forcecompress debug flag.
Enables DCC/HTILE/CMASK/FMASK when supported, not just when we think
it is beneficial.

This is helpful to detect compression bugs with CTS.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6252>
2020-08-10 16:24:38 +00:00
Marcin Ślusarz a777b25350 intel/perf: export performance counters sorted by [group|set] and name
It's a lot easier to deal with them in RenderDoc when they are
in some meaningful order.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
2020-08-10 13:41:29 +00:00
Marcin Ślusarz 59716e40b0 intel/perf: split load_oa_metrics
Move oa_metrics_available out of load_oa_metrics and call
build_unique_counter_list outside.

This change is a preparation for the next patch. It should
not have any functional impact.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
2020-08-10 13:41:29 +00:00
Marcin Ślusarz 2fbab5a1b3 intel/perf: fix performance counters availability after glFinish
Currently Linux kernel gathers performance counters at fixed
intervals (~5-10ms), so if application uses AMD_performance_monitor
extension and immediately after glFinish() asks GL driver for HW
performance counter values it might not get any data (values == 0).

Fix this by moving the "read counters from kernel" code from
"is query ready" to "get counter values" callback with a loop around
it. Unfortunately it means that the "read counters from kernel"
code can spin for up to 10ms.

Ideally kernel should gather performance counters whenever we ask
it for counter values, but for now we have deal with what we have.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
2020-08-10 13:41:29 +00:00
Marcin Ślusarz 9fa64803aa intel/perf: streamline error handling in read_oa_samples_until
No functional changes.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
2020-08-10 13:41:29 +00:00
Marcin Ślusarz 03e8b3551c intel/perf: fix how pipeline stats are stored
It matters only when counters are not ordered by offset.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5788>
2020-08-10 13:41:29 +00:00