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>
This commit is contained in:
Nitin Kumbhar
2018-08-10 10:34:17 +05:30
committed by mobile promotions
parent 18e060227d
commit 94eebcdd8c
13 changed files with 201 additions and 58 deletions

View File

@@ -1791,24 +1791,3 @@ int gk20a_mark_compressible_write(struct gk20a *g, u32 buffer_fd,
dma_buf_put(dmabuf);
return 0;
}
int nvgpu_cde_init_ops(struct nvgpu_os_linux *l)
{
struct gk20a *g = &l->g;
u32 ver = g->params.gpu_arch + g->params.gpu_impl;
switch (ver) {
case GK20A_GPUID_GM20B:
case GK20A_GPUID_GM20B_B:
l->ops.cde = gm20b_cde_ops.cde;
break;
case NVGPU_GPUID_GP10B:
l->ops.cde = gp10b_cde_ops.cde;
break;
default:
/* CDE is optional, so today ignoring unknown chip is fine */
break;
}
return 0;
}