Commit Graph

17 Commits

Author SHA1 Message Date
Vedashree Vidwans
f8a2c53476 gpu: nvgpu: unit: SWUTS for mm.allocator.buddy
Add buddy_allocator.h header that contains SWUTS for the unit.

Jira NVGPU-3943

Change-Id: If4bc32e7e381c0910f773c7c3b0f1d6f9336b8fb
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2193638
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:05:52 -06:00
Vedashree Vidwans
64ecb8fb60 gpu: nvgpu: unit: SWUTS for mm.allocator.bitmap
Add bitmap_allocator.h header that contains SWUTS for the unit.

Jira NVGPU-3943

Change-Id: I13bd00f306bf66079556d775b2de83fd50760201
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2191878
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2020-12-15 14:05:52 -06:00
Sagar Kamble
a16cc2dde3 gpu: nvgpu: compile out vidmem from safety build
Safety build does not support vidmem. This patch compiles out vidmem
related changes - vidmem, dma alloc, cbc/acr/pmu alloc based on
vidmem and corresponding tests like pramin, page allocator &
gmmu_map_unmap_vidmem..
As vidmem is applicable only in case of DGPUs the code is compiled
out using CONFIG_NVGPU_DGPU.

JIRA NVGPU-3524

Change-Id: Ic623801112484ffc071195e828ab9f290f945d4d
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2132773
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-06-25 04:37:08 -07:00
Nicolas Benech
1deb1fa176 gpu: nvgpu: unit: bitmap_allocator: fix init crashes
While fixing CERT-C issues in the bitmap_allocator, a number of
asserts were added. In particular, if blk_size is 0 it will cause
a BUG(). Within the bitmap_allocator unit test, the init will try
to set blk_size to 0 to make sure it fails. Now the failure is a
BUG(), not a return code. So this fix adds EXPECT_BUG where needed.

JIRA NVGPU-906

Change-Id: I62ae725e494a7cf561ac8cac7685cffbbc8de38e
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2135823
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-06-13 13:16:12 -07:00
Nicolas Benech
9909fa53f9 gpu: nvgpu: unit: fix buddy_allocator mutex handling
A separate bug caused EXPECT_BUG to always return true without actually
calling the corresponding test code. This hid some issues in the buddy
allocator unit where the fini() operation was called several times while
expecting it to call BUG(). Doing so caused the mutex unlock operation to
not be called, which caused a deadlock for all subsequent calls. The fix
is to explicitly release the mutex after each call to fini() that expects
a BUG().

JIRA NVGPU-3562

Change-Id: Ic26058a272c616d2a6052d319f38a4d4dc33ef1c
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2126874
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-06-05 13:35:03 -07:00
Vedashree Vidwans
fb89f656d7 gpu: nvgpu: unit: Update allocator init() function
Replace individual page allocator init function with common
nvgpu_allocator_init() function corresponding the re-arch.

Jira NVGPU-991

Change-Id: Ic244c7570bac7e1cc9c3e88116414fd1ad4b4af3
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2117008
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-05-15 16:47:33 -07:00
Vedashree Vidwans
778f6b2874 gpu: nvgpu: fix MISRA 21.3 mm nvgpu allocator
MISRA rule 21.3 forbids from using calloc, malloc, realloc and free
identifiers for function or macro names. This patch renames nvgpu
allocator free operator to free_alloc to follow rule 21.3.

Jira NVGPU-3336

Change-Id: Ie9f48d567255a3e1dca70632fbe3d36b45023f3f
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2111365
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-05-06 15:34:38 -07:00
Alex Waterman
00d7b53b73 gpu: nvgpu: Move remaining GMMU HAL code to hal/mm/gmmu/
Move the remaining GMMU HAL related code from the gm20b/, gp10b/,
and gv11b/ directories to new gmmu hal source files.

Also update all makefiles and HAL init code to refelct the new
location of the headers and source code.

JIRA NVGPU-2042

Change-Id: Ic9b85cc547bd0f994ad11042fc4093c517327399
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2103672
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-26 09:36:26 -07:00
Vedashree Vidwans
b3271f2836 gpu: nvgpu: unit: Update allocator init() function
Replace individual buddy and bitmap allocator functions with common
nvgpu_alloc_allocator_init() function corresponding the re-arch.

Jira NVGPU-991

Change-Id: I43a8d84cedbba3ea39b11cd266d04343e1f07b14
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2097963
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-24 19:14:56 -07:00
Alex Waterman
efbe371fd5 gpu: nvgpu: Create hal/mm/gmmu and move gk20a GMMU code
Make a hal/mm/gmmu sub-unit for the GMMU HAL code. Also move the
gk20a specific HAL code there. gp10b will happen in the next patch.

This change also updates all the GMMU related HAL usage, of which
there is quite a bit. Generally the only change is a .gmmu needs to
be inserted into the HAL path. Each HAL init was also updated.

JIRA NVGPU-2042

Change-Id: I6c46bdfddb8e021f56103d9457fb3e2a226f8947
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2099693
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-23 12:45:54 -07:00
Vedashree Vidwans
9ca3782666 gpu: nvgpu: unit: nvgpu_page_allocator unit test
This new unit test covers 100% of the nvgpu.common.mm.allocators.page
module lines and almost all branches.

Jira NVGPU-904

Change-Id: Ic962b6e5e39a80076d977b575bf6a75b3b5bb8c7
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2092770
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-18 15:55:09 -07:00
Vedashree Vidwans
fea4322e8b gpu: nvgpu: unit: nvgpu_buddy_allocator unit test
This new unit test covers 100% of the nvgpu.common.mm.allocators.buddy
module lines and almost all branches.

Jira NVGPU-905

Change-Id: I524a12b930368b8785b3f7a2934fae3d52fa21e0
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2084329
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-08 11:45:30 -07:00
Alex Waterman
978e00b33a gpu: nvgpu: unit: Fix bitmap unit test decls
Add the necessary 0 to the test declaration.

Change-Id: I76b8a9ebb9efa20c9ebf9cdd4398eb2d0b64037b
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2090956
Reviewed-by: Seth Eatinger <seatinger@nvidia.com>
Tested-by: Seth Eatinger <seatinger@nvidia.com>
2019-04-05 14:52:10 -07:00
Philip Elcan
c0d5a715bd gpu: nvgpu: unit: add test levels
Add -t/--test-level option for the unit test framework. This
correlates with the test plan levels in GVS. L0 tests are a subset of
the L1 tests. Currently, only test levels 0 and 1 are supported.

The test output has been updated to display skipped tests. Skipped
tests are not included in the test dump.

JIRA NVGPU-2251

Change-Id: Icc2ff19a81529be8526e89f70983e96040390e00
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2085280
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-05 13:14:20 -07:00
Vedashree Vidwans
31034fc4e7 gpu: nvgpu: unit: nvgpu_bitmap_allocator unit test
This new unit test covers 100% of the nvgpu.common.mm.allocators.bitmap
module lines and almost all branches.

Jira NVGPU-906

Change-Id: Iaefb5febd86e51b6c90673b5300144d7f9f016f1
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2087078
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-03 15:54:31 -07:00
Nicolas Benech
33aea736a2 gpu: nvgpu: fix licenses in userspace
The licenses used in the userspace folder were inconsistent.
This patch fixes the situation by ensuring all files are using the
MIT license.

JIRA NVGPU-2974

Change-Id: I8c89667f72732ff6f73e6cf4be1acd9e58a7e516
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2087125
GVS: Gerrit_Virtual_Submit
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-04-02 13:54:00 -07:00
Alex Waterman
906643f184 gpu: nvgpu: Move nvgpu_allocator unit test
Move the nvgpu_allocator unit test to the proper unit test path.
The unit test path should follow the path under common/.

JIRA NVGPU-1246

Change-Id: I4b6069c036d75164a027409656ea248ede67e788
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1986224
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-04 10:14:31 -08:00