mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 10:34:43 +03:00
gpu: nvgpu: avoid channel dependency in priv cmdbuf
The priv cmdbuf queue needs only the vm_gk20a of the channel that owns it. Pass the vm to the queue constructor and have the channel code store the queue to itself instead of poking at the channel from the queue code. Adjust the cmdbuf queue api to take the queue, not the channel. Move the inflight job fallback calculation to the channel code. The size of the channel gpfifo isn't needed in the queue; just the job count is. [not part of the cherry-pick: a bunch of MISRA mitigations.] Jira NVGPU-4548 Change-Id: I4277dc67bb50380cb157f3aa3c5d57b162a8f0ba Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2329659 (cherry picked from commit 83b2276f7bea563602eee20ce24b70ce70c8475a) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2332508 Reviewed-by: automaticguardword <automaticguardword@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: Alex Waterman <alexw@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> GVS: Gerrit_Virtual_Submit Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
Alex Waterman
parent
991002c88b
commit
05df07945a
@@ -77,7 +77,7 @@ static int channel_sync_syncpt_wait_raw(struct nvgpu_channel_sync_syncpt *s,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
err = nvgpu_priv_cmdbuf_alloc(c,
|
||||
err = nvgpu_priv_cmdbuf_alloc(c->priv_cmd_q,
|
||||
c->g->ops.sync.syncpt.get_wait_cmd_size(),
|
||||
wait_cmd);
|
||||
if (err != 0) {
|
||||
@@ -135,7 +135,7 @@ static int channel_sync_syncpt_wait_fd(struct nvgpu_channel_sync *s, int fd,
|
||||
}
|
||||
|
||||
wait_cmd_size = c->g->ops.sync.syncpt.get_wait_cmd_size();
|
||||
err = nvgpu_priv_cmdbuf_alloc(c,
|
||||
err = nvgpu_priv_cmdbuf_alloc(c->priv_cmd_q,
|
||||
wait_cmd_size * num_fences, wait_cmd);
|
||||
if (err != 0) {
|
||||
goto cleanup;
|
||||
@@ -177,7 +177,7 @@ static int channel_sync_syncpt_incr_common(struct nvgpu_channel_sync *s,
|
||||
struct nvgpu_channel *c = sp->c;
|
||||
struct nvgpu_os_fence os_fence = {0};
|
||||
|
||||
err = nvgpu_priv_cmdbuf_alloc(c,
|
||||
err = nvgpu_priv_cmdbuf_alloc(c->priv_cmd_q,
|
||||
c->g->ops.sync.syncpt.get_incr_cmd_size(wfi_cmd),
|
||||
incr_cmd);
|
||||
if (err != 0) {
|
||||
@@ -241,7 +241,7 @@ static int channel_sync_syncpt_incr_common(struct nvgpu_channel_sync *s,
|
||||
return 0;
|
||||
|
||||
clean_up_priv_cmd:
|
||||
nvgpu_priv_cmdbuf_rollback(c, *incr_cmd);
|
||||
nvgpu_priv_cmdbuf_rollback(c->priv_cmd_q, *incr_cmd);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user