Commit Graph

5570 Commits

Author SHA1 Message Date
Mobile Promotions
03236739f0 Merge remote-tracking branch 'origin/stage-main' into dev-kernel 2019-01-24 10:50:34 -08:00
Mobile Promotions
d1e6e6103d Merge remote-tracking branch 'origin/dev-other' into stage-main 2019-01-24 10:47:18 -08:00
Poojan Shah
8839eada2e vgpu: nvclock: Deprecate Clock Get/Set APIs for KHz
ESQC-6156
ESQC-6044

Change-Id: Id59a680c78054cd09e02759574ececa83f7f6b5c
Signed-off-by: Poojan Shah <poojans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1989827
Reviewed-by: svcboomerang <svcboomerang@nvidia.com>
Tested-by: svcboomerang <svcboomerang@nvidia.com>
2019-01-24 10:43:17 -08:00
Poojan Shah
2df296138b vgpu: nvclock: Deprecate Clock Get/Set APIs for KHz
ESQC-6156
ESQC-6044

Change-Id: Id59a680c78054cd09e02759574ececa83f7f6b5c
Signed-off-by: Poojan Shah <poojans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001173
Reviewed-by: svcboomerang <svcboomerang@nvidia.com>
Tested-by: svcboomerang <svcboomerang@nvidia.com>
2019-01-24 10:43:07 -08:00
Poojan Shah
9036cf9d22 vgpu: nvclock: Deprecate Clock Get/Set APIs for KHz
ESQC-6156
ESQC-6044

Change-Id: Id59a680c78054cd09e02759574ececa83f7f6b5c
Signed-off-by: Poojan Shah <poojans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001172
Reviewed-by: svcboomerang <svcboomerang@nvidia.com>
Tested-by: svcboomerang <svcboomerang@nvidia.com>
2019-01-24 10:42:58 -08:00
Konsta Holtta
7439449c5c gpu: nvgpu: move runlist base and entry size hal ops
Avoid including the HW headers directly in the HAL listings: add
indirection functions for the two ops that were naked:

- runlist.eng_runlist_base_size
- runlist.runlist_entry_size

GV100 gets a new fifo HAL file as base_size is the first one (and
currently the only one) of GV100-specific ops.

NVGPU-1309

Change-Id: Idf28b5e26c798457132ef595fa55c65bcddb1b31
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997826
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-24 04:14:58 -08:00
Konsta Holtta
cdfa78e91d gpu: nvgpu: move set_runlist_state declaration
The function gk20a_fifo_set_runlist_state was moved to another place
some time ago but the declaration didn't follow the implementation move.
Move it from fifo_gk20a.h to runlist.h.

Jira NVGPU-1309

Change-Id: Ib939a5243cee4be1c1092a553cb81b81adc6e5ce
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997825
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-24 04:14:49 -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
Vinod G
f6656dc00f gpu: nvgpu: fix allocation error for rtvcb
Code correction to use right variable for
gfxp_rtvcb_ctxsw_buffer.

Bug 2492222

Change-Id: I844a2a78272c8ce90c8174864bd81153ffc9d982
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001376
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: Seema Khowala <seemaj@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 23:34:10 -08:00
Nicolas Benech
6cbae2c28f gpu: nvgpu: nvgpu_pmu_enable_elpg to return status
nvgpu_pmu_enable_elpg was always returning 0 when a proper
status could be returned instead. This patch fixes the issue
and makes use of it in fifo_gv11b.

JIRA NVGPU-677

Change-Id: Idfcae786ce40ca5498e527e61b2b5cbb1fd1413c
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1996855
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 17:24:09 -08:00
Nicolas Benech
a93b350c67 gpu: nvgpu: fix MISRA 17.7 in fifo_gv11b
MISRA Rule-17.7 requires the return value of all functions to be used.
Fix is either to use the return value or change the function to return
void. This patch contains fix for all 17.7 violations in fifo_gv11b.c

JIRA NVGPU-677

Change-Id: I3daae219694b36e49b0171b237811530666ee46b
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1995006
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 17:24:00 -08:00
Nicolas Benech
6978943621 gpu: nvgpu: gk20a_disable_tsg to return void
gk20a_disable_tsg was always returning 0. This patch changes
it to return void, thus fixing a number of MISRA violations.

JIRA NVGPU-677

Change-Id: I5be8d1d8eaeb36da44653a60e57259ccffc4fea0
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1995004
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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: Adeel Raza <araza@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 17:23:57 -08:00
Philip Elcan
69d975fcbc gpu: nvgpu: clk: fix MISRA 10.3 issue in clk_prog
MISRA Rule 10.3 prohibits implicit assignment of an object from a
different size type. This fixes a MISRA 10.3 violation for assigning a
u16 to a u8 in clk_prog.c.

JIRA NVGPU-1008

Change-Id: I565a4aba62dac30943d9c9d012ca0a0d6a256578
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001227
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 13:55:23 -08:00
Philip Elcan
fea84c09fa gpu: nvgpu: clk: fix MISRA 10.3 issues for size_t
MISRA Rule 10.3 prohibits implicit casting of objects to a different
type. This change addresses a number of MISRA 10.3 violations in
clk_prog.c where size_t values were being implicitly cast to u16.

JIRA NVGPU-1008

Change-Id: I39a257a056faf0f903363ed8d697efa88d74e75e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001226
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 13:55:19 -08:00
Philip Elcan
76acbc02bc gpu: nvgpu: clk: fix return type for vflookup()
This changes the return type for the API fvlookup() from a u32 to an
int. The implementation of the API in vflookup_prob_1x_master() was
already trying to return negative values. This allows users of the API
to properly check the return value.

JIRA NVGPU-1008

Change-Id: Ifb12b5ffbde7fed501e7dfec9bd6a28dcc1b242e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001225
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 13:55:15 -08:00
Philip Elcan
99ed40b7fb gpu: nvgpu: clk: fix MISRA 10.3 issues for size_t
MISRA Rule 10.3 prohibits implicit casting of objects to a different
type. This change addresses a number of MISRA 10.3 violations in
clk_domain.c where size_t values were being implicitly cast to u16.

JIRA NVGPU-1008

Change-Id: If2dc6c6a288fe4b16425a210bc6d76bbef2ce019
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001224
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 13:55:12 -08:00
Philip Elcan
2cff6844fb gpu: nvgpu: clk: use explicit BIT32 macro
Use the BIT32() macro to create 32 bit values when assigning to a u32.
This avoids MISRA 10.3 violations for assigning different types to a
u32.

JIRA NVGPU-1008

Change-Id: I0b50c3cf476737d38c943ecc12c4f17f9ba9ddb8
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001223
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 13:55:08 -08:00
Philip Elcan
968db82a65 gpu: nvgpu: clk: fix incorrect casts in returns
Remove the u32 casting for return values in functions whose return type
is int.

JIRA NVGPU-1008

Change-Id: I87d4e3a4f8530f45b59a1f612180b295c5238b28
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001222
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 13:55:04 -08:00
Vinod G
4425162cb0 gpu: nvgpu: reduce bootstrap size in dGpu
VDK has vidmem size restriction of 192MB. Reducing the bootstrap_size
from 512Mb to 32Mb. Add definition for SZ_32M.

Correct the code error in tu104_fb_get_vidmem_size call, bytes 
calculated in case of fmodel case is not being passed to
gv100_fb_get_vidmem_size call.

JIRA NVGPU-1564

Change-Id: Ib10b34257c5eca68f565e489541a5357dc0fa035
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997051
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: Seshendra Gadagottu <sgadagottu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-23 13:54:28 -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
Konsta Holtta
2d496942c5 Revert "gpu: nvgpu: FBQ data struct to support FBQ implementation"
This reverts commit 92ebb4d245.

Bug 2487534

Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Change-Id: Ic8db42d2da47284c00b23c786830176b7a2dfe18
Reviewed-on: https://git-master.nvidia.com/r/2001922
2019-01-23 08:26:24 -08:00
Konsta Holtta
0aeb2a6f87 Revert "gpu: nvgpu: FBQ falcon queue functions"
This reverts commit cfca282e32.

Bug 2487534

Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Change-Id: If8259293c6d1d554155b100eaf435587a6eab5b7
Reviewed-on: https://git-master.nvidia.com/r/2001921
2019-01-23 08:26:02 -08:00
Konsta Holtta
164a3ce16f Revert "gpu: nvgpu: PMU init message read from FBQ support"
This reverts commit 97ee23563f.

Bug 2487534

Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Change-Id: Id3db3df4d1257a5605a0d24d207f03447eae7a40
Reviewed-on: https://git-master.nvidia.com/r/2001920
2019-01-23 08:25:43 -08:00
Konsta Holtta
ecbffde4f7 Revert "gpu: nvgpu: PMU payload as part of FBQ element"
This reverts commit 02f28eacbc.

Bug 2487534

Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Change-Id: Ifc34cd6473f8952b791a6742ec8aec5c2d1d92bf
Reviewed-on: https://git-master.nvidia.com/r/2001919
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
2019-01-23 08:22:02 -08:00
Konsta Holtta
80fa45e46e Revert "gpu: nvgpu: Enable FBQ support of PMU tu10a & gv10x profile"
This reverts commit bd192e8eaa.

Bug 2487534

Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Change-Id: I5b43d0b5f04ed1a8c69637631829af1e29f82115
Reviewed-on: https://git-master.nvidia.com/r/2001918
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
2019-01-23 08:21:56 -08:00
asah
073b1331a3 gpu: nvgpu: More exports from libnvgpu-drv.so
Adding some exports in libnvgpu-drv.so which are needed
for building vm_rmos.c in QNX unit test

Change-Id: Ieb7a46412f28106f69ec7dac5f55dbe5d8a47fa1
Signed-off-by: asah <asah@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1996274
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>
2019-01-22 16:44:09 -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
Scott Long
80d8d9f8d1 gpu: nvgpu: MISRA 10.1 fixes to gr
MISRA Rule 10.1 states that operands shall not be of an inappopriate
essential type.  For example, shift and bitwise operations should only
be performed on operands of essentially unsigned type.

This patch modifies gr exception handling to no longer use bitwise OR
when generating return status values.

Instead, the first non-zero status value is saved off and returned.

This has the added benefit of not potentially ORing together errno
values and generating an undefined status code.

JIRA NVGPU-650

Change-Id: If725a560c122d2cbf12e79b58161402da2023b5b
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1999098
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-22 13:14:29 -08:00
Divya Singhatwaria
068341d27c gpu: nvgpu: Fix MISRA 16.1 violations
Rule 16.1 states that all switch statements shall be well-formed:

- Every switch-clause will have default case.
- The switch-clause will end with an unconditional break statement.
- The switch statement will have two or more conforming switch clauses.

JIRA NVGPU-1509

Change-Id: I17ec54ba082d4a0e4464d9d4c4084d60e498f1a1
Signed-off-by: Divya Singhatwaria <dsinghatwari@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1979627
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
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>
2019-01-22 03:04:11 -08:00
Deepak Nibade
b40c655e12 gpu: nvgpu: move regops to separate unit
Move regops (gk20a/regops_gk20a.c) to separate unit common/regops/regops.c
Move corresponding header (gk20a/regops_gk20a.h) to include/nvgpu/regops.h

Move rest of the platform HAL files to common/regops/ as well

Fix all the header includes to include new public header

Remove *_apply_smpc_war() declarations from headers. Corresponding
functions were cleaned up already, and declarations were left somehow

Jira NVGPU-620

Change-Id: I8b8065b9c91f69809bdeb1b4caecdc7582c8a992
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1998723
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-21 23:04:28 -08:00
Preetham Chandru Ramchandra
eb887094e4 gpu: nvgpu: nvgpu locks to vanilla Linux locks
Replace nvgpu locks to vanilla Linux locks. For the custom kernel
driver when they include nv-p2p.h, nvgpu/linux/lock.h will not be
available because nvgpu/linux/lock.h is not copied to
/usr/src/kernel_header_file.

Bug 200438879

Change-Id: I55b52c6f791970650388b7d51c4d30b5fe75bbb8
Signed-off-by: Preetham Chandru Ramchandra <pchandru@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997950
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Alex Waterman <alexw@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-21 21:54:20 -08:00
Deepak Nibade
a8d5a4d405 gpu: nvgpu: support PCI device id 0x1ebb and 0x1efb
These PCI ids correspond to TU104 502SKU.
Add them to pci_device_id and reuse existing Turing platform
configuration

Change-Id: I479699f8e8958da48fef7227ad8d7b9ad7ab3e63
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1998467
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>
2019-01-21 05:04:03 -08:00
Mahantesh Kumbar
bd192e8eaa gpu: nvgpu: Enable FBQ support of PMU tu10a & gv10x profile
-Update PMU version for tu10a & gv10x profile
 https://git-master.nvidia.com/r/1998458
  gpu: tu10a: Enable FBQ support for PMU TU10A profile
 https://git-master.nvidia.com/r/1998459
  gpu: gv10x: Enable FBQ support for pmu-gv10x profile

-Enabled FBQ support for tu10a & gv10x profile by setting
NVGPU_SUPPORT_PMU_RTOS_FBQ to true for Volta & Turing

JIRA NVGPU-1574

Change-Id: I093a835e97f672d31ffc23e2f8d583366bc13239
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1998465
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: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-20 23:16:38 -08:00
Mahantesh Kumbar
02f28eacbc gpu: nvgpu: PMU payload as part of FBQ element
-Earlier, with DMEM queue, if command needs in/out payload
 then space needs to be allocated in DMEM/FB-surface &
 copy payload in allocated space before sending command
 by providing payload info in sending command .
-With FBQ, command in/out payload is also part of FB command
 queue element & not required to allocate separate space in
 DMEM/FB-surface, so added changes to handle FBQ payload request
 while sending command & also in response handler to extract
 data from out payload.

JIRA NVGPU-1579

Change-Id: Ic256523db38badb1f9c14cbdb98dc9f70934606d
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1966741
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: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-20 23:16:19 -08:00
Mahantesh Kumbar
97ee23563f gpu: nvgpu: PMU init message read from FBQ support
-Added NVGPU_SUPPORT_PMU_RTOS_FBQ feature to enable
 FBQ support.
-Add support to read PMU RTOS init message from
 FBQ message queue to process init message &
 construct FBQ for further communication
 with PMU RTOS ucode.
-Added functions to init FB command/message queues
 as per init message inputs from PMU RTOS ucode.

JIRA NVGPU-1578

Change-Id: If2678d20f7195e6e8cba354b7dca5117003e3c29
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1964068
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: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-20 23:16:15 -08:00
Mahantesh Kumbar
cfca282e32 gpu: nvgpu: FBQ falcon queue functions
-FBQ(command/message queue) will be part of super surface
 which will reside in FB.
-FBQ access should happen using falcon generic queue functions
 so added FBQ related functions under falcon queue as needed
 to support FBQ.
-Additional FBQ related public functions exposed as command
 buffer is constructed in sysmem buffer which will be copied
 to actual FBQ element buffer & also, payload is part of queue
 element which needs some queue parameters access from client

JIRA NVGPU-1577

Change-Id: I3ae097e378fd162bb779aaae986b2fae306238d9
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1777939
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
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>
2019-01-20 23:16:11 -08:00
Mahantesh Kumbar
92ebb4d245 gpu: nvgpu: FBQ data struct to support FBQ implementation
-Created FBQ data struct to support FBQ implementation
-FBQ(command/message queue) will be part of super surface
 which will reside in FB.

JIRA NVGPU-1575

Change-Id: Ia9be7d75035e6c92296202c2a4f25eccb259173b
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1725091
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
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>
2019-01-20 23:16:07 -08:00
Prateek sethi
126187f232 gpu: nvgpu: Fix uninitialized memory access
gk20a_remove_gr_support() is freeing the local_golden_image and
local_golden_image->context. But there are instances where
local_golden_image is not allocated since freeing an
unallocated golden context image accesses the contents of
local_golden_image causes a fault.

Check golden_image_initialized flag before freeing
local_golden_image->context.

Jira NVGPU-1648
Bug 2461665

Change-Id: I19235d2ec9d77ba4ef00257f43436448f5f70b25
Signed-off-by: Prateek sethi <prsethi@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997665
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-20 01:34:19 -08:00
Terje Bergstrom
48b0bcb742 gpu: nvgpu: Make Makefile.sources generic
Allow using Makefile.sources in different build types by passing
the build flags from Makefile.tmk to Makefile.sources.

At the same time utilize the build flag to exclude common/nvlink.c
from POSIX build, but keep it for non-POSIX build.

JIRA NVGPU-1734

Change-Id: I116dcfdbef46bfd3d49d21ad1022bdaba3ba8253
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1996670
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-18 16:08:30 -08:00
Philip Elcan
64f87e9584 gpu: nvgpu: pmu: fix return in thrm api
The api therm_domain_pmu_setup() in thrm.c was return a u32 incorrectly.
It should return an int.

JIRA NVGPU-1008

Change-Id: I1cf51f26fc2615671bbab4dcf78b4f60b7bdcbeb
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1995883
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-misra <svc-mobile-misra@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-01-18 13:54:49 -08:00
Philip Elcan
725daf3400 gpu: nvgpu: pmu: fix MISRA 10.3 issues in pstate
MISRA Rule 10.3 prohibits implicit assignment of an object of different
essential type or narrower type. This change addresses a number of
miscellaneous violations in pstate.c

JIRA NVGPU-1008

Change-Id: Iccde60d0110681f72f37dc64b2e67983757ad563
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1995882
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-18 13:54:45 -08:00
Tejal Kudav
b83c5e4594 gpu: nvgpu: Remove external APIs in nvlink common
The Tegra SOC nvlink driver and dGPU nvlink driver depend on
struct definitions, macros and functions exposed by nvlink-core
driver. The nvlink-core driver is not part of the nvgpu driver,
hence we should not be directly accessing any core driver
APIs/macros/structs from the /common/nvlink code. Common code can
only use nvgpu internal APIs. We wrap all calls from common/nvlink.c
to other drivers in nvgpu wrappers, and define the implementation of
wrappers in os/linux and os/nvgpu_rmos, and stub them in os/posix.

Also, we remove the implicit inclusion of OS specific nvlink header
file via common nvgpu/nvlink.h. So the OS specific code needs to
explicitly add OS specific header file.

JIRA NVGPU-966

Change-Id: I65c67e247ee74088bb1253f6ae4c8d0c49420a98
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1990071
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Antony Clince Alex <aalex@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-18 02:13:43 -08:00
Vinod G
1ff12f065e gpu: nvgpu: Update pbdma data and header reset functions
Two new fifo hals are added.
read_pbdma_data and reset_pbdma_header.

In turing the instruction that caused the interrupt
will be stored in NV_PPBDMA_PB_DATA0 register or
NV_PPBDMA_HDR_SHADOW register, which is decided based on
NV_PPBDMA_PB_COUNT value and PB_HEADER type

JIRA NVGPU-1240

Change-Id: I54a92e317a6054335439d2d61bced28aff3eecb7
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1990699
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-17 22:35:06 -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
Scott Long
136a31fcd4 gpu: nvgpu: container_of() changes to clk code
While not necessary for MISRA compliance purposes, this change
modifies the linux platform clk code use of container_of() to follow
similar changes applied to address the following rule violations:

 * Rule 11.3 : A cast shall not be performed between a pointer to
               object type and a pointer to a different object type.
 * Rule 11.8 : A cast shall not remove any const or volatile
               qualification from the type pointed to be a pointer.
 * Rule 20.7 : Expressions resulting from the expansion of macro
               parameters shall be enclosed in parentheses.

This patch replaces the to_clk_gk20a() macro with a new (static)
clk_gk20a_from_hw() function that eliminates the Rule 11.8 and
Rule 20.7 violations and exchanges the Rule 11.3 violation with
an advisory Rule 11.4 violation.

It should be noted that the replacement function still contains
potentially dangerous (and non-MISRA compliant code) and that it is
expected that deviation requests will be filed for the new advisory
rule violations where appropriate.

JIRA NVGPU-782

Change-Id: Ia702cca1e3fc1a57771d0d6db2fd3b4788ac49b8
Signed-off-by: Scott Long <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1995893
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Konsta Holtta <kholtta@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-17 13:13:51 -08:00
Deepak Nibade
b3b87cf303 gpu: nvgpu: remove debugger include from regops
Regops does not depend on debug session logically
We right now include debugger.h in regops_gk20a.c to extract
channel pointer from debug session and to check if session is for
profiling or not

Update exec_regops_gk20a() to receive channel pointer and profiler
flag directly as parameters, and remove dbg_session_gk20a from
parameter list

Remove ((!dbg_s->is_profiler) && (ch != NULL)) checks from
check_whitelists(). Caller of exec_regops_gk20a() already ensures
that we have context bound for debug session
Use only is_profiler boolean flag in this case which should be
sufficient

Remove (ch == NULL) check in check_whitelists() if regops is of
type gr_ctx. Instead move this check to earlier function call
in validate_reg_ops(). If we have non-zero context operation on
a profiler session, return error from validate_reg_ops()

Update all subsequent calls with appropriate parameter list

Remove debugger.h include from regops_gk20a.c

Jira NVGPU-620

Change-Id: If857c21da1a43a2230c1f7ef2cc2ad6640ff48d9
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1997868
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-17 11:34:10 -08:00
Deepak Nibade
0ff5a49f45 gpu: nvgpu: move patch context update calls to gr/ctx unit
We use below APIs to update patch context
gr_gk20a_ctx_patch_write_begin()
gr_gk20a_ctx_patch_write_end()
gr_gk20a_ctx_patch_write()

Since patch context is owned by gr/ctx unit, move these APIs
to this unit and rename them to
nvgpu_gr_ctx_patch_write_begin()
nvgpu_gr_ctx_patch_write_end()
nvgpu_gr_ctx_patch_write()

Jira NVGPU-1527

Change-Id: Iee19c7a71d074763d3dcb9b1997cb2a3159d5299
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1989214
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: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-01-17 10:26:58 -08:00