Commit Graph

9 Commits

Author SHA1 Message Date
Alyssa Rosenzweig 0afd691f29 panfrost: clang-format the tree
This switches us over to Mesa's code style [1], normalizing us within the tree.
The results aren't perfect, but they bring us a hell of a lot closer to the rest
of the tree. Panfrost doesn't feel so foreign relative to Mesa with this, which
I think (in retrospect after a bunch of years of being "different") is the right
call.

I skipped PanVK because that's paused right now.

  find panfrost/ -type f -name '*.h' | grep -v vulkan | xargs clang-format -i;
  find panfrost/ -type f -name '*.c' | grep -v vulkan | xargs clang-format -i;
  clang-format -i gallium/drivers/panfrost/*.c gallium/drivers/panfrost/*.h ; find
  panfrost/ -type f -name '*.cpp' | grep -v vulkan | xargs clang-format -i

[1] https://docs.mesa3d.org/codingstyle.html

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20425>
2022-12-24 02:22:57 +00:00
Alyssa Rosenzweig 6f3eea5ddb panfrost: Separate core ID range from core count
To query the core count, the hardware has a SHADERS_PRESENT register containing
a mask of shader cores connected. The core count equals the number of 1-bits,
regardless of placement. This value is useful for public consumption (like
in clinfo).

However, internally we are interested in the range of core IDs.
We usually query core count to determine how many cores to allocate various
per-core buffers for (performance counters, occlusion queries, and the stack).
In each case, the hardware writes at the index of its core ID, so we have to
allocate enough for entire range of core IDs. If the core mask is
discontiguous, this necessarily overallocates.

Rename the existing core_count to core_id_range, better reflecting its
definition and purpose, and repurpose core_count for the actual core count.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17265>
2022-07-08 01:14:55 +00:00
Alyssa Rosenzweig 10a2406232 pan/perf: Fix performance counters on G57
The performance counter layout depends on the number of L2 blocks and the number
of shader cores. It doesn't make a ton of sense to hardcode these into the XML
files. Instead, let's make the coutner offsets in the XML files relative to the
categories (blocks), so we can calculate the offsets of the categories
themselves at runtime based on the computed layout. This fixes performance
counters on Mali-G57 as implemented on MT8192.

There is little code change here, mainly churn from changing the XML definition.
Postprocessing for the XML to make it suitable for Mesa uses Antonio Caggiano's
https://gitlab.freedesktop.org/panfrost/hwc-helper tool.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16803>
2022-06-08 13:57:18 +00:00
Alyssa Rosenzweig 94bb229c46 panfrost: Get performance counters from table
Avoids yet another open-coded list of GPU IDs.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14726>
2022-01-28 17:47:46 +00:00
Carsten Haitzler b22294f6d5 panfrost: Add GPU G76 to the set of known ids
This is another working GPU so add the ID to the known set. Working on
real silicon and tested.

Signed-off-by: Carsten Haitzler <carsten.haitzler@foss.arm.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14517>
2022-01-13 14:59:48 +00:00
Icecream95 48af341b36 panfrost: Fix GPU ID for t76x in get_perf_config
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11824>
2021-07-12 09:07:48 +00:00
Alyssa Rosenzweig c20dde5179 panfrost: Add a performance counter dump utility
This uses Antonio's src/panfrost/perf for all the heavylifting, just
like the Perfetto producer. Unlike the Perfetto producer, it has no
dependencies and is a lot less useful. But it's a good smoke test.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11733>
2021-07-09 23:15:28 +00:00
Antonio Caggiano 5e88a1caca panfrost: Performance configuration
Configure a panfrost performance structure with tables of categories and
counters for the current product id. An array for storing counter values
read from the GPU is also managed by this structure. A generic read
function can be used to retrieve the value of a counter from the conter
values array.

v2: Generate tables instead of calling register functions.
v3: Simplify counter read function and `pan_gen_perf.py` write method.
v4: Accumulate counter values from all cores.
v5: Wrap `STATIC_ASSERT`s within unused functions.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10844>
2021-05-27 13:24:54 +00:00
Antonio Caggiano fece367e9e panfrost: Counter definitions
Add Mali events XML files generated with Panfrost HWC helper.
https://gitlab.freedesktop.org/fahien/panfrost-hwc-helper/

v2: Restore license headers.
v3: Fix shader core and memory system counter offsets.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10844>
2021-05-27 13:24:54 +00:00