Commit Graph

45 Commits

Author SHA1 Message Date
Chia-I Wu e9e8c649cd freedreno/fdperf: support dumping counters
This is useful for comparing two workloads.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16488>
2022-05-14 22:18:52 +00:00
Chia-I Wu 267786be60 freedreno/fdperf: make refresh rate configurable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16488>
2022-05-14 22:18:52 +00:00
Rob Clark 9ea36968d3 freedreno/drm: Add fd_device_open() helper
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14900>
2022-03-25 02:03:30 +00:00
Rob Clark e9cd4fba6f freedreno/perfetto+fdperf: Set SYSPROF param
No need to check error return and deal with older kernels.  Older
kernels won't have this param but their default behavior allows for
systemwide perfcntr collection.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15236>
2022-03-04 16:06:34 -08:00
Rob Clark 7806843866 freedreno/all: Introduce fd_dev_id
Move away from using gpu_id as the primary means to identify which
adreno we are running on, as future GPUs (starting with 7c3) stop
providing a gpu_id as a new naming scheme is introduced.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12159>
2021-08-06 18:51:50 +00:00
Rob Clark 3f758afe6a freedreno: Fix fdperf flush
We created and initialized the fence, but forgot to pass it to
fd_submit_flush().

Fixes: aafcd8aacb ("freedreno: Re-work fd_submit fence interface")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11200>
2021-06-09 19:08:53 -07:00
Rob Clark b447db41fc freedreno/tools: Fix async flush vs fdperf/computerator
They need to wait on the ready fence to ensure the submit has been
flushed to the kernel.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10626>
2021-05-05 20:32:31 +00:00
Rob Clark aafcd8aacb freedreno: Re-work fd_submit fence interface
Move everything into a struct assocated with the pipe_fence_handle, so
that the drm layer can fill in the seqn/fd fences directly.

This will give us a comvenient place to insert a util_queue_fence in the
next commit.

While we're at it, extract the uint32_t fence (previously called
'timestamp' in place, a kgsl legacy) into a struct that encapsulates
both the kernel fence and the userspace fence.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10444>
2021-04-28 15:36:42 +00:00
Rob Clark 6050976232 freedreno/perfcntrs: Re-indent
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10293>
2021-04-17 15:38:56 +00:00
Vinson Lee a5d5cbdf08 freedreno: Fix file descriptor leak.
Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_handle: Handle variable fd going out of scope leaks the handle.

Fixes: 5a13507164 ("freedreno/perfcntrs: add fdperf")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9889>
2021-03-29 17:08:56 +00:00
Rob Clark e7202e889b freedreno: Split out devicetree helpers
The freedreno pps datasource is going to need the same, so split out
helpers that can be re-used.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9758>
2021-03-22 20:46:17 +00:00
Rob Clark 9479ae9761 freedreno/fdperf: Use os_read_file()
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9758>
2021-03-22 20:46:17 +00:00
Rob Clark 5871f4177c freedreno: Make headers C++ happy
We'll need a few of these for the C++ based gfx-pps performance counter
collector datasource.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9758>
2021-03-22 20:46:17 +00:00
Jonathan Marek b15d4484f8 freedreno/a6xx: update perfcntr registers (declare as arrays)
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8423>
2021-02-19 04:04:02 +00:00
Joel Linn 5939a64b15 freedreno/a2xx: add RB perfcounter 1-3
Xenos driver reads four perf counters in total.

v2: fix register names

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7666>
2021-01-16 19:10:22 +00:00
Joel Linn 040ffee71f freedreno/a2xx: fix/add RBBM perfcounter
Xenos driver read two perf counters and their order is also different.

v2: fix typo in register address

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7666>
2021-01-16 19:10:22 +00:00
Eric Anholt 9b156ef57b freedreno/fdperf: Silence a compiler warning about current counter.
It seems like selecting the first here is a fine choice if we can't
find the counter.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Eric Anholt a512e9eecd freedreno/tools: Fix compiler warnings about using sz in the error paths.
If we don't check for a NULL str, then sz might be undefined (as was
happening in the match_compatible path, and returning 0 makes us not match
as we should).

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7224>
2020-10-20 22:16:59 +00:00
Marek Olšák f5f0c012ad gallium/util: remove empty file u_half.h
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6987>
2020-10-06 21:07:11 -04:00
Matt Turner 1aac47db69 Revert F16C series (MR 6774)
This reverts commit 4fb2eddfdf.
This reverts commit 7a1deb16f8.
This reverts commit 2b6a172343.
This reverts commit 5af81393e4.
This reverts commit 87900afe5b.

A couple of problems were discovered after this series was merged that
cause breakage in different configurations:

   (1) It seems that using -mf16c also enables AVX, leading to SIGILL on
   platforms that do not support AVX.
   (2) Since clang only warns about unknown flags, and as I understand
   it Meson's handling in cc.has_argument() is broken, the F16C code is
   wrongly enabled when clang is used, even for example on ARM, leading
   to a compilation error.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3583
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6969>
2020-10-01 21:08:12 +00:00
Marek Olšák 4fb2eddfdf gallium/util: remove empty file u_half.h
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6774>
2020-09-30 16:28:24 +00:00
Connor Abbott c1ba7612fb freedreno: Include adreno_pm4.xml.h before adreno_a6xx.xml.h
This matches the XML, and soon adreno_a6xx.xml will start including
types from adreno_pm4.xml.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5557>
2020-07-07 09:51:40 +00:00
Rob Clark 0a7b1f9167 freedreno/fdperf: prefer render node
Avoid inadvertantly becoming master if fdperf happens to be the first
thing to open the device.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5762>
2020-07-06 15:08:15 +00:00
Rob Clark 385d036f58 freedreno/fdperf: better compatible string matching
Previously we would match the start of the compatible string, in
a couple of cases, in order to match compatible strings like
"qcom,adreno-630.2".  But these cases would always list a more
generic compatible (ie. "qcom,adreno") as a later choice.  So if
we parse all the compatible strings, we can do a more precise
exact match.

This avoids us accidentially matching on "qcom,adreno-smmu" and
the hilarity that ensues.

Fixes: 5a13507164 ("freedreno/perfcntrs: add fdperf")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5762>
2020-07-06 15:08:15 +00:00
Rob Clark 9c34a3322d freedreno/fdperf: fix print of base address
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5762>
2020-07-06 15:08:15 +00:00
Dylan Baker a8e2d79e02 meson: use gnu_symbol_visibility argument
This uses a meson builtin to handle -fvisibility=hidden. This is nice
because we don't need to track which languages are used, if C++ is
suddenly added meson just does the right thing.

Acked-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4740>
2020-06-01 18:59:18 +00:00
Hanno Böck be71e2fd08 Properly check mmap return value
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5150>
2020-05-22 17:15:30 +00:00
Rob Clark 5e10506834 freedreno/fdperf: add dependency on generated headers
To fix an issue reported here:
https://bugs.chromium.org/p/chromium/issues/detail?id=1083815

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5088>
2020-05-18 17:53:45 +00:00
Eric Anholt 6c688ae81f freedreno: Deduplicate ringbuffer macros with computerator/fdperf
They're sugar around freedreno_ringbuffer.h, so put them there and reuse them.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4957>
2020-05-08 12:35:38 -07:00
Eric Engestrom 79af30768d meson: inline `inc_common`
Let's make it clear what includes are being added everywhere, so that
they can be cleaned up.

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4360>
2020-03-28 21:36:54 +01:00
Rob Clark ba03e308b6 freedreno/fdperf: set locale
Set local to get numbers printed w/ commas.. much easier to read that
way.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4119>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4119>
2020-03-10 16:52:02 +00:00
Eric Engestrom cae6093266 freedreno/perfcntrs: fix fd leak
CoverityID: 1110568, 1458071
Fixes: 5a13507164 ("freedreno/perfcntrs: add fdperf")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3671>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3671>
2020-02-04 19:26:40 +00:00
Kristian H. Kristensen 67dd51606c freedreno/fdperf: Cast away some ignored return values
This is developer tool, it can crash and burn if it fails to allocate.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3686>
2020-02-04 06:03:52 +00:00
Kristian H. Kristensen b6f8c42846 freedreno/a6xx: Silence warning for unused perf counters
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Signed-off-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-12-11 22:25:47 +00:00
Rob Clark dc791d3c68 freedreno/fdperf: use drmOpen()
Signed-off-by: Rob Clark <robdclark@chromium.org>
2019-12-09 13:09:58 -08:00
Jonathan Marek 080c92e7d4 freedreno/perfcntrs/fdperf: add missing a2xx case in select_counter
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@chromium.org>
2019-11-27 12:11:57 -05:00
Jonathan Marek 98d7125b36 freedreno/perfcntrs/fdperf: add missing a20x compatible
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@chromium.org>
2019-11-27 12:11:57 -05:00
Jonathan Marek 24cde37e8d freedreno/perfcntrs/fdperf: fix u64 print on 32-bit builds
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@chromium.org>
2019-11-27 12:11:57 -05:00
Jonathan Marek baab4017b9 freedreno/perfcntrs: add a2xx MH counters
Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Reviewed-by: Rob Clark <robdclark@chromium.org>
2019-11-27 12:11:57 -05:00
Rob Clark 1a8c49d76c freedreno/perfctrs/fdperf: periodically restore counters
When GPU is idle and suspends, the currently selected countables
will all reset to the first one.  So periodically restore the selected
countables.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-11-21 20:01:03 +00:00
Rob Clark 5a13507164 freedreno/perfcntrs: add fdperf
Port from the envytools tree, but converted to use the .c tables for
describing the perfcounter groups/countables, rather than using rnndec
to get this at runtime from the register xml.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-11-21 20:01:03 +00:00
Rob Clark b2338a5b00 freedreno/perfcntrs/a6xx: remove RBBM counters
Currently this are getting blocked by the kernel.. these counters don't
seem to be the most useful ones, and to use them we'd have to somehow
probe the kernel by submitting cmdstream to write the selector regs and
see if that triggers a GPU fault.  So let's just skip them.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-11-21 20:01:03 +00:00
Rob Clark 6a517b3079 freedreno/perfctrs/a2xx: move CP to be first group
fdperf expects this, to find the ALWAYS_COUNT counter

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-11-21 20:01:03 +00:00
Rob Clark e35c4e6ad2 freedreno/perfcntrs: add accessor to get per-gen tables
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-11-21 20:01:03 +00:00
Rob Clark b21f03ae7e freedreno/perfcntrs: move to shared location
This should eventually be useful for VK_KHR_performance_query as well.
And in the more near term, for fdperf.

Attempt to not break android build is best-effort and untested.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-11-21 20:01:03 +00:00