gpu: nvgpu: Add os specific call to initialize the channels

Add OS specific function to return the number of syncpoints
available to the GPU. This is required for making the
syncpoints as configurable.

Linux: The default number of syncpoints is 512.

Bug 3644504

Change-Id: Iddbc38cb25480876d6d8f39f039218a1b2b22605
Signed-off-by: Dinesh T <dt@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2820152
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-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Dinesh T
2022-12-01 21:05:44 +00:00
committed by mobile promotions
parent 8e60795b9c
commit 373398a46b
4 changed files with 40 additions and 7 deletions

View File

@@ -21,6 +21,7 @@
#include <nvgpu/os_sched.h>
#include <nvgpu/gk20a.h>
#include <nvgpu/channel.h>
#include <nvgpu/channel_sync.h>
#include <nvgpu/dma.h>
#include <nvgpu/fence.h>
#include <nvgpu/grmgr.h>
@@ -51,6 +52,8 @@
#include "sync_sema_dma.h"
#include <nvgpu/linux/os_fence_dma.h>
#define NUM_CHANNELS 512U
u32 nvgpu_submit_gpfifo_user_flags_to_common_flags(u32 user_flags)
{
u32 flags = 0;
@@ -653,6 +656,17 @@ u32 nvgpu_channel_get_max_subctx_count(struct nvgpu_channel *ch)
return nvgpu_grmgr_get_gpu_instance_max_veid_count(g, gpu_instance_id);
}
u32 nvgpu_channel_get_synpoints(struct gk20a *g)
{
(void)g;
/*
* The syncpoints should be queried from the DT entry.
* Once support is added in the DT, this function will
* read and return syncpoint entry present in the device tree.
*/
return NUM_CHANNELS;
}
#ifdef CONFIG_DEBUG_FS
static void trace_write_pushbuffer(struct nvgpu_channel *c,
struct nvgpu_gpfifo_entry *g)