Commit Graph

18 Commits

Author SHA1 Message Date
Emma Anholt 64455dc32b freedreno/pps: Fix a signed/unsigned complaint.
../src/freedreno/ds/fd_pps_driver.cc:656:44: error: comparison of integer expressions of different signedness: '__gnu_cxx::__alloc_traits<std::allocator<int>, int>::value_type' {aka 'int'} and 'const unsigned int' [-Werror=sign-compare]
  656 |             assert(d->assigned_counters[i] < g->num_counters);
cc1plus: all warnings being treated as errors

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20660>
2023-01-18 05:04:46 +00:00
Rob Clark 48b5164356 freedreno/drm: Return fence from submit flush
This moves away from embedding the submit fence inside the pipe fence,
which lets us start refcnt'ing the fence.  This will enable several
cleanups and improvements:

1. Get rid of fd_bo_fence, and just have fd_bo hold pending fd_fence
   refs instead, which will be needed for cpu_prep implementation of
   sub-allocated buffers.
2. For merged submits, we can just return a new reference to an
   existing fence.

Note that this temporarily defeats submit-merging, which will be
fixed (and improved) in a following commit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Rob Clark c1a621813b freedreno/drm: Combine fd_fence and fd_submit_fence
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20263>
2022-12-17 19:14:12 +00:00
Chia-I Wu 339d80d5f2 pps: make pps-producer RT only on freedreno
Calling sched_setscheduler twice every sample period has high CPU
overhead.  For intel and panfrost, their dump_perfcnt is preemptible and
they don't need the scheduler change.

For freedreno, simply makes the main thread RT at all time.  This solves
most of the cpu overhead issue.

v2: removed pthread_t param and just change the scheduler for the
    calling thread

Acked-by: Rob Clark <robdclark@chromium.org> (v1)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19668>
2022-11-15 21:21:42 +00:00
Chia-I Wu 05a4d3f380 freedreno/pps: loop countables by references
Mainly to get rid of alloc/free in collect_countables.  Sampling at 1ms,
perf becomes

   - 22.75% pps::FreedrenoDriver::collect_countables
           22.59% pps::FreedrenoDriver::Countable::collect

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19427>
2022-11-01 20:22:36 +00:00
Chia-I Wu 86553cd771 freedreno/pps: use 64-bit reads when possible
It is always possible on a5xx+ and allows Countable::collect to do 1 ldr rather
than 2.

Sampling at 1ms, perf goes from

   - 34.44% pps::FreedrenoDriver::collect_countables
        25.36% pps::FreedrenoDriver::Countable::collect
        3.92% cfree
      + 2.28% operator new

to

   - 29.60% pps::FreedrenoDriver::collect_countables
        20.70% pps::FreedrenoDriver::Countable::collect
        4.01% cfree
      + 2.35% operator new
        1.09% memcpy

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19427>
2022-11-01 20:22:36 +00:00
Eric Engestrom c66622de3a meson: replace manual compiler flags with meson arguments
These would only have worked in GCC and Clang, which so far wasn't an
issue, but let's clean it up anyway.

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18190>
2022-08-24 22:13:19 +00:00
Chia-I Wu c625d99403 freedreno/pps: improve interaction with turnip
turnip uses priority 0.  pps should too (actually, it makes sense to do
so regardless of what turnip does).

turnip is not expected to starve pps, but it does with drm-next for
5.20.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18093>
2022-08-19 17:51:43 +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
Danylo Piliaiev b84f059680 freedreno/pps: Expose same counters as blob
Expose most of the counters exposed by blob. By faking the value of
counters returned from kgsl I found the exact underlying counters and
constant coefficients being used.

Note, coefficients for counters that depend on time are NOT verified.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14323>
2022-02-10 15:15:33 +00:00
Lionel Landwerlin 8657fa6b86 pps: allow drivers to report timestamps in their own time domain
For this each driver must :

  - report its clock_id (if no particular clock just default to cpu
    boottime one)

  - be able to sample its clock (gpu_timestamp())

The PPSDataSource will then emit timestamp correlation events in the
trace ensuring perfetto is able to display GPU & CPU events
appropriately on its timeline.

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
Vinson Lee c30fb8ee4d freedreno: Add valgrind dependency.
Fix a build error.

In file included from ../src/util/u_queue.h:38,
                 from ../src/freedreno/drm/freedreno_ringbuffer.h:33,
                 from ../src/freedreno/ds/fd_pps_driver.h:13,
                 from ../src/freedreno/ds/fd_pps_driver.cc:7:
../src/util/simple_mtx.h:35:12: fatal error: valgrind.h: No such file or directory
   35 | #  include <valgrind.h>
      |            ^~~~~~~~~~~~

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13280>
2021-10-11 19:20:23 +00: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 78c8a8af80 freedreno: Generate device-info tables at build time
This way we can make the tables const.  At the same time, for a6xx, this
introduces a "sub-generation template" to reduce the copy/paste for
parameters which are keyed to the sub-generation.  It also explicitly
lists every supported GPU, to get rid of duplicate lists of supported
gpus between the device-info and drivers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark 0eda0188aa freedreno: Rename *_dev_info
Everywhere else symbols/types/etc are shortend to "fd_*", so lets do the
same here for consistency.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>
2021-07-14 01:58:00 +00:00
Rob Clark 3a772be026 freedreno: Add perfetto renderpass support
Add a custom DataSource to provide trace events for render stages.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>
2021-05-10 15:34:07 +00:00
Rob Clark 133a3e4dd3 freedreno/pps: Detect GPU suspend on newer kernels
We can avoid re-sending the configuration cmdstream constantly if we
know the device has not suspended since the last sampling period.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>
2021-05-10 15:34:07 +00:00
Rob Clark 3e13e45467 freedreno: Add freedreno pps driver
Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9901>
2021-05-10 15:34:07 +00:00