Files
linux-nvgpu/drivers/gpu/nvgpu/os/linux/vgpu/vgpu_ivc.c
Richard Zhao 8a411096c9 gpu: nvgpu: linux: vgpu to use dt_node for tegra_gr_comm
For PCIE gpu device, it uses PCIE controller dt node to store nvgpu/vgpu
dt properties, since PCIE endpoint device does not have any
corresponding dt node. So we pass dt_node directly to tegra_gr_comm,
together with EP device since tegra_gr_comm relies on dev_err.

Jira GVSCI-15779

Change-Id: I73c5210e2d8b6a728c74823c1e62fed765776365
Signed-off-by: Richard Zhao <rizhao@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2884176
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: svc-mobile-cert <svc-mobile-cert@nvidia.com>
Reviewed-by: Austin Tajiri <atajiri@nvidia.com>
Reviewed-by: Santosh BS <santoshb@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
2023-05-01 00:24:34 -07:00

80 lines
2.0 KiB
C

/*
* Copyright (c) 2018-2023, NVIDIA Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
* version 2, as published by the Free Software Foundation.
*
* This program is distributed in the hope it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <nvgpu/types.h>
#include <linux/tegra_gr_comm.h>
#include "os/linux/os_linux.h"
#include "os/linux/module.h"
int vgpu_ivc_init(struct gk20a *g, u32 elems,
const size_t *queue_sizes, u32 queue_start, u32 num_queues)
{
struct device *dev = dev_from_gk20a(g);
return tegra_gr_comm_init(dev, nvgpu_get_node(g), elems,
queue_sizes, queue_start,
num_queues);
}
void vgpu_ivc_deinit(u32 queue_start, u32 num_queues)
{
tegra_gr_comm_deinit(queue_start, num_queues);
}
void vgpu_ivc_release(void *handle)
{
tegra_gr_comm_release(handle);
}
u32 vgpu_ivc_get_server_vmid(void)
{
return tegra_gr_comm_get_server_vmid();
}
int vgpu_ivc_recv(u32 index, void **handle, void **data,
size_t *size, u32 *sender)
{
return tegra_gr_comm_recv(index, handle, data, size, sender);
}
int vgpu_ivc_send(u32 peer, u32 index, void *data, size_t size)
{
return tegra_gr_comm_send(peer, index, data, size);
}
int vgpu_ivc_sendrecv(u32 peer, u32 index, void **handle,
void **data, size_t *size)
{
return tegra_gr_comm_sendrecv(peer, index, handle, data, size);
}
u32 vgpu_ivc_get_peer_self(void)
{
return TEGRA_GR_COMM_ID_SELF;
}
void *vgpu_ivc_oob_get_ptr(u32 peer, u32 index, void **ptr,
size_t *size)
{
return tegra_gr_comm_oob_get_ptr(peer, index, ptr, size);
}
void vgpu_ivc_oob_put_ptr(void *handle)
{
tegra_gr_comm_oob_put_ptr(handle);
}