Commit Graph

5570 Commits

Author SHA1 Message Date
Vedashree Vidwans
ba6c6c818b gpu: nvgpu: Resolved posix BITS_TO_LONGS computation bug
Previously, BITS_TO_LONGS macro had calculation bug due to incorrect
ordering of parantheses. This patch rearranges the parantheses to
correctly convert specified bits to nearest higher multiple of unsigned
long.

Change-Id: I296da2a2ebd805325189f956089ac201aa5b04d8
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2024034
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-20 16:10:20 -08:00
Deepak Nibade
556041f425 gpu: nvgpu: create new gr/fecs_trace unit
Create new gr/fecs_trace unit with common/gr/fecs_trace/fecs_trace.c
as common source file and include/nvgpu/gr/fecs_trace.h as common
header file
This unit will be common between Linux and QNX
Corresponding HAL files will be added under common/gr/fecs_trace/
as more functionality is moved to new unit

For now move struct gk20a_fecs_trace_hash_ent to new unit and
rename it as struct nvgpu_fecs_trace_context_entry
Add vmid field to this struct since it is required for QNX

Remove use of hashtables and simply use linked list to simplify
the code. FECS tracing is not a performance sensitive use case
so perf hit could be ignored

Rename hash_lock mutex to list_lock

struct gk20a_fecs_trace and mutex list_lock are still declared in
gk20a/fecs_trace_gk20a.c, hence they cannot be used in new unit yet

Rename and update all gk20a_fecs_trace_hash_*() APIs to appropriate
nvgpu_gr_fecs_trace_*() APIs

Remove gk20a_fecs_trace_hash_dump() since it is not being used

Jira NVGPU-1880

Change-Id: I89c2715baa770dbbd864ea70ab43d83d98ba693c
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2022903
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-20 16:10:01 -08:00
Deepak Nibade
decbbf3504 gpu: nvgpu: fix trace ring read after invalid entry
gk20a_fecs_trace_poll() right now calls gk20a_fecs_trace_ring_read()
to read the trace ring buffer written by FECS
gk20a_fecs_trace_ring_read() returns number of trace entries written
to local buffer if successful, otherwise returns error

In case there is really an invalid entry, gk20a_fecs_trace_poll()
will just stop reading more entries, write current read pointer to
h/w and return

When gk20a_fecs_trace_poll() is called next time, we again read that
invalid entry, and again skip it, and again return
This keeps happening, and we never move on to read new entries

Fix this by always continuing to read next entry irrespective
of current entry is valid or not
gk20a_fecs_trace_poll() now just prints a debug message instead of
breaking the loop

Bug 200491708

Change-Id: I8cf823d7dc5f72ebd70cab2f115af32f3d20ac78
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020167
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Debarshi Dutta <ddutta@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-02-20 13:44:23 -08:00
Aparna Das
d8c5ce3c85 gpu: nvgpu: vgpu: move vgpu fifo files under vgpu/fifo
Create a new directory fifo under common vgpu path moving all
vgp common fifo files under that directory.

Move vgpu runlist implementations to a new file runlist_vgpu.c
and create corresponding header file.

Also fix lines over 80 chars in fifo_vgpu.c

Jira GVSCI-334

Change-Id: Ic00535b22a6066a0d27435b9a987de7fa701ea05
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011762
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-20 11:34:06 -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
Vinod G
92e12c0ca2 gpu: nvgpu: rename gv11b zbc hals
Renamed gr_gv11b zbc hal function which do register access as
gv11b_gr_zbc* hal function.

gr_gv11b_add_zbc_s -> gv11b_gr_zbc_add_stencil

common code gr_gv11b zbc hal functions are renamed as
nvgpu_gr_zbc* hal functions.

gr_gv11b_zbc_s_query_table -> nvgpu_gr_zbc_stencil_query_table
gr_gv11b_add_zbc_type_s -> nvgpu_gr_zbc_add_type_stencil
gr_gv11b_load_stencil_default_tbl ->
                     nvgpu_gr_zbc_load_stencil_default_tbl
gr_gv11b_load_stencil_tbl -> nvgpu_gr_zbc_load_stencil_tbl

gr_gv11b_get_gpcs_swdx_dss_zbc_c_format_reg ->
		gv11b_gr_zbc_get_gpcs_swdx_dss_zbc_c_format_reg
gr_gv11b_get_gpcs_swdx_dss_zbc_z_format_reg ->
		gv11b_gr_zbc_get_gpcs_swdx_dss_zbc_z_format_reg

JIRA NVGPU-1882

Change-Id: I00b62923d72d0165ce86316ec6047e99ecabacbd
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2018951
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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-02-20 05:42:27 -08:00
Vinod G
b2cb5b097b gpu: nvgpu: rename gk20a and gp10b zbc hals
Renamed gr_gk20a zbc hal functions which involve register access as
gk20a_gr_zbc* hal functions.

gr_gk20a_add_zbc_color -> gk20a_gr_zbc_add_color
gr_gk20a_add_zbc_depth -> gk20a_gr_zbc_add_depth

gr_gk20a zbc hal functions without any register access are renamed as
common function as nvgpu_gr_zbc*

gk20a_gr_zbc_set_table -> nvgpu_gr_zbc_set_table
gr_gk20a_query_zbc -> nvgpu_gr_zbc_query_table

Renamed gr_gp10b zbc hal functions as gp10b_gr_zbc* hal functions.
gr_gp10b_add_zbc_color -> gp10b_gr_zbc_add_color
gr_gp10b_add_zbc_depth -> gp10b_gr_zbc_add_depth
gr_gp10b_get_gpcs_swdx_dss_zbc_c_format_reg ->
	gp10b_gr_zbc_get_gpcs_swdx_dss_zbc_c_format_reg
gr_gp10b_get_gpcs_swdx_dss_zbc_z_format_reg ->
	gp10b_gr_zbc_get_gpcs_swdx_dss_zbc_z_format_reg

common code added for nvgpu_gr_zbc_add_color and
nvgpu_gr_zbc_add_depth which update ltc, update local copy
and call add_color or add_depth hal function

All these functions will be moved to common/gr/zbc location
in future updates.

gk20a_writel replaced with nvgpu_writel function.

JIRA NVGPU-1882

Change-Id: I717739e0b20c243e8f5ed3e00f8f76755587bcee
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2018737
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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-02-20 05:42:23 -08:00
Vinod G
220ba0dfa4 gpu: nvgpu: rearrange pmu_save hal function
As part of creating zbc as gr subunit, move pmu_save hal function
from zbc to pmu hal.
This hal function is used to pass the information to gpmu
firmware, which should reside as part of pmu.

remove pmu_save hal from zbc.
add save_zbc hal under pmu.
remove unused function gr_gk20a_pmu_save_zbc

JIRA NVGPU-1882

Change-Id: I132dbc7a9ee9755043cd08f288344df447e28af6
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2018581
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-20 05:42:20 -08:00
Adeel Raza
a9c2a2defd gpu: nvgpu: mm: don't print lp vma if unified va
If a VM has a unified user virtual address space, then only a single
debug print is needed for displaying the user aperture base
address/size. If however, the VM doesn't have a unified virtual address
space, then 2 debug prints are needed to display the base address/size
of the small and large page apertures.

Change-Id: I909bef249cfe7cd5a7e1545102aa87bab01d8df2
Signed-off-by: Adeel Raza <araza@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2023282
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>
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 21:25:37 -08:00
Adeel Raza
323dedc88d gpu: nvgpu: posix: fix mem leak in sgt create
nvgpu_sgt_os_create_from_mem() had a memory leak where an sgt struct was
being malloced but not being returned to the caller. This patch fixes
the bug by changing the execution sequence.

Change-Id: Id3474fc9a15a9463e589b39565a57d10d3f0804a
Signed-off-by: Adeel Raza <araza@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2023266
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
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: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 21:25:33 -08:00
Vaibhav Kachore
a280bfc16e gpu: nvgpu: rename atomic.h
- "nvgpu_rmos/include" path is recently added in Makefile
under NV_COMPONENT_INCLUDES. atomic.h file is also present in
the same path.
- This atomic.h is conflicting with QNX OS's atomic.h which
needs to be included in some components.
- Hence, renaming atomic.h to rmos_atomic.h

Bug 200475265

Change-Id: I2a5c28157d1cf388a526765b688c3fe56a666a09
Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2021821
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Terje Bergstrom <tbergstrom@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-19 21:25:13 -08:00
Tejal Kudav
e7987729bd gpu: nvgpu: Fix 10.3 MISRA violations in nvlink
MISRA Rule 10.3 does not allow value of expression to be assigned to
an object with a narrower essential type or to a different essential
type category.
Fix such 10.3 violations in nvlink code by type-casting (when sure
there will be no overflows) or by changing the data-type of variables

JIRA NVGPU-1921

Change-Id: Iab103a7f0c23cf2a047152cbd76c0b55b3cc947c
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2012811
Reviewed-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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-02-19 21:24:55 -08:00
Aparna Das
56e37a7059 gpu: nvgpu: vgpu: move vgpu perf functions to new file
Move vgpu functions vgpu_perfbuffer_enable() and vgpu_perfbuffer_disable()
to a new file perf_vgpu.c and create corresponding header files.

Jira: GVSCI-334

Change-Id: Icbb0fc3e222e2ab431696420a86b2600f214c948
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011761
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 13:35:23 -08:00
Aparna Das
3a2ec0c075 gpu: nvgpu: vgpu: rename dbg_vgpu files to debugger_vgpu
Rename dbg_vgpu files to debugger_vgpu following native
file layout.

Also fix violations of lines over 80 chars in debugger_vgpu.c
and debugger_vgpu.h

Jira GVSCI-334

Change-Id: Ib950420f4b654cb6f581ffc3576b18904aef00f0
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011760
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 13:35:14 -08:00
Aparna Das
0e5c27e55b gpu: nvgpu: vgpu: move vgpu css files to vgpu perf
Create a new vgpu common directory perf moving css vgpu files
to this new directory. Also rename css_vgpu files to
cyclestats_snapshot_vgpu following native path structure.

Jira GVSCI-334

Change-Id: Ia774237133704ed2fa88ac5efcd48e67b3e0440e
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011759
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 13:35:05 -08:00
Aparna Das
99a2cc44e2 gpu: nvgpu: vgpu: add vgpu ce header file
Move ce related functions declaration from vgpu.h to ce specific
new header file ce_vgpu.h. Also rename ce2_vgpu.c to ce_vgpu.c
as ce2 is legacy.

Jira GVSCI-334

Change-Id: I5d774807af1e7dfeebd232e81440fe1698f5138f
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011758
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 13:34:56 -08:00
Aparna Das
a66d9cfde5 gpu: nvgpu: vgpu: move common vgpu code to nvgpu common
All code that is common across OSes resides under nvgpu
common path. Follow the same for vgpu.

Jira GVSCI-334

Change-Id: Ie1c6f4611ee2d799efaa43c62d6d96ef2fe982a5
Signed-off-by: Aparna Das <aparnad@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011757
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 13:34:47 -08:00
Sagar Kamble
285b3cc914 gpu: nvgpu: replace nvgpu_pmu_dbg with nvgpu_err/log_info in queues sources
queue specific sources should use general logging interfaces like
nvgpu_err, nvgpu_log_info and not PMU specific nvgpu_pmu_dbg. With
this we can remove pmu.h inclusion in engine_mem_queue.c and
engine_fb_queue.c. This uncovers some new header inclusions
that we have to do for compilation of both these files.

More cleanup of PMU fields and related headers to follow.

JIRA NVGPU-1994

Change-Id: I728746094de85f338fcae940f10ee1731d397048
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2019415
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-02-19 06:36:31 -08:00
Sagar Kamble
e8486f0b25 gpu: nvgpu: prepare common engine_queue.h
Some of the engine queue related defines are shared by PMU, SEC2 and
queue implementations and currently in gpmuif_cmn.h. Let us add
engine_queue.h header file to club all those defines together.

JIRA NVGPU-1994

Change-Id: I57a889e6d14d954d2660e513994bb87cbb1e5824
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2019414
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-02-19 06:36:27 -08:00
Sagar Kamble
ae13910bd9 gpu: nvgpu: move engine queues out of falcon to common
With engine queues implementations now isolated from falcon unit let us
move it to common with following units in the sources:

1. nvgpu.common.engine_queues.mem_queues.mem_queue
2. nvgpu.common.engine_queues.mem_queues.emem_queue
3. nvgpu.common.engine_queues.mem_queues.dmem_queue
4. nvgpu.common.engine_queues.fb_queue
5. nvgpu.common.falcon.falcon
6. nvgpu.common.hal.falcon

File/folder names are prepended with "engine_" for better understanding.

JIRA NVGPU-1994

Change-Id: I02b06f134e964b0ec665208ae4e08ae65504ed4e
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016291
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 06:36:23 -08:00
Sagar Kamble
0a762889c6 gpu: nvgpu: eliminate struct nvgpu_falcon dependency from engine_queues
engine queue head and tail methods were retrieved from falcon structure.
engine queue initialization can get these methods directly from hal
through params. Also eliminate struct nvgpu_falcon dereference in engine
queue sources to remove inclusion of falcon_priv.h.

JIRA NVGPU-1994

Change-Id: Idbebd5049cfd14eb3fe0e27b2bef8436cc61e101
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016290
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-02-19 06:36:14 -08:00
Sagar Kamble
7685f98440 gpu: nvgpu: cache flcn_id in queue struct to remove flcn dependency
To decouple engine queues from falcon unit cache the flcn_id in the queue
structures during init and use the same.

JIRA NVGPU-1994

Change-Id: I48a0b1d6c6bd613b5f0bd4a162479abfeab33a2d
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016289
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-02-19 06:36:10 -08:00
Sagar Kamble
ece30fc2f9 gpu: nvgpu: rename falcon queues to engine queues
As we plan to move the queue implementations out of falcon unit let us
rename these as:
1. engine_mem_queue - Generic implementation.
2. engine_dmem_queue - DMEM queue implementation of engine_mem_queue.
3. engine_emem_queue - EMEM queue implementation of engine_mem_queu.
4. engine_fb_queue - FB queue implementation.

JIRA NVGPU-1994

Change-Id: Ic81dcc154b3383d9f75fe57cc01269bda2698b25
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016288
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 06:36:07 -08:00
Sagar Kamble
c5dde07a31 gpu: nvgpu: remove unneeded queue interfaces
queue id, index and size are not required to be exported now for DMEM &
EMEM queue. queue id, index are not required for FB. Remove these.

JIRA NVGPU-1994

Change-Id: Id6cb32c1e536384987a25117c647e647191f83df
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016287
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-02-19 06:35:57 -08:00
Sagar Kamble
4875315014 gpu: nvgpu: unify dmem & emem queue implementation
DMEM & EMEM queues are handled mostly using similar mechanisms. Use only
push/pop memory copy variants and otherwise reuse rewind, has_room, push
,pop, head/tail operations.

JIRA NVGPU-1994

Change-Id: I024a04162f84eebf897093f084d31f44cd48513f
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016286
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-02-19 06:35:54 -08:00
Sagar Kamble
05eaa33548 gpu: nvgpu: separate fb queue management
FB queues handling is different from DMEM/EMEM queues in many aspects.
For e.g. no rewind required, additional queue struct fields, additional
queue operations required only for FB queues, push/pop semantics are
different.
Hence prepare separate structure and APIs for FB queues. PMU will have
to deal with the queue implementation chosen. This patch does the follo-
wing:

1. Update function/structure names to falcon_fb_queue_<op/name>.
2. Export nvgpu_falcon_fb_queue_* structure and functions.
3. Removed rewind function pointer and used direct functions for push,
   pop and has_room.
4. PMU wrapper defined to use appropriate queue for empty check -
   nvgpu_pmu_queue_is_empty.
5. PMU side updates for handling the work buffer and SEC2 updates for
   usage of public queue functions.

JIRA NVGPU-1994

Change-Id: Ia5e40384e6e3f9e81d5dbc3d8138eb091337c086
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016285
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mahantesh Kumbar <mkumbar@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-02-19 06:35:50 -08:00
Sagar Kamble
868853c66c gpu: nvgpu: create separate engine queue units
Let's create three source files for engine queues based out of DMEM, EMEM
and FB. Further patches will refactor these files to isolate from falcon
unit and each other.

JIRA NVGPU-1994

Change-Id: Ia7d7274e56c638533654f5ea0cbe8925b94b9a6f
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2015595
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 06:35:46 -08:00
Sagar Kamble
900ec578c1 gpu: nvgpu: separate falcon queue interfaces
falcon queue interfaces will need to be separated from base falcon ones.
include/nvgpu/falcon_queue.h will have the public interfaces and falcon_
queue_priv.h will have the private data structures.

JIRA NVGPU-1994

Change-Id: I0825dfed13b98756d64a6fa1635e740f1983dd22
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016284
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: Mahantesh Kumbar <mkumbar@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-02-19 06:35:37 -08:00
Debarshi Dutta
8e44b3fcd7 gpu: nvgpu: use public APIs of pbdma_status unit.
nvgpu driver uses the h/w headers for reading pbdma_status registers
directly in the common code path. Replace the use of the H/W headers by
using the APIs of the pbdma_status unit. Use the HAL ops functions
read_pbdma_status_info() to do a read of the pbdma status register.

Jira NVGPU-1311

Change-Id: I4b492e675ce2561bb1e132b518023f9933d8c510
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2019977
Reviewed-by: Deepak Nibade <dnibade@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-02-19 04:17:04 -08:00
Debarshi Dutta
9767366c60 gpu: nvgpu: add pbdma_status unit
A new unit pbdma_status is added. The unit provides a HAL
ops function pointer read_pbdma_status_info() to read and produce
a struct of type nvgpu_pbdma_status_info. Additionally, the unit
provides public APIs to retrieve data from the struct
nvgpu_pbdma_status_info.

Jira NVGPU-1311

Change-Id: Ic89c78703c3738b91be8d18ba970a591658d4022
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2019976
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-19 04:17:00 -08:00
rmylavarapu
8daafcbae8 gpu: nvgpu: Restructuring clk.h into different units
Changes:
1) Separated clk.h which is in /nvgpu/include/pmu
 into different units
2) Renamed global functions

Intention: At present /nvgpu/include/pmu/clk.h
consists of structures and functions of different
clock units. It is difficult to work on individual
clk units if this file is not separated into
individual units. All stucts and functions in clk.h
are seperated into different clk units.
Individual private clk units were not touched.
Post this patch, the sebsequent patches would make
changes in the individual clk units.

NVGPU-2707

Change-Id: I7bf9fab38a73bceb451291530a67c70ed343b0cb
Signed-off-by: rmylavarapu <rmylavarapu@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2021704
Reviewed-by: Debarshi Dutta <ddutta@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-02-19 01:55:54 -08:00
Anuj Gangwar
f28b2f8baa include: linux: removing header files references
removing unnecessary header files references.

Bug 200438879

Change-Id: I6d9233f2f311f284bf2248d884c20b938db3a89e
Signed-off-by: Anuj Gangwar <anujg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2021739
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Preetham Chandru <pchandru@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-18 23:34:40 -08:00
Tejal Kudav
c2906e0535 gpu: nvgpu: Fix MISRA 8.3 violations in nvlink
MISRA rule 8.3 requires that all declarations of a function
shall use the same parameter names and type qualifiers.
Fix 8.3 violations in nvlink code by matching the parameter names
in function declaration and definition.

JIRA NVGPU-1921

Change-Id: I3904ad9f9049bab0395398bf9c2f7e985b7c4d52
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2018195
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Raghuram Kothakota <rkothakota@nvidia.com>
Reviewed-by: Adeel Raza <araza@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-02-18 04:28:13 -08:00
Mahantesh Kumbar
0aa55f6741 gpu: nvgpu: ACR refactor to create ACR unit
Move ACR code to separate folder under common/acr to
make ACR separate unit. with this, separating ACR blob
construct, bootstrap & ACR chip specific configuration
code to different files.

ACR blob construction code split into two version, as
gm20b & gp10b still uses older ACR interfaces & not yet
moved to Tegra ACR, blob_construct_v0 file can be deleted
once gm20b/gp10b uses Tegra ACR ucode & point to
blob_construct_v1 with simple change.

As ACR ucode can execute on different engine falcon &
should not be dependent on specific engine falcon, used
generic falcon functions/interface to support ACR & doesn't
access any engine h/w registers directly, and files with
chip name has configuration needed for ACR HS ucode & LS
falcons.

JIRA NVGPU-1148

Change-Id: Ieedbe82f3e1a4303f055fbc795d9ce0f1866d259
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2017046
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-02-18 04:27:33 -08:00
Mahantesh Kumbar
0d05c6e159 gpu: nvgpu: Move PMU functions from ACR to PMU
Move PMU functions from ACR files to respective PMU
files to clean up the ACR-PMU dependency

JIRA NVGPU-1147

Change-Id: I581fcbb494836b858e848562901712d618b37ad1
Signed-off-by: Mahantesh Kumbar <mkumbar@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016405
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@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-02-18 04:27:29 -08:00
Tejal Kudav
558af783ef gpu: nvgpu: Fix 10.1 MISRA issues in common/nvlink
Fix the MISRA 10.1 violations by not allowing non-boolean type variables
to be used as boolean.

JIRA NVGPU-1921

Change-Id: Iccfc1794575530500da652a7f9db9f27c4187231
Signed-off-by: Tejal Kudav <tkudav@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011066
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Dinesh T <dt@nvidia.com>
Reviewed-by: Adeel Raza <araza@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-02-18 03:16:11 -08:00
Konsta Holtta
05e3be8177 gpu: nvgpu: rfr: print file statistics
Add a listing of changed files after the commit messages similar to how
git show --stat would put it. This makes it trivial to see where the
changes happened if the commit description doesn't state it.

Example from this patch:

  scripts/rfr | 23  (+20  -3  )

The numbers are padded to a width of three so they line up nicely.

Change-Id: Ie62ea6c7d1d3b21446c7447f362d148be3032076
Signed-off-by: Konsta Holtta <kholtta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020196
GVS: Gerrit_Virtual_Submit
Reviewed-by: Philip Elcan <pelcan@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-02-18 02:06:23 -08:00
Stephen Warren
19f6d90831 gpu: nvgpu: remove nvgpu/linux/lock.h from nv-p2p.h
Commit eb887094e4 ("gpu: nvgpu: nvgpu locks to vanilla Linux locks")
removed all use of nvgpu/linux/lock.h from nv-p2p.h, but didn't remove
the inclusion of that file. Remove the inclusion so that nv-p2p.h doesn't
require locnvgpu/linux/lock.h to be present.

Bug 200438879
Bug 1940058

Change-Id: I1bb3b2e5e5c8bd56d1e48f255c0675493953ba07
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2020685
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-17 20:14:38 -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
Vinod G
10d6603f39 gpu: nvgpu: rearrange zbc hal functions
As part of creating zbc as gr subunit, zbc hal functions in gr
are moved under struct zbc.

Removed unused function - _gk20a_gr_zbc_set_table
Removed unused hal function -  add_zbc

JIRA NVGPU-1882

Change-Id: I7560135210c45abb734d4041b3f7330a988b6978
Signed-off-by: Vinod G <vinodg@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2017812
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: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-16 00:33:50 -08:00
Deepak Nibade
60402c78b3 gpu: nvgpu: resolve circular dependency between gr/config and priv_ring
gr/config needs to get gpc_count from priv_ring, and priv_ring calls
API exposed by gr/config to get gpc_count in its ISR

priv_ring unit already has an HAL API to get gpc_count so it does not
need to rely on gr/config for same
Hence resolve the dependency by using g->ops.priv_ring.get_gpc_count()
instead of nvgpu_gr_config_get_gpc_count()

Jira NVGPU-1879

Change-Id: I1c894dac18dd9265f39375e930e8e9f9b0d67050
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2019147
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: Debarshi Dutta <ddutta@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-02-15 17:04:12 -08:00
Terje Bergstrom
adee60b3e1 gpu: nvgpu: Remove memory script support from bios.c
Remove support for executing a memory configuration script. It was
used for gp106, and support for gp106 has been removed.

Change-Id: I91180304f89bfb4e883731555b585ff91c01bb28
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2019461
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-15 10:54:30 -08:00
Debarshi Dutta
061aa66adc gpu: nvgpu: move engine specific functions to common/fifo
The following changes are done in this patch.

1) gk20a_fifo_get_engine_info() is moved to common/fifo/engine.c
and is renamed to gk20a_fifo_get_active_engine_info() to reflect
accurately the purpose of the function.

2) move the definition of enum fifo_engine to <nvgpu/engines.h> and
add the prefix NVGPU_

3) move the following functions related to engines in fifo_gk20a.c to
common/fifo/engines.c and replace their signature by adding the prefix
nvgpu_engine and removing gk20a_fifo.

gk20a_fifo_get_active_engine_info
gk20a_fifo_engine_enum_from_type
gk20a_fifo_get_engine_ids
gk20a_fifo_is_valid_engine_id
gk20a_fifo_get_gr_engine_id
gk20a_fifo_act_eng_interrupt_mask
gk20a_fifo_engine_interrupt_mask
gk20a_fifo_get_all_ce_engine_reset_mask

Jira NVGPU-1315

Change-Id: I63d9dcd905a0bebcc9a4c65776cf6ec7a0837acf
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2011298
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-15 09:44:19 -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
Adeel Raza
ac24a33a76 gpu: nvgpu: posix: fix atomic test ops
Previously atomic test ops were simply returning the atomic value as a
boolean. Instead the test ops had to check if the value had reached 0.

Change-Id: Ib84ec4f78ddb25604e39c3e78272857899805b7b
Signed-off-by: Adeel Raza <araza@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2018758
Reviewed-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: svc-misra-checker <svc-misra-checker@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-14 17:47:17 -08:00
Sagar Kamble
c3ea3e283f gpu: nvgpu: make engine queue_head|tail APIs depend on queue id & index
Since we plan to separate engine DMEM/EMEM and FB queues into separate
implementations, let's make the engine queue_head and queue_tail APIs
independent of nvgpu_falcon_queue parameter.

JIRA NVGPU-1994

Change-Id: I389cc48d4045d9df8f768166f6a1d7074a69a309
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016283
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-14 02:29:20 -08:00
Sagar Kamble
e87161b807 gpu: nvgpu: make engine dependent functions hal ops
Engine falcon reset, emem copy and queue head/tail management has to be
accessed through hal APIs. Introduce these for PMU & SEC2 engines.

JIRA NVGPU-1459

Change-Id: I1d8f5103decb0bcba387886304d899ecc7b42cf1
Signed-off-by: Sagar Kamble <skamble@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016282
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-14 02:29:09 -08:00
Deepak Nibade
00aeab6cca gpu: nvgpu: add gpc_mask to gr/config unit
We get gpc_mask by calling GR HAL g->ops.gr.get_gpc_mask()

But gpc_mask should be logically owned by gr/config unit
Hence add new gpc_mask field to nvgpu_gr_config

Initialize it in nvgpu_gr_config_init() by calling a new HAL
g->ops.gr.config.get_gpc_mask() if available
If HAL is not defined we just initialize it based on gpc_count

Expose new API nvgpu_gr_config_get_gpc_mask() to get gpc_mask
and use this API now

Remove gr_gm20b_get_gpc_mask() and HAL g->ops.gr.get_gpc_mask()

Update GV100 and TU104 chip HALs to remove old and add new HAL

Add gpc_mask to struct tegra_vgpu_constants_params to support this
on vGPU. Also get gpc_mask from vGPU private data in
vgpu_gr_init_gr_config()

Jira NVGPU-1879

Change-Id: Ibdc89ea51df944dc7085920509e3536a5721efc0
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016084
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-14 02:28:58 -08:00
Deepak Nibade
6fb2abb153 gpu: nvgpu: remove hw_pri_ringmaster_gm20b.h include from gr/config
Unit gr/config right now queries gpc_count from priv_ring by directly
reading the value from register

priv_ring unit now exposes below HAL to get gpc_count
g->ops.priv_ring.get_gpc_count()

Use this HAL in gr/config unit

Jira NVGPU-1879

Change-Id: Ibd3557b7f906690a7ad18f11d02a0a6990b98337
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2016083
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
2019-02-14 02:28:36 -08:00