gpu: nvgpu: return instance specific max subctx count

nvgpu_channel_get_max_subctx_count() right now always returns max subctx
count for 0th instance. Update this function to return max subctx count
for GPU instance for which channel is allocated.

For CE channels that are allocated and managed by nvgpu, cdev pointer is
not set in channel private data (since it is assigned in OS specific
code). For those channels continue returning max subctx count for 0th
instance. CE channels should not need subcontexts anyways.

Add nvgpu_cdev pointer in struct nvgpu_channel_linux. Assign it in
__gk20a_channel_open() and clear it in gk20a_channel_release()

Move code to get runlist and gpu_instance_id after nvgpu_get() call.
Accesses to gk20a pointer should always come after nvgpu_get().
Also add a debug print to dump runlist_id and gpu_instance_id being
used for channel.

Jira NVGPU-5648

Change-Id: Idf58ccefdb7dc9fec78100f79c647e5a00b8fb29
Signed-off-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2438924
Reviewed-by: automaticguardword <automaticguardword@nvidia.com>
Reviewed-by: Lakshmanan M <lm@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
Deepak Nibade
2020-10-30 11:57:03 +05:30
committed by Alex Waterman
parent 8803c33f27
commit dacdaf0778
3 changed files with 30 additions and 6 deletions

View File

@@ -28,6 +28,7 @@ struct nvgpu_channel_fence;
struct nvgpu_fence_type;
struct nvgpu_swprofile;
struct nvgpu_os_linux;
struct nvgpu_cdev;
struct sync_fence;
struct sync_timeline;
@@ -92,6 +93,8 @@ struct nvgpu_channel_linux {
struct dma_buf *cyclestate_buffer_handler;
struct nvgpu_usermode_bufs_linux usermode;
struct nvgpu_cdev *cdev;
};
u32 nvgpu_submit_gpfifo_user_flags_to_common_flags(u32 user_flags);