Commit Graph

200 Commits

Author SHA1 Message Date
Marcin Ślusarz f4386b81e6 intel: fix typos found by codespell
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17191>
2022-06-27 10:20:55 +00:00
Lionel Landwerlin 9d0db8d4c4 intel/perf: deal with OA reports timestamp values on DG2
OA reports on XeHP have their timestamp shifted to the left by 1. To
get that back in the same time domain as the REG_READ you need to
shift it back to the right and you're loosing the top bit.

v2: use ull for 64bit constant (Ian)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin 773f41e3e4 intel/perf: disable sseu setting on Gfx12.5+
This is rejected by i915.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin d2834dd626 intel/perf: add new layout for Gfx12.5 products
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin 66045acdf9 intel/perf: add max vfuncs
New counters will use those from inside their read function to
generate percentage numbers.

v2: Forgot to update Iris (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin c740ca6000 intel/perf: add support new variable counting the number of EUs in slice0-3
v2: MIN2(4, max_slices) (Marcin)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin 6f63bc38e7 intel/perf: add OA A counter type
On Gfx12.5 products, we'll need to capture a couple of A counters that
are not captured in MI_RPC reports. Those are actually global,
previously all A counters were per context.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin 376e420abb intel/perf: stop overriding oa_format
This already set in the intel_perf_setup.h file at metric set
creation.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin aa04b47c6e intel/perf: add support for GtSlice/GtSliceXDualsubsliceY variables
For those, we'll fish the information out of the devinfo.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin d134a62345 intel/perf: add support for dualsubslice count variable
This is the same as the subslice count.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin efc2782f97 intel/perf: store a copy of devinfo
In the future we'll pull more information off devinfo.

v2: Constify pointers (Ian)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Lionel Landwerlin 0df4b96062 intel/perf: add support for new opcodes in code generation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16144>
2022-05-17 19:55:10 +00:00
Francisco Jerez e858da39e5 intel/perf: Fix OA report accumulation on Gfx12+.
The intel_perf_query path used for performance queries on GL was
passing a bogus "end" pointer to intel_perf_query_result_accumulate(),
causing it to accumulate garbage values.  This was causing the values
of many performance counters to be corrupted.

The "end" pointer was incorrect because the current code was assuming
that different OA reports were located TOTAL_QUERY_DATA_SIZE bytes
apart, which is a hard-coded preprocessor define.  However recent
(Gfx12+) hardware generations use a variable query size determined by
the query layout.  Use the size derived from it instead, and remove
the stale define.

Fixes: 3c51325025 ("intel/perf: switch query code to use query layout")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15783>
2022-04-12 00:11:47 +00:00
Matt Turner 8860ff3310 intel/perf: Destination array calculation into function
Cuts 119 KiB from iris_dri.so and libvulkan_intel.so.

   text    data     bss     dec     hex filename
 917511       0       0  917511   e0007 meson-generated_.._intel_perf_metrics.c.o (before)
 796986       0       0  796986   c293a meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14130948 365708  210004 14706660 e067e4 iris_dri.so (before)
14009332 365708  210004 14585044 de8cd4 iris_dri.so (after)

   text    data     bss     dec     hex filename
8124225  214264   22820 8361309  7f955d libvulkan_intel.so (before)
8002609  214264   22820 8239693  7dba4d libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner d80d3c6760 intel/perf: Fix mistake in description string
Along with fixing the grammar, this allows it to be deduplicated since
the properly worded description exists in later generations' XMLs.

Cuts 96 B from iris_dri.so and libvulkan_intel.so.

   text	   data	    bss	    dec	    hex	filename
 917613	      0	      0	 917613	  e006d	meson-generated_.._intel_perf_metrics.c.o (before)
 917511	      0	      0	 917511	  e0007	meson-generated_.._intel_perf_metrics.c.o (after)

   text	   data	    bss	    dec	    hex	filename
14131044 365708	 210004	14706756 e06844	iris_dri.so (before)
14130948 365708	 210004	14706660 e067e4	iris_dri.so (after)

   text	   data	    bss	    dec	    hex	filename
8124321	 214264	  22820	8361405	 7f95bd	libvulkan_intel.so (before)
8124225	 214264	  22820	8361309	 7f955d	libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner 7024b8e0eb intel/perf: Mark intel_perf_counter_* enums as PACKED
Reduces their sizes from 4 bytes to 1. Cuts 6 KiB from iris_dri.so and
libvulkan_intel.so.

   text    data     bss     dec     hex filename
 924401       0       0  924401   e1af1 meson-generated_.._intel_perf_metrics.c.o (before)
 917613       0       0  917613   e006d meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14137732 365708  210004 14713444 e08264 iris_dri.so (before)
14131044 365708  210004 14706756 e06844 iris_dri.so (after)

   text    data     bss     dec     hex filename
8131009  214264   22820 8368093  7fafdd libvulkan_intel.so (before)
8124321  214264   22820 8361405  7f95bd libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner 6c0246dcf4 intel/perf: Store indices to strings rather than pointers
The compiler does a good job of deduplicating strings already, but we
can eliminate the pointers to each string by combining the strings into
a single char array and storing only an index into that array.

The longest of the char arrays is the descriptions array, which is a
little over 45 KiB, so still under MSVC's 64 KiB string literal limit
[0]. Because the string length is under 64 KiB we can use uint16_t as
the index type, which roughly doubles our savings as compared to an int.

This cuts 77 KiB from iris_dri.so (0.5%) and libvulkan_intel.so (0.9%).

   text    data     bss     dec     hex filename
 926811   25920       0  952731   e899b meson-generated_.._intel_perf_metrics.c.o (before)
 924401       0       0  924401   e1af1 meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14190852 391628  210004 14792484 e1b724 iris_dri.so (before)
14137732 365708  210004 14713444 e08264 iris_dri.so (after)

   text    data     bss     dec     hex filename
8184097  240184   22820 8447101  80e47d libvulkan_intel.so (before)
8131009  214264   22820 8368093  7fafdd libvulkan_intel.so (after)

relinfo:
iris_dri.so (before): 17765 relocations, 17545 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users
iris_dri.so (after) : 15605 relocations, 15385 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users

libvulkan_intel.so (before): 10720 relocations, 6989 relative (65%), 355 PLT entries, 1 for local syms (0%), 0 users
libvulkan_intel.so (after) :  8560 relocations, 4829 relative (56%), 355 PLT entries, 1 for local syms (0%), 0 users

[0] https://docs.microsoft.com/en-us/cpp/cpp/string-and-character-literals-cpp?view=msvc-170&viewFallbackFrom=vs-2019

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner df5e743c80 intel/perf: Use slimmer intel_perf_query_counter_data struct
intel_perf_query_counter contains fields for things we can't or don't
want to store in our static data (like runtime-determined max values) or
oa_read_counter function pointers which are dependent on the GPU gen and
would make deduplication very ineffective.

Cuts 16 KiB from iris_dri.so and libvulkan_intel.so.

   text    data     bss     dec     hex filename
 926811   43200       0  970011   ecd1b meson-generated_.._intel_perf_metrics.c.o (before)
 926811   25920       0  952731   e899b meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14190852 408908  210004 14809764 e1faa4 iris_dri.so (before)
14190852 391628  210004 14792484 e1b724 iris_dri.so (after)

   text    data     bss     dec     hex filename
8184097  257464   22820 8464381  8127fd libvulkan_intel.so (before)
8184097  240184   22820 8447101  80e47d libvulkan_intel.so (after)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner bbbbb0325b intel/perf: Use a function to initialize perf counters
And specifically mark it with ATTRIBUTE_NOINLINE. Otherwise it will be
inlined and actually slightly increase code size.

Cuts 505 KiB from iris_dri.so and libvulkan_intel.so.

   text    data     bss     dec     hex filename
1538720       0       0 1538720  177aa0 meson-generated_.._intel_perf_metrics.c.o (before)
 926811   43200       0  970011   ecd1b meson-generated_.._intel_perf_metrics.c.o (after)

   text    data     bss     dec     hex filename
14751700 365708  210004 15327412 e9e0b4 iris_dri.so (before)
14190852 408908  210004 14809764 e1faa4 iris_dri.so (after)

   text    data     bss     dec     hex filename
8744913  214264   22820 8981997  890ded libvulkan_intel.so (before)
8184097  257464   22820 8464381  8127fd libvulkan_intel.so (after)

Relocations increase because the counter initializations are moved from
code (in .text) to pointers (in .text) to .rodata, which require
relocations.

relinfo:
iris_dri.so (before): 15605 relocations, 15385 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users
iris_dri.so (after) : 17765 relocations, 17545 relative (98%), 452 PLT entries, 1 for local syms (0%), 0 users

libvulkan_intel.so (before):  8560 relocations, 4829 relative (56%), 355 PLT entries, 1 for local syms (0%), 0 users
libvulkan_intel.so (after) : 10720 relocations, 6989 relative (65%), 355 PLT entries, 1 for local syms (0%), 0 users

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner 5e6c7a572e intel/perf: Deduplicate perf counters
No changes in resulting code (yes, seriously!). GCC constant propagates
the static const arrays into the code, yielding bit for bit identical
results. This will however enable further cleanups.

Before this patch, we emit 11916 different initializations of
intel_perf_query_counter. With this patch we emit an array of 539 and
initialize the intel_perf_query_counters in terms of those.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Matt Turner 3172b5bbb8 intel/perf: Don't print leading space from desc_units()
Just an annoyance I noticed when I needed to generate the description
string in two different places.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Emma Anholt 12e065ddec intel/perf: Move some static blocks of C code out of the python script.
Now my editor can help me format code as I type.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15237>
2022-03-07 21:09:54 +00:00
Dave Airlie acc2d08cf9 intel/perf: use a function to do common allocations
This cuts the compile time down for this file on my ryzen from
real	1m4.077s
to
real	0m30.827s

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14630>
2022-01-20 06:41:17 +00:00
Lionel Landwerlin d3724de894 intel/dev,perf: Use a single timescale function
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13996>
2022-01-14 20:17:44 +00:00
Lionel Landwerlin 5a2cff9bc8 intel: move timestamp scaling helper to intel/perf
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13831>
2021-11-22 11:52:46 +00:00
Lionel Landwerlin 215dbfd131 intel/perf: track end timestamp of queries
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13831>
2021-11-22 11:52:46 +00:00
Lionel Landwerlin 120f24cb36 intel/perf: add a helper to read timestamp from reports
On newer HW it will require more work than just reading a dword. It
could also vary depending on the report format.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13831>
2021-11-22 11:52:46 +00:00
Lionel Landwerlin 361b3fee3c intel: move away from booleans to identify platforms
v2: Drop changes around GFX_VERx10 == 75 (Luis)

v3: Replace
   (GFX_VERx10 < 75 && devinfo->platform != INTEL_PLATFORM_BYT)
   by
   (devinfo->platform == INTEL_PLATFORM_IVB)
   Replace
   (devinfo->ver >= 5 || devinfo->platform == INTEL_PLATFORM_G4X)
   by
   (devinfo->verx10 >= 45)
   Replace
   (devinfo->platform != INTEL_PLATFORM_G4X)
   by
   (devinfo->verx10 != 45)

v4: Fix crocus typo

v5: Rebase

v6: Add GFX3, ILK & I965 platforms (Jordan)
    Move ifdef to code expressions (Jordan)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12981>
2021-11-08 16:48:06 +00:00
Lionel Landwerlin 67619d8153 intel/perf: fix perf equation subslice mask generation for gfx12+
v2: Fix comment change (Marcin)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: <mesa-stable@lists.freedesktop.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10015>
2021-11-05 10:22:18 +00:00
Marcin Ślusarz d05f7b4a2c intel: fix INTEL_DEBUG environment variable on 32-bit systems
INTEL_DEBUG is defined (since 4015e1876a) as:

 #define INTEL_DEBUG __builtin_expect(intel_debug, 0)

which unfortunately chops off upper 32 bits from intel_debug
on platforms where sizeof(long) != sizeof(uint64_t) because
__builtin_expect is defined only for the long type.

Fix this by changing the definition of INTEL_DEBUG to be function-like
macro with "flags" argument. New definition returns 0 or 1 when
any of the flags match.

Most of the changes in this commit were generated using:
for c in `git grep INTEL_DEBUG | grep "&" | grep -v i915 | awk -F: '{print $1}' | sort | uniq`; do
    perl -pi -e "s/INTEL_DEBUG & ([A-Z0-9a-z_]+)/INTEL_DBG(\1)/" $c
    perl -pi -e "s/INTEL_DEBUG & (\([A-Z0-9_ |]+\))/INTEL_DBG\1/" $c
done
but it didn't handle all cases and required minor cleanups (like removal
of round brackets which were not needed anymore).

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13334>
2021-10-15 19:55:14 +00:00
Jason Ekstrand 279fe1ae6d intel/perf: Use a char array for OA perf query data
drm_i915_query_perf_config::data is an unsized array and declaring a
struct containing an unsized array that isn't at the end is a GNU
extension which trips up Android builds.  Instead, stuff both into a
char array of the appropriate size.  This emulates what you'd normally
do to allocate one of these with malloc only on the stack.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12308>
2021-08-11 23:57:52 +00:00
Jason Ekstrand f5008a48d3 intel/perf: Use intel_i915_query_flags instead of hand-rolling it
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11770>
2021-07-16 14:19:20 +00:00
Lionel Landwerlin 71b7c7b0dc intel/perf: use the right popcount for 64bits
We're currently using the 32bit version which is dropping half the
bits of the 64bits values.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11607>
2021-06-29 06:29:53 +00:00
Lionel Landwerlin 40eb8b7830 intel/perf: rename metric descriptions
There is an effort to drop the "Gen" prefix from much of our codebase.
This just applies this to the metrics.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10930>
2021-05-25 10:09:44 +00:00
Lionel Landwerlin 16bff57543 intel/perf: update Gen9/11 programming for AsyncCompute
Adding a register, similar to what was done for RenderBasic.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10930>
2021-05-25 10:09:44 +00:00
Lionel Landwerlin 290f5a0156 intel/perf: add EHL availability condition to HDCAndSF counters
The availability of those counters depends on the topology.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10930>
2021-05-25 10:09:44 +00:00
Lionel Landwerlin 6ed558f8ca intel/perf: update Gen11 RenderBasic programming
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10930>
2021-05-25 10:09:44 +00:00
Lionel Landwerlin 6f9dcb05ff intel/perf: update Gen11 RenderBasic programming
Simple order change.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10930>
2021-05-25 10:09:44 +00:00
Lionel Landwerlin 16e344bc79 intel/perf: update gen9/11 TestOa configs
Programming an additional FLEX register.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10930>
2021-05-25 10:09:44 +00:00
Lionel Landwerlin 5d95aa3964 intel/perf: allow metric sets to be loaded with on OA reports
A bunch of performance counters rely on register snapshots on top of
the OA reports. Those are already conditional to the query mode in the
equations :

   availability="true $QueryMode &amp;&amp;"

This change allows to disable counters that are only available with
additional register snapshots. This will be useful if you only want to
OA reports to extract performance counter values.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10216>
2021-05-18 14:28:48 +00:00
Lionel Landwerlin fba189a349 intel/perf: allow opening perf stream with no context filtering
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10216>
2021-05-18 14:28:48 +00:00
Antonio Caggiano b18a4bb8c6 intel/perf: Extern C
Allow libintel_perf to be included as a dependency from a C++ project by
wrapping some declaration within an extern "C" block, and then add a
function to allow direct reading of the OA stream.

v2: Don't expose internal helpers (Lionel)

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10216>
2021-05-18 14:28:48 +00:00
Marcin Ślusarz a53d5753fd intel/perf: move calculation of period_exponent to perf ctx init
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/9922>
2021-04-22 10:59:12 +00:00
Anuj Phogat f36efe5e7b intel: Rename _gen_{program, part, batch, freq} to _intel_{..}
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965
grep -E "[[:alnum:]]_gen_" -rIl $SEARCH_PATH | xargs sed -ie "s/_gen_\(program\|part\|batch\|freq\)/_intel_\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
2021-04-20 20:06:34 +00:00
Anuj Phogat 5d7e7545ac intel: Rename gen_{pipeline, oa, counter, hw} to intel_{..}
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965
grep -E "gen_" -rIl $SEARCH_PATH | xargs sed -ie "s/gen_\(pipeline\|oa\|counter\|hw\)/intel_\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
2021-04-20 20:06:34 +00:00
Anuj Phogat b2ef2948a0 intel: Rename GEN_PERF prefix to INTEL_PERF in source files
export': export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965
grep -E "GEN_PERF" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN_PERF/INTEL_PERF/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
2021-04-20 20:06:34 +00:00
Anuj Phogat 5b4ef7815e intel: Fix alignment and line wrapping due to gen_perf renaming
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
2021-04-20 20:06:34 +00:00
Anuj Phogat bbe81292c6 intel: Rename gen_perf prefix to intel_perf in source files
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965
grep -E "gen_perf" -rIl $SEARCH_PATH | xargs sed -ie "s/gen_perf\([^\.]\)/intel_perf\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
2021-04-20 20:06:34 +00:00
Anuj Phogat e6e79436af intel: Rename gen_perf prefix in filenames to intel_perf
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965
find $SEARCH_PATH -type f -name "*gen_perf*[cph]" -exec sh -c 'f="{}"; mv -- "$f" "${f/gen_perf/intel_perf}"' \;
grep -E "GEN_PERF[[:alnum:]_]*_H( |$)" -rIl $SEARCH_PATH | xargs sed -ie "s/GEN_PERF\([[:alnum:]_]*_H\)\( \|$\)/INTEL_PERF\1\2/g"
grep -E "gen_perf" -rIl $SEARCH_PATH | xargs sed -ie "s/gen_perf\([[:alnum:]_]*\.[ch]\)/intel_perf\1/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
2021-04-20 20:06:34 +00:00
Anuj Phogat 61e8636557 intel: Rename gen_device prefix to intel_device
export SEARCH_PATH="src/intel src/gallium/drivers/iris src/mesa/drivers/dri/i965"
grep -E "gen_device" -rIl $SEARCH_PATH | xargs sed -ie "s/gen_device/intel_device/g"

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10241>
2021-04-20 20:06:33 +00:00