panfrost: Add panfrost_query_l2_slices helper
The number of L2 performance counter blocks equals the number of L2 slices, so add a query to get this. This information isn't needed by the Mesa driver, so don't get it in the default device initialization path. 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>
This commit is contained in:
committed by
Marge Bot
parent
58b408611f
commit
0ecbfcc892
@@ -272,6 +272,9 @@ panfrost_query_sample_position(
|
||||
unsigned sample_idx,
|
||||
float *out);
|
||||
|
||||
unsigned
|
||||
panfrost_query_l2_slices(const struct panfrost_device *dev);
|
||||
|
||||
static inline struct panfrost_bo *
|
||||
pan_lookup_bo(struct panfrost_device *dev, uint32_t gem_handle)
|
||||
{
|
||||
|
||||
@@ -125,6 +125,18 @@ panfrost_query_gpu_revision(int fd)
|
||||
return panfrost_query_raw(fd, DRM_PANFROST_PARAM_GPU_REVISION, true, 0);
|
||||
}
|
||||
|
||||
unsigned
|
||||
panfrost_query_l2_slices(const struct panfrost_device *dev)
|
||||
{
|
||||
/* Query MEM_FEATURES register */
|
||||
uint32_t mem_features =
|
||||
panfrost_query_raw(dev->fd, DRM_PANFROST_PARAM_MEM_FEATURES,
|
||||
true, 0);
|
||||
|
||||
/* L2_SLICES is MEM_FEATURES[11:8] minus(1) */
|
||||
return ((mem_features >> 8) & 0xF) + 1;
|
||||
}
|
||||
|
||||
static struct panfrost_tiler_features
|
||||
panfrost_query_tiler_features(int fd)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user