gpu: nvgpu: Allow disabling CDE functionality

CDE is a Tegra SoC specific feature. Add new config option
CONFIG_NVGPU_SUPPORT_CDE and #ifdef all CDE specific code with it.

JIRA NVGPU-4

Change-Id: I6f0b0047d6ba2b5c36c2eb9b8a1514776741f5b5
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1648002
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2018-01-24 12:42:57 -08:00
committed by mobile promotions
parent b6ab47d396
commit 662c441467
12 changed files with 79 additions and 29 deletions

View File

@@ -44,6 +44,8 @@
#include "os_linux.h"
#include "dmabuf.h"
#include "channel.h"
#include "cde_gm20b.h"
#include "cde_gp10b.h"
#include <nvgpu/hw/gk20a/hw_ccsr_gk20a.h>
#include <nvgpu/hw/gk20a/hw_pbdma_gk20a.h>
@@ -1749,3 +1751,24 @@ 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;
}