Commit Graph

370 Commits

Author SHA1 Message Date
Vedashree Vidwans
0931d699a5 gpu: nvgpu: unit: nvgpu_mem unit test
This new unit test covers 100% of the nvgpu.common.mm.nvgpu_mem module
lines and almost all branches.

Jira NVGPU-2235

Change-Id: I400a42f3e8f22736576a7d23abdd46a53ee9d145
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030978
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-12 11:45:29 -07:00
Philip Elcan
eda88f56ab gpu: nvgpu: unit: allow units to link against libraries
Allow unit tests to define NVGPU_UNIT_SHARED_LIBRARIES in their
tmake files for linking if necessary. For example, pthreads.

JIRA NVGPU-2251

Change-Id: Ieeae10fe981d82e2caa0fbde041b72b0887b6ca6
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034425
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-03-11 18:24:01 -07:00
Nicolas Benech
99721cca0d nvgpu: unit: unit test for nvgpu.interface.lock
This unit test covers all APIs of the nvgpu.interface.lock and
verify their behavior.

JIRA NVGPU-2245

Change-Id: I317663ab45a2cc93ddd46edccc9c3fdc37148e72
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034205
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-11 18:23:52 -07:00
Alex Waterman
7172d96bcd gpu: nvgpu: unit: Final pd_cache requirement verification tests
These tests implement the pd_cache requirement verification tests for
all pd_cache requirements and test specifications. They cover:

  o  PD GPU address computation
  o  PD offset computation
  o  Init
  o  Multiple inits
  o  Cleanup*

[*] the cleanup needs some more POSIX memory API support: we need a way
to make sure that all outstanding allocations are freed.

JIRA NVGPU-1323

Change-Id: If6398ad09c9d38f5ac2fdad057bb933f88224599
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2034273
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-08 14:04:18 -08:00
Seema Khowala
1c3fbd9dc7 gpu: nvgpu: move chip specific fuse to hal
Move chip specific fuse code from common/fuse to hal/fuse.
Replace gk20a_readl/writel with nvgpu_readl/writel
Replace 0xFFFFFFFFU with U32_MAX hash define

JIRA NVGPU-2035

Change-Id: Icaa908db036053d5e6f4ff20b9e5b1d6c0ab2fda
Signed-off-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2033278
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 15:14:38 -08:00
Thomas Fleury
c23738969d Revert "Revert "gpu: nvgpu: array of pointers to runlists""
This reverts commit ade1d50cbe.

Currently a fifo_runlist_info_gk20a structure is allocated and
initialized for each possible runlist. But only a few runlists
are actually used.

Use an array of pointers to runlists in fifo_gk20a. The array
keeps existing indexing by runlist_id. In this patch a context
is still allocated for each possible runlist, but follow up
patch will allow to skip context allocation for inactive
runlists.

Bug 2470115
Bug 2522374

Change-Id: I0deb6981bc6f5152bdf121f0a44429748aa14687
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030407
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-07 11:45:59 -08:00
Nicolas Benech
350c8ebf11 gpu: nvgpu: unit: handle BUG() calls in pd_cache
With the use of nvgpu_assert in pd_cache code, some tests trying
to cause failures are now causing calls to BUG() which are now
being handled with calls to EXPECT_BUG

JIRA NVGPU-677

Change-Id: Idc3696ddef30165588fe9c9dcb6ab0b7241ab5fe
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020601
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-05 11:14:58 -08:00
Nicolas Benech
9db43bad82 gpu: nvgpu: unit: handle BUG() calls in page_table
With the use of nvgpu_assert in page_table code, some tests trying
to cause failures are now causing calls to BUG() which are now
being handled with calls to EXPECT_BUG

JIRA NVGPU-677

Change-Id: Ib73055eba307ce00a2515fed19c7c278413bdc43
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020600
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-03-05 11:14:54 -08:00
Thomas Fleury
ade1d50cbe Revert "gpu: nvgpu: array of pointers to runlists"
This reverts commit 5fdda1b075.

Bug 2522374

Change-Id: Icb5e2181b056dc2247291c7f0e47d46c29095286
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2030293
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Hoang Pham <hopham@nvidia.com>
2019-02-28 17:51:37 -08:00
Thomas Fleury
5fdda1b075 gpu: nvgpu: array of pointers to runlists
Currently a fifo_runlist_info_gk20a structure is allocated and
initialized for each possible runlist. But only a few runlists
are actually used.

Use an array of pointers to runlists in fifo_gk20a. The array
keeps existing indexing by runlist_id. In this patch a context
is still allocated for each possible runlist, but follow up
patch will allow to skip context allocation for inactive
runlists.

Bug 2470115

Change-Id: I1615043cea84db35a270ade64695d51f85c1193a
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2025203
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-27 17:54:37 -08:00
Alex Waterman
5f9d3036a6 gpu: nvgpu: Move HAL units to hal/
Move bus related HAL code to new top level HAL directory: hal/.

This directory should mirror the common directory as much as
possible.

There's some nice pros here:

  1. Isolate HAL and common code.
  2. Since the common directory should not be including HAL
     related headers directly this structure will make it
     easier to catch these sorts of bugs with a script.

Change-Id: Ib9eb03a97d05db17b637b115c650adcbe9553d54
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011627
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-26 21:14:28 -08:00
Vedashree Vidwans
429d313f29 gpu: nvgpu: unit: ENABLED unit test
This new unit test covers 100% of the nvgpu.common.enabled module lines
and almost all branches.

Jira NVGPU-897

Change-Id: I27254637de51daf0568bbcb82f2112ad1ceec067
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2025401
Reviewed-by: Philip Elcan <pelcan@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-02-25 15:25:01 -08:00
asah
8431b0b0ba gpu: nvgpu: Support for qnx unit tests to create its own DL folder
Added NVGPU_SYSTEMIMAGE_DIR makefile variable which will be set by qnx
unit test setup. This will allow qnx setup to create its own DL folder
in nvgpu_unit/units/

JIRA NVGPU-1852

Change-Id: Ia6c3d8550dd44441c6865b5e2253eafc83067ebc
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2021963
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-20 09:54:12 -08:00
asah
7eeacb4da8 gpu: nvgpu: Add support for qnx test to set Flag and interface makefile variables
units/Makefile.units.common.tmk unconditionally sets flags as __NVGPU_POSIX__
and also INTERFACE_DIRS to nvgpu/userspace, drivers/gpu/nvgpu. QNX unit
tests are using this Makefile and don't need these already set flags and
INTERFACE_DIRS so this change is making that unconditional set to
conditional so that QNX unit tests can define their own

JIRA NVGPU-1352

Change-Id: Ib958cb63c0159b1bea48a00fdcac43151a68cc3f
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011270
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-16 16:33:53 -08:00
asah
03145af1eb gpu: nvgpu: remove RTLD_GLOBAL flag from libnvgpu-drv.so dlopen for QNX tests
currently libnvgpu-drv.so is opened with RTLD_GLOBAL flag which is
required for nvgpu common tests but for qnx tests we dont need any
symbol from libnvgpu-drv.so (except nvgpu_posix_probe and
nvgpu_posix_cleanup which we will eventually remove for qnx) so
RTLD_GLOBAL should not be used in case of qnx tests. If RTLD_GLOBAL is
used for qnx tests then the symbols from libnvgpu-drv.so will be used
instead of from libqnx_mock.so which is wrong.

This change uses -Q command line option to make the decision about
RTLD_GLOBAL flag

After this change qnx unit tests should be run with -Q option and nvgpu
common unit tests should be run without it

JIRA NVGPU-1352

Change-Id: I759db679f5b95696835c8125c21f95bf35df590c
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011271
Reviewed-by: Alex Waterman <alexw@nvidia.com>
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: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-14 22:13:39 -08:00
Konsta Holtta
93e15f9c43 gpu: nvgpu: rename redundant runlist names in HAL
Drop the "runlist_" part in the runlist section of the HAL ops. For
example:

- old: g->ops.runlist.runlist_wait_pending
- new: g->ops.runlist.wait_pending

At the same time, drop the "fifo_" part from the function names. For
example:

- old: gk20a_fifo_runlist_wait_pending
- new: gk20a_runlist_wait_pending

Also rename eng_runlist_base_size to count_max. The size of the
eng_runlist_base register array depicts the maximum possible number of
runlists in the chip for which count_max is more descriptive.

Jira NVGPU-1309

Change-Id: Ie9e94b9f65cd10d3e682d19954f240adb6e311be
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2017403
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-14 18:52:29 -08:00
Nicolas Benech
af2385b563 gpu: nvgpu: unit: add MMU faults unit
Add a new unit to cover MMU faults, with a focus on GV11B

JIRA NVGPU-907

Change-Id: I7cab1b75ce03cc30e8a0d593239c8420a7f243f5
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2018404
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-02-13 12:24:36 -08:00
Rohith Seelaboyina
aa6317e10a Revert "gpu: nvgpu: unit: add MMU faults unit"
This reverts commit 1d49e8218d.

Change-Id: Ifdcc5acc7e5d3df3cf0174068dccaf795675ee8b
Signed-off-by: Rohith Seelaboyina <rseelaboyina@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2017916
2019-02-12 22:55:36 -08:00
Nicolas Benech
1d49e8218d gpu: nvgpu: unit: add MMU faults unit
Add a new unit to cover MMU faults, with a focus on GV11B

JIRA NVGPU-907

Change-Id: Ia5f80d5b5614cae24a5dcf2835a8e84edb271ab9
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1978366
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-02-12 15:54:31 -08:00
asah
49255caeff gpu: nvgpu: unit: Argument to run QNX tests
Created a command line argument '-Q' for nvgpu_unit. It represents that
the tests are QNX specific tests.

Change-Id: I178e220de1777c7de30f489ad9f3b5352db3aa19
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2013907
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Ankur Kishore <ankkishore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-10 17:03:39 -08:00
Alex Waterman
16735840ee gpu: nvgpu: unit: Fix --no-color bug
The color itself was not being printed when `--no-color' was set
but the reset color escape sequence was still being printed. This
fixes that bug so that now, when `--no-color' is specified neither
the color or the reset sequence is printed.

This cleans up the log mess in GVS runs.

JIRA  NVGPU-1737

Change-Id: I8f612d3f920b78e25ba606add703b310da36d7a7
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2007626
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-31 09:15:41 -08:00
Tejal Kudav
15115e7db9 gpu: nvgpu: Add nvlink.c to POSIX build
1. The nvlink code in common/ is clean from any external API usage.
   There should not be any compilation issues with POSIX build if we
   include nvlink.c to it.
2. Rename the nvlink file in POSIX build to avoid the tmake
   duplicate filename issue.
3. Set CONFIG_TEGRA_NVLINK for POSIX to enable reporting of MISRA
   violations in nvlink code by the MISRA scanner.
4. To fix the build issues:
     a. Add stubs in POSIX
     b. Return the 'err' variable set during dev_shutdown() as 'err'
        is set but not used.

JIRA NVGPU-1921
JIRA NVGPU-1319

Change-Id: Ifdd6574d772167856782bafa74994507b3cedf4c
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2005622
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-29 10:54:44 -08:00
Philip Elcan
920030011e gpu: nvgpu: unit: add new script for unit testing
Add new script nvgpu_submit_unit.sh for starting the unit test framework
in GVS. The new script will live in the same path as nvgpu_submit and
can be started without a relative path. This allows for cases where
nvgpu_submit is started from a different path.

Change-Id: Iebc8e86bff943d4741c2fcaa5ec11e9f2c00bee7
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997984
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-01-24 17:13:45 -08:00
Alex Waterman
efdcce03d3 gpu: nvgpu: unit: Cleanup comment formatting in pd_cache unit test
Remove the redundant 'Cx: ' prefix for the verification criteria.
This follows the format used in prior comments.

JIRA NVGPU-1737

Change-Id: I4211ae84b532a0e38d3d0aab0c759acc66524578
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2002172
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-24 11:03:30 -08:00
Konsta Holtta
237cee5997 gpu: nvgpu: move chip specific runlist code to common
Extract out the HAL ops' implementation that now belongs to the runlist
unit.

Jira NVGPU-1309

Change-Id: I66185de0ddace1728da5f55ae11daa0b752bebf1
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997824
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-24 04:14:40 -08:00
Konsta Holtta
6fda25e958 gpu: nvgpu: move runlist HAL ops to separate section
Split out ops that belong to runlist unit to a new section called
runlist. This is effectively just renaming; the implementation still
stays put.

Jira NVGPU-1309

Change-Id: Ib928164f8008f680d9cb13c969e3304ef727abba
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997823
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-24 04:14:31 -08:00
Alex Waterman
111678e94d gpu: nvgpu: userspace: Add results.{html,json} to ignore
These files get generated by the unit test framework. As such they
do not need to be checked into the repo.

JIRA NVGPU-1737

Change-Id: I3152e717611ebafd2621eae5b022809b0b97d08c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001293
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 11:55:39 -08:00
Alex Waterman
a31980359f gpu: nvgpu: unit: Add nvgpu_pd_free() VC test
Add the verification criteria test for pd_cache's nvgpu_pd_free()
function.

JIRA NVGPU-1323

Change-Id: Ida7b4c1d071d79487c1e0cbdd2a8dd5f36f6e938
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001292
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 11:55:35 -08:00
Nicolas Benech
a35a89b780 gpu: nvgpu: add NVGPU_POSIX config in host builds
A previous change to re-organize Makefile.sources made use
of the NVGPU_POSIX variable which was not defined in the
host Makefile and thus caused run issues. This patch adds
the missing variable.

JIRA NVGPU-1734

Change-Id: I0857204578ff67fa80113c3a40eac13f290dd838
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001062
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-22 13:14:33 -08:00
Nicolas Benech
9953b17ae1 gpu: nvgpu: unit: init dma field to 0
In the C1 test, the "dma" field of the supplied SGLs was
not properly initialized to 0 which could cause crashes.

JIRA NVGPU-907

Change-Id: I7cf2a4a455251817c64d255813c7495f24d5c6af
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997936
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-01-17 13:13:58 -08:00
Nicolas Benech
b97a322eda gpu: nvgpu: Add missing Makefile definitions
A previous change added more common files to the POSIX
build and added flags to the on-target POSIX build. Those
definitions were missing from the host POSIX build resulting
in build failures.

JIRA NVGPU-1734

Change-Id: I3edbe681a475df45c83eae828900c2612f9357b1
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1996565
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-01-17 13:13:55 -08:00
Konsta Holtta
bca54edb08 gpu: nvgpu: unit: use array for a lone tsg
test_tsg_format_gen() uses a single tsg and passes its address on to be
used as an array (of a single element). Reduce confusion by using a
single-element tsg array already instead of a plain tsg.

Coverity ID 8335811

Change-Id: I0135bcabeed12474beb9c52c9d186de1676b5423
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1996287
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-16 09:55:07 -08:00
Terje Bergstrom
fc503da086 gpu: nvgpu: Add rest of common files to POSIX build
Add common files to POSIX build, and enable most of the common feature
flags nvgpu has enabled in other builds.

As consequence common code now uses more APIs that need to be stubbed
in POSIX build, so add stubs posix-dt.c, posix-nvhost.c, posix-vgpu.c,
and posix-vidmem.c.

JIRA NVGPU-1734

Change-Id: I936c5886229cb4d47cab4f42b013ff77f9e45482
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1993127
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-15 17:15:24 -08:00
Alex Waterman
489236d181 gpu: nvgpu: MISRA 21.2 fixes: __nvgpu_set_enabled()
Rename __nvgpu_set_enabled() to nvgpu_set_enabled(). The original
double underscore was present to indicate that this function is a
function with potentially unintended side effects (enabling a feature
has wide ranging impact).

To not lose this documentation a comment was added to convey that this
function must be used with care.

JIRA NVGPU-1029

Change-Id: I8bfc6fa4c17743f9f8056cb6a7a0f66229ca2583
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1989434
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-15 12:54:19 -08:00
asah
35ea60fe80 gpu: nvgpu: unit: extend unit test build system
Added NV_COMPONENT_INCLUDES and
NV_COMPONENT_NEEDED_INTERFACE_DIRS support as we need
them for building QNX nvgpu_rmos/ files with the test
library

JIRA NVGPU-1352

Change-Id: If1944396dac2ac84fadd5cbb487fa700c829523a
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1994355
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@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>
2019-01-14 19:23:52 -08:00
Nicolas Benech
7e503d619d gpu: nvgpu: unit: add req testing for page_table
Add requirement-based testing for the page_table unit.

JIRA NVGPU-907

Change-Id: Ia81a2c92025e6a3c05536f26690338a3873ba5de
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1990503
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-01-14 15:56:00 -08:00
Nicolas Benech
ccb4c67a1b gpu: nvgpu: unit: Test execution verification
When running unit tests, a log of all executed tests is
generated. A script along with the "required_tests.json"
will check that all required tests were effectively run, thus
ensuring that no tests are silently missing. The "testlist.py"
support script is also used to generate the list of required
tests, and can also generate an HTML-formatted output with links
to JAMA requirements wherever possible.

JIRA NVGPU-1717

Change-Id: Ic361b1d0a5f003f8b24952d63e20fb496dd1e787
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1983631
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-01-04 15:23:59 -08:00
Nicolas Benech
4e3e60dc48 gpu: nvgpu: unit: fix test names in page_table
Fix duplicate names in the test list.

JIRA NVGPU-907

Change-Id: Ifd3d3137bab36e6806b910f1e1ee303e29be376e
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1983630
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-01-04 15:23:55 -08:00
Konsta Holtta
e05c0d13a0 gpu: nvgpu: add runlist unit to common
Extract non-chip-specific code that manages the runlists (init, update,
reschedule etc.) to a new file in the common directory. Move the
declarations to a new matching runlist.h header.

Jira NVGPU-1309

Change-Id: I3c7e0032899516487037f47ddc9a7e7aa4b0b33a
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1978058
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-04 11:15:34 -08: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
Nicolas Benech
0893309027 gpu: nvgpu: unit: Increase page_table coverage
Add extra test cases focusing on:
- error management (to check various branches)
- IPA-PA conversion

JIRA NVGPU-907

Change-Id: Ifd0e1a00f9c4ac0db68fefb82fc407c4cfd8cc5d
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1972451
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-03 07:17:58 -08:00
Alex Waterman
8e8e40e66d gpu: nvgpu: Adjust MM unit test paths
Adjust the MM unit tests pd_cache and page_table to reflect
their new paths in the common nvgpu code.

JIRA NVGPU-1246

Change-Id: I01454f758bbf54864210c01f8bfe3750b26891ce
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1986121
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-02 21:34:34 -08:00
Konsta Holtta
7a4c2f050f gpu: nvgpu: unit: add inactive channel runlist test
Cover the case where a tsg has channels that are not in the active map
of the runlist.

Jira NVGPU-1174

Change-Id: I63e71b5a295a427d9fab351f3b610134c72b040a
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975382
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@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>
2018-12-19 19:44:36 -08:00
Konsta Holtta
517b901f5f gpu: nvgpu: unit: test tsg timeslice, split fmt tests
Cover the nondefault path of tsg timeslice settings and split out the
three tsg format checks to be separate tests so that the timeslice test
fits in nicely.

Jira NVGPU-1174

Change-Id: Icaa99de81392a4b811247c5ca32526e22a61da84
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975381
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@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>
2018-12-19 19:44:32 -08:00
Konsta Holtta
8ca9f3a8cb gpu: nvgpu: unit: use args for runlist interleaving
The interleaving tests (full and oversize) are very similar in code. Add
common args struct for them and have just one function to process args.

Jira NVGPU-1174

Change-Id: I535aeb020454d3f87ad1148560f29ca7fff4ae2d
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975380
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@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>
2018-12-19 19:44:28 -08:00
Konsta Holtta
e315011691 gpu: nvgpu: unit: align runlist test naming
A last minute fix in the runlist construction code rework reorganized
the order such that the ringbuf list starts with the highest level, not
lowest. Some tests were not updated though. Adjust comments and naming
to indicate what the tests really do, and add one more test to cover all
branches in the interleaved construction logic.

Jira NVGPU-1174

Change-Id: If608a35be2c5cf8f400df6673cd10c983ab91845
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1975379
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Nicolas Benech <nbenech@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>
2018-12-19 19:44:25 -08:00
Abdul Salam
66729df1bb gpu:nvgpu:unit:Rename gp106 to gv100 fuse unit test
Remove gp106 and add gv100 unit test
This is as a part of removing gp106 support
This adds testing for gv100 to the fuse unit test
Removes check_sec/non_sec as they are not used
Removes delta SRAM fuse as they are not present in GV100

Bug 200457373

Change-Id: I9bb4b714500eae01d0df00bb9f6842d4d4fbfd12
Signed-off-by: Abdul Salam <absalam@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1960034
GVS: Gerrit_Virtual_Submit
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-13 04:56:11 -08:00
Alex Waterman
87471e92c1 gpu: nvgpu: unit: Add pd_cache unit test for VC C3
This unit test verifies that the PD cache is capable of packing
multiple PD allocations into a single page. The verification works
by using the DMA fault injection method to prevent more than one
DMA alloc from happening in the pd_cache code.

If an OOM error is detected by the pd_cache code before the max
number of PDs per page is allocated by the pd_cache then there's
a failure in the packing code.

The correct number of PDs per page is easy to calculate: it's
just PAGE_SIZE / pd_size.

JIRA NVGPU-1323

Change-Id: I2c5b58ecf32da48d503c576012d9e564a270144c
Signed-off-by: Alex Waterman <alexw@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1970876
Reviewed-by: Konsta Holtta <kholtta@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2018-12-12 11:53:47 -08:00
Philip Elcan
0eb555c5c0 gpu: nvgpu: unit: nvgpu_sgt: use new sgt APIs
This updates the nvgpu_sgt unit test to use the new sgt APIs in the
POSIX sgt implementation.

JIRA NVGPU-1563

Change-Id: I2f00baa45d6b13f2e4911322860d27da47f0cac2
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1966152
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>
2018-12-11 14:41:15 -08:00
Philip Elcan
8f15a2903c gpu: nvgpu: unit: initialize nvgpu_mem variables
There were several places were nvgpu_mem structs were declared on the
stack and not initialized. Some fields could be used erroneously by
underlying APIs.

To allow the initialization of an array of nvgpu_mem in
test_dma_alloc_fi_delayed_enable(), the array length had to be changed
from a const to a macro.

JIRA NVGPU-1563

Change-Id: I6c23445af7d932710898df2e23a8fd892bee77b3
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1967966
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>
2018-12-11 14:41:08 -08:00