mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
Store nvgpu_cdev pointer in struct tsg_private and assign it in nvgpu_ioctl_tsg_open. In gk20a_tsg_ioctl_bind_channel_ex(), extract gpu_instance_id from cdev pointer and then extract instance specific max VEID count from gpu_instance_id. Use this max veid count to validate subcontext id coming from user. Jira NVGPU-5648 Change-Id: I71cea5180e1ced1a72818d160f1a951c1c6ec770 Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2438925 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
32 lines
1.1 KiB
C
32 lines
1.1 KiB
C
/*
|
|
* Copyright (c) 2017-2020, 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.
|
|
*/
|
|
#ifndef NVGPU_IOCTL_TSG_H
|
|
#define NVGPU_IOCTL_TSG_H
|
|
|
|
struct inode;
|
|
struct file;
|
|
struct gk20a;
|
|
struct nvgpu_ref;
|
|
struct nvgpu_cdev;
|
|
|
|
struct nvgpu_tsg *nvgpu_tsg_get_from_file(int fd);
|
|
|
|
int nvgpu_ioctl_tsg_dev_release(struct inode *inode, struct file *filp);
|
|
int nvgpu_ioctl_tsg_dev_open(struct inode *inode, struct file *filp);
|
|
int nvgpu_ioctl_tsg_open(struct gk20a *g, struct nvgpu_cdev *cdev, struct file *filp);
|
|
long nvgpu_ioctl_tsg_dev_ioctl(struct file *filp,
|
|
unsigned int cmd, unsigned long arg);
|
|
void nvgpu_ioctl_tsg_release(struct nvgpu_ref *ref);
|
|
|
|
#endif
|