From 39f3a8b89fbd7589bb911d64f894c0c7d56fb694 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 15 Jun 2016 10:23:43 +0530 Subject: gpu: nvgpu: Add fifo conf support for gp10x Added fifo configuration support for gp104 and gp106. These GPU chips have more number of channel fifo and runlist than gp10b. Added get_num_fifos and eng_runlist_base_size function pointer to find out the actual value from HW headers. JIRA DNVGPU-25 Change-Id: I2322a6354eaa2af2b2605f3e9eedebf9827c7dda Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1164653 Reviewed-by: Konsta Holtta GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/Makefile | 3 ++- drivers/gpu/nvgpu/gp106/fifo_gp106.c | 30 ++++++++++++++++++++++++++++++ drivers/gpu/nvgpu/gp106/fifo_gp106.h | 18 ++++++++++++++++++ drivers/gpu/nvgpu/gp106/hal_gp106.c | 4 ++-- 4 files changed, 52 insertions(+), 3 deletions(-) create mode 100644 drivers/gpu/nvgpu/gp106/fifo_gp106.c create mode 100644 drivers/gpu/nvgpu/gp106/fifo_gp106.h (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 1579e6eb..643c0967 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -25,7 +25,8 @@ nvgpu-y += \ $(nvgpu-t18x)/gp106/gr_gp106.o \ $(nvgpu-t18x)/gp106/gr_ctx_gp106.o \ $(nvgpu-t18x)/gp106/acr_gp106.o \ - $(nvgpu-t18x)/gp106/sec2_gp106.o + $(nvgpu-t18x)/gp106/sec2_gp106.o \ + $(nvgpu-t18x)/gp106/fifo_gp106.o nvgpu-$(CONFIG_TEGRA_GK20A) += $(nvgpu-t18x)/gp10b/platform_gp10b_tegra.o diff --git a/drivers/gpu/nvgpu/gp106/fifo_gp106.c b/drivers/gpu/nvgpu/gp106/fifo_gp106.c new file mode 100644 index 00000000..3c70d517 --- /dev/null +++ b/drivers/gpu/nvgpu/gp106/fifo_gp106.c @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2016, 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. + */ + +#include "gk20a/gk20a.h" +#include "gp10b/fifo_gp10b.h" +#include "fifo_gp106.h" +#include "hw_ccsr_gp106.h" +#include "hw_fifo_gp106.h" + +static u32 gp106_fifo_get_num_fifos(struct gk20a *g) +{ + return ccsr_channel__size_1_v(); +} + +void gp106_init_fifo(struct gpu_ops *gops) +{ + gp10b_init_fifo(gops); + gops->fifo.get_num_fifos = gp106_fifo_get_num_fifos; + gops->fifo.eng_runlist_base_size = fifo_eng_runlist_base__size_1_v; +} diff --git a/drivers/gpu/nvgpu/gp106/fifo_gp106.h b/drivers/gpu/nvgpu/gp106/fifo_gp106.h new file mode 100644 index 00000000..1bcec9ef --- /dev/null +++ b/drivers/gpu/nvgpu/gp106/fifo_gp106.h @@ -0,0 +1,18 @@ +/* + * Copyright (c) 2016, 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_FIFO_GP106_H +#define NVGPU_FIFO_GP106_H +struct gpu_ops; +void gp106_init_fifo(struct gpu_ops *gops); +#endif diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index 1b22547d..f9cd2e07 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c @@ -26,7 +26,7 @@ #include "gp10b/mm_gp10b.h" #include "gp10b/ce_gp10b.h" #include "gp10b/fb_gp10b.h" -#include "gp10b/fifo_gp10b.h" +#include "gp106/fifo_gp106.h" #include "gp10b/gp10b_gating_reglist.h" #include "gp10b/regops_gp10b.h" #include "gp10b/cde_gp10b.h" @@ -193,7 +193,7 @@ int gp106_init_hal(struct gk20a *g) gp106_init_gr(gops); gp10b_init_ltc(gops); gp10b_init_fb(gops); - gp10b_init_fifo(gops); + gp106_init_fifo(gops); gp10b_init_ce(gops); gp106_init_gr_ctx(gops); gp106_init_mm(gops); -- cgit v1.2.2