summaryrefslogtreecommitdiff
path: root/mali_pixel/memory_group_manager.c
AgeCommit message (Collapse)Author
2024-01-05Merge branch 'upstream' into HEADVamsidhar reddy Gaddam
Update KMD to R47P0 Bug: 315267052 Test: Outlined in go/pixel-gpu-kmd-r47p0 Change-Id: I89454c4c862033fe330b260a9bc6cc777a3ca231 Signed-off-by: Vamsidhar reddy Gaddam <gvamsi@google.com>
2023-11-22Fix kernel build warningsVamsidhar reddy Gaddam
Address kernel-doc warnings in pixel gpu components Bug: 302343291 Test: Local build Change-Id: Ia5a654f5acd1c6ee5245472792553d0d2e2d9e49 Signed-off-by: Vamsidhar reddy Gaddam <gvamsi@google.com>
2023-08-22mali_pixel: Disable mgm debugfs by defaultJack Diver
Implicit SLC caching results in a high volume of PTE updates. Tracking the number of updates shows up when profiling. Disable these nodes and the associated tracking by default. Bug: 294167925 Test: gfxbench sweep, genshin (cherry picked from https://partner-android-review.googlesource.com/q/commit:82d0547845919e91b27196dccc0202fe7e7e40de) Merged-In: I551b8f58f633ba6cfb74b0651bbbe30a6909eeb2 Change-Id: I551b8f58f633ba6cfb74b0651bbbe30a6909eeb2 Signed-off-by: Jack Diver <diverj@google.com>
2023-08-21mali_pixel: mgm: Compensate for group migrationJack Diver
Pages in the SLC group were often 'migrated' there from the reserved group. This leads to unbalanced accounting as at alloc time the reserved group counter is incremented, but at free time the SLC group counter is decremented. Add custom logic to detect this, but plan to remove it soon when memory groups are decoupled from SLC partitions (b/290354607). Bug: 289501175 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:7bb27d3d29f850315d0b7ee103fbdfe75e9403da) Merged-In: Ia878a05c4d8dd7db7969f7089c6b93bf90c17f8e Change-Id: Ia878a05c4d8dd7db7969f7089c6b93bf90c17f8e
2023-08-21mali_pixel: mgm: Remove race conditionJack Diver
Remove window where mismanagement of counters could be missed. Bug: 289501175 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:b6b86cbf708df94173f9a5152229a39c043e8909) Merged-In: I6d17726667c2d1fda4cd928e10d5143405ecd38f Change-Id: I6d17726667c2d1fda4cd928e10d5143405ecd38f
2023-08-21mali_pixel: mgm: Refactor update_sizeJack Diver
Bug: 289501175 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:252edb03c91ebb738377caf5fe0c4cef52c36fb1) Merged-In: Ib66717ef8acc13ede87b4e324fdc3489c119865f Change-Id: Ib66717ef8acc13ede87b4e324fdc3489c119865f
2023-06-06mali_pixel: mgm: Ensure partition size is set to 0 when disabled.android-u-beta-4_r0.7android-u-beta-4_r0.5android-u-beta-4_r0.1android-gs-tangorpro-5.10-u-beta4android-gs-raviole-5.10-u-beta4android-gs-bluejay-5.10-u-beta4Aleks Todorov
pt_size_init ignores size update unless the size is invalidated, therefore invalidate the size before resetting the partition to size 0 when disabling it. Before this change startup logs are as follows: [ 2.648001] google,slc-acpm slc-acpm: ptid 3 size 0K [ 2.648164] mali-mgm physical-memory-group-manager: pt_size_init: tried to set size to 0 and got 262144 After this change startup logs are as follows: [ 2.625674] google,slc-acpm slc-acpm: ptid 3 size 0K [ 2.625852] mali-mgm physical-memory-group-manager: pt_size_invalidate: set size to sentinel (18446744073709551615) [ 2.626263] mali-mgm physical-memory-group-manager: pt_size_init: tried to set size to 0 and got 0 Bug: 284108328 Test: ./build_slider.sh Test: ./build_cloudripper.sh Test: boot to home Change-Id: Iaf506c4a148c215ed94b7a5af469dc73cf482b67 Merged-In: Iaf506c4a148c215ed94b7a5af469dc73cf482b67 Signed-off-by: Aleks Todorov <aleksbgbg@google.com>
2023-04-25platform: Fix mgm_term_data behaviorJack Diver
pt_client_free expects a partition index rather than the allocated ptid. Currently enabled partitions should be disabled rather than freed, freeing the ptid of an enabled partition is a bug. Bug: 279416508 Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:e74cbbaef43c1445cb474c2b2fd0cbab785a5858) Merged-In: Ib90ebc6e90a9a213d78b8983ca01b00cd81fb5b9 Change-Id: Ib90ebc6e90a9a213d78b8983ca01b00cd81fb5b9
2023-04-25platform: Disable the GPU SLC partition when not in demandJack Diver
Bug: 277936698 Test: gfx-bench shmoo Signed-off-by: Jack Diver <diverj@google.com> (cherry picked from https://partner-android-review.googlesource.com/q/commit:1f65451f5891d8053975405b60ac364ed96aa148) Merged-In: Id83704cffde39a279e91eb19b1ae5a4a130992e0 Change-Id: Id83704cffde39a279e91eb19b1ae5a4a130992e0
2023-04-06mali_pixel: mgm: Factor out common code between enabling/mutating partitionsJack Diver
Bug: 264990406 Test: Boot to home Test: gfx-bench shmoo Change-Id: I502031f0f5ade7053c487f4c50981c1c05eea7d4 Signed-off-by: Jack Diver <diverj@google.com>
2023-04-06mali_pixel: mgm: Get accurate size from slc pt mutateJack Diver
Bug: 264990406 Test: Boot to home Test: gfx-bench mh3.1 Change-Id: Icce0f68a07f33ec8cd9f85ae7d0436ab58891adb Signed-off-by: Jack Diver <diverj@google.com>
2023-04-06mali_kbase: platform: mgm: Get accurate SLC partition sizeJack Diver
Use mgm_resize_callback to update memory group size. Add entry point allowing memory group size to be queried. Bug: 264990406 Test: Boot to home Test: gfx-bench mh3.1 Change-Id: I80f595724c7418b97e07679719d2b76e4ee7b96f Signed-off-by: Jack Diver <diverj@google.com>
2023-03-23mali_pixel: Fix PBHA bit pos for ZUMA and PROJack Diver
Bug: 264990406 Test: Boot to home Test: gfx-bench mh3.1 Change-Id: Idf55ce127b1c5ddfebb2db3cff1c74dce5530aad Signed-off-by: Jack Diver <diverj@google.com>
2023-03-23mali_pixel: Enable MGM_SLC_GROUP_ID by default.Jack Diver
The platform integration will assume that an SLC memory group is available, so we need to enable the group by default. Bug: 264990406 Test: Build mali_kbase, mali_pixel Test: Boot to home Change-Id: If799875885600cdeb156fbd89a6efc43a131ac8e Signed-off-by: Jack Diver <diverj@google.com>
2023-03-23mali_pixel: Add entry point for resizing a memory groupJack Diver
Add a backdoor entry point to allow the mali_kbase platform integration to resize the GPU SLC memory group, by mutating the underlying partition. Bug: 264990406 Test: Build mali_kbase, mali_pixel Test: Boot to home Change-Id: I8f933625b040d419b9e5676976ea3cf9cde87cec Signed-off-by: Jack Diver <diverj@google.com>
2023-03-23mali_pixel: Add support for multi-partition groups.Jack Diver
The only way to 'resize' an SLC partition, is to mutate it using another partition. To support this in the memory group manager, we need to support multiple possible partitions per memory group, with a single active partition that can be mutated. Bug: 264990406 Test: Build mali_kbase, mali_pixel Test: Boot to home Change-Id: Ic9cb905405f82d4bdc86de5776b67c86a0b94b80 Signed-off-by: Jack Diver <diverj@google.com>
2022-11-07Revert "Revert "Merge r38p1 from upstream into ↵Jack Diver
partner/android13-gs-pixel-5.10-tm-qpr2"" This reverts commit 34e635317dc2a91076ac341df3867ac3bdb31ef1. Bug: 228779790 Change-Id: Ica7fbc34d4c725f36a302ae9723606dcf828c452
2022-10-07mali_kbase: MIDCET-4220 Patch for GPUSWERRATA-1420Suzanne Candanedo
This patch is a fix for: - SW Errata: 2712858 - CVE: CVE-2022-36449 It excludes MMU dumping and invalidates PGD before free. For this fix to work, GPUCORE-32152 is needed which adds hooks for physical address translation. Bug: 251397485 Provenance: https://code.ipdelivery.arm.com/c/GPU/mali-ddk/+/4607/1 Signed-off-by: Jack Diver <diverj@google.com> Change-Id: I9d3718b57199b7e66a5b49730ac32c810a1fc9c9
2021-11-25Merge android13-gs-pixel-5.10-gs101 into android13-gs-pixel-5.10Alex Hong
Bug: 199698959 Change-Id: I3ca3b85eb2145b11b9f0384995753daf76030568 Signed-off-by: Alex Hong <rurumihong@google.com>
2021-11-11Don't use more memory groups than declaredandroid-12.0.0_r0.42android-12.0.0_r0.36android-12.0.0_r0.26android-gs-raviole-5.10-android12-qpr1-dSean Callanan
The number of usable memory groups is limited by the constant limit MEMORY_GROUP_MANAGER_NR_GROUPS but also by the number of groups actually declared. Check both limits during allocation. Bug: 201677538 Signed-off-by: Sean Callanan <spyffe@google.com> Change-Id: Id23264452a8472e7589ffce3c6bc87cf0552ca32
2021-09-14Merge android12-gs-pixel-5.10-sc into android13-gs-pixel-5.10Jesse Hall
Bug: 199213963 Signed-off-by: Jesse Hall <jessehall@google.com> Change-Id: I777fd4796386b753796f2be9cbdb6dab73a2fa47
2021-07-21Merge r32p1-beta2 from upstream into android-gs-pixel-5.10Sidath Senanayake
This commit updates the Mali KMD to version r32p1-beta2 from commit 52c5bf56aa5f18f0e0158998b8ac23bfc4cccad6 Bug: 186092835 Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: Ie68303c73624067234aeb8756ad0835115380968
2021-07-01Merge branch 'android-gs-pixel-5.10' into android-gs-cloudripper-5.10Jesse Hall
Conflicts: mali_kbase/platform/pixel/pixel_gpu_power.c mali_pixel/memory_group_manager.c Bug: 183466800 Signed-off-by: Jesse Hall <jessehall@google.com> Change-Id: Id80bfeddca75d4ded89d2462c871e8c73330ef57
2021-06-23mali_pixel: mgm: fix printk formatMinchan Kim
use %lld instead of lu for s64 Bug: 190617821 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I4ddf50731064bb40e54be65e21061071566d715e
2021-06-22mali_pixel: mgm: Print warning after GPU allocations pass 4 GiBMinchan Kim
Print rate limited warnings once the total GPU private allocation exceeds 4 GiB. This should be removed once the linked bug has been resolved. Bug: 190617821 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I1e12930e5d621ba160b9e096620becd0b5ab94fb
2021-06-22mali_pixel: mgm: fix memory usage accountingMinchan Kim
lp_size is 2M so correct it for reporting. Bug: 191762065 Signed-off-by: Minchan Kim <minchan@google.com> Change-Id: I4a5113c17868e96f58cdfcb731ff67e232d1b7a0
2021-06-15Mali Valhall DDK r31p0 KMDSidath Senanayake
Provenance: 2ea0ef9bd (collaborate/EAC/v_r31p0) VX504X08X-BU-00000-r31p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r31p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r31p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r31p0-01eac0 - Valhall Android Renderscript AOSP parts Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: Ide9d5fdc6d9c95fa66a3546b01f619b43c09496d
2021-06-07mali_pixel: allow building without pixel statsJesse Hall
Bug: 190389925 Signed-off-by: Jesse Hall <jessehall@google.com> Change-Id: I212815b4170900d62cd06ac517777ba36e01ae43
2021-05-07Revert "mali_pixel: mgm: Write G3D register to enable IO coherency support"Sidath Senanayake
This reverts commit 7d0cf853af75b22c0ef4181faa835eb5d8003af0. Bug: 180905345 Change-Id: Ia1c077065ec1a821131c38994424b7a6314d1e08
2021-05-05mali_pixel: mgm: Support pixel_statsSidath Senanayake
Adds the 'gpu' group to the pixel_stats sysfs node which contains nodes for the count of page allocations made via the Memory Group Manager. Bug: 185589010 Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: I16dc54ef9354ea9b194edd235866d94e5e322319
2021-05-05mali_pixel: mgm: Clean up debugfs implementationSidath Senanayake
Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: I0ae2ad8d5bdcf4223e5db3854172cfdcd88682f4
2021-04-14Mali Valhall DDK r30p0 KMDSidath Senanayake
Provenance 4a09e9e58 (collaborate/EAC/v_r30p0) VX504X08X-BU-00000-r30p0-01eac0 - Valhall Android DDK VX504X08X-BU-60000-r30p0-01eac0 - Valhall Android Document Bundle VX504X08X-DC-11001-r30p0-01eac0 - Valhall Android DDK Software Errata VX504X08X-SW-99006-r30p0-01eac0 - Valhall Android Renderscript AOSP parts Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: Ie30d6ece7ebe221c8e4c736af05ad05dcfc15127
2021-04-14Consolidate Mali integration modulesSidath Senanayake
As the number of integration modules for Mali is incerasing, we consolidate them into a single module, mali_pixel, rather than deal with the overhead of multiple modules. Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: I32297ffcda68ec9245d99433727534848e2c20fe
2021-04-09mali_pixel: mgm: Write G3D register to enable IO coherency supportSidath Senanayake
In order for the GPU to detect that the memory system supports IO coherency (aka ACE Lite), we need to write a register in G3D. We do this as part of MGM to keep the upstream Mali KMD unchanged. Bug: 151952998 Bug: 168113578 Signed-off-by: Sidath Senanayake <sidaths@google.com> Change-Id: I8d73759e322dbae5b3c61277a1d3871fcbef4bed
2021-03-23mali_pixel: consolidate mali_mgm and mali_pcmJesse Hall
Test: boot to Android home, check dmesg for mali-mcm and mali-pcm probe Signed-off-by: Jesse Hall <jessehall@google.com> Change-Id: I47a7da5fd3b4a24832e2978dcce0b99fe7b54c7c