summaryrefslogtreecommitdiff
path: root/mali_pixel/memory_group_manager.c
diff options
context:
space:
mode:
authorJack Diver <diverj@google.com>2023-04-03 09:34:27 +0000
committerJack Diver <diverj@google.com>2023-04-06 10:24:02 +0000
commitfa975a87f7d9831c5f37eb77da7b51af0c68eb2c (patch)
treedd86beb7406447d586bc6006e027b01055f9eeca /mali_pixel/memory_group_manager.c
parentbd8eda43700d4789a42881c5483544a4b403c4a6 (diff)
downloadgpu-fa975a87f7d9831c5f37eb77da7b51af0c68eb2c.tar.gz
mali_pixel: mgm: Get accurate size from slc pt mutate
Bug: 264990406 Test: Boot to home Test: gfx-bench mh3.1 Change-Id: Icce0f68a07f33ec8cd9f85ae7d0436ab58891adb Signed-off-by: Jack Diver <diverj@google.com>
Diffstat (limited to 'mali_pixel/memory_group_manager.c')
-rw-r--r--mali_pixel/memory_group_manager.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/mali_pixel/memory_group_manager.c b/mali_pixel/memory_group_manager.c
index 0f38f07..711b280 100644
--- a/mali_pixel/memory_group_manager.c
+++ b/mali_pixel/memory_group_manager.c
@@ -485,6 +485,7 @@ static void set_group_partition(struct mgm_groups* data,
int new_pt_index)
{
int ptid, pbha;
+ size_t size = 0;
int const active_idx = group_active_pt_id(data, group_id);
int const new_idx = group_pt_id(data, group_id, new_pt_index);
@@ -492,12 +493,21 @@ static void set_group_partition(struct mgm_groups* data,
if (new_idx == active_idx)
return;
- ptid = pt_client_mutate(data->pt_handle, active_idx, new_idx);
+ /* Set the size to a known sentinel value so that we can later detect an update */
+ atomic64_set(&data->pt_stats[new_idx].size, MGM_SENTINEL_PT_SIZE);
+
+ ptid = pt_client_mutate_size(data->pt_handle, active_idx, new_idx, &size);
if (ptid == -EINVAL)
dev_err(data->dev, "Failed to get partition for group: %d\n", group_id);
else
dev_info(data->dev, "pt_client_mutate returned ptid=%d for group=%d", ptid, group_id);
+ /* The resize callback may have already been executed, which would have set
+ * the correct size. Only update the size if this has not happened.
+ * We can tell that no resize took place if the size is still sentinel.
+ */
+ atomic64_cmpxchg(&data->pt_stats[new_idx].size, MGM_SENTINEL_PT_SIZE, size);
+
pbha = pt_pbha(data->dev->of_node, new_idx);
if (pbha == PT_PBHA_INVALID)
dev_err(data->dev, "Failed to get PBHA for group: %d\n", group_id);