summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/os/linux/os_ops.c
diff options
context:
space:
mode:
authorNitin Kumbhar <nkumbhar@nvidia.com>2018-08-10 01:04:17 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-29 23:34:34 -0400
commit94eebcdd8cacc9a2dc20485e0d3d15fc51507c2c (patch)
treed69221db59a680e1e45f44f397b8106f2db34816 /drivers/gpu/nvgpu/os/linux/os_ops.c
parent18e060227da92e4df8f2e5400fec7f6d7bdaad4a (diff)
gpu: nvgpu: linux: move os ops to a common file
Currently only cde uses nvgpu_os_linux_ops to set up linux specific ops. Move nvgpu_os_linux_ops of a gpu to a common file so that those can be reused for other os ops of that gpu. JIRA NVGPU-603 Change-Id: Icf1ff275d3832229137f730fe8183b8015e82673 Signed-off-by: Nitin Kumbhar <nkumbhar@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1797902 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/os_ops.c')
-rw-r--r--drivers/gpu/nvgpu/os/linux/os_ops.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/os_ops.c b/drivers/gpu/nvgpu/os/linux/os_ops.c
new file mode 100644
index 00000000..14f92787
--- /dev/null
+++ b/drivers/gpu/nvgpu/os/linux/os_ops.c
@@ -0,0 +1,40 @@
1/*
2 * Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "os_linux.h"
18
19#include "os_ops_gm20b.h"
20#include "os_ops_gp10b.h"
21
22int nvgpu_init_os_linux_ops(struct nvgpu_os_linux *l)
23{
24 struct gk20a *g = &l->g;
25 u32 ver = g->params.gpu_arch + g->params.gpu_impl;
26
27 switch (ver) {
28 case GK20A_GPUID_GM20B:
29 case GK20A_GPUID_GM20B_B:
30 nvgpu_gm20b_init_os_ops(l);
31 break;
32 case NVGPU_GPUID_GP10B:
33 nvgpu_gp10b_init_os_ops(l);
34 break;
35 default:
36 break;
37 }
38
39 return 0;
40}