From 6f24a7666045b25072282d4c29ff190b7af33e59 Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Thu, 2 Jun 2016 09:44:13 +0530 Subject: gpu: nvgpu: Add multiple engine and runlist support This CL covers the following modification, 1) Added multiple engine_info support 2) Added multiple runlist_info support 3) Initial changes for ASYNC CE support 4) Added ASYNC CE interrupt support for Volta GPU series 5) Removed hard coded engine_id logic and made generic way 6) Code cleanup for readability JIRA DNVGPU-26 Change-Id: Ief3b586ff3d9f492f0277243b2a94952bab48786 Signed-off-by: Lakshmanan M Reviewed-on: http://git-master/r/1156023 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom --- drivers/gpu/nvgpu/Makefile | 2 +- drivers/gpu/nvgpu/gv11b/ce2_gv11b.c | 28 ------------ drivers/gpu/nvgpu/gv11b/ce2_gv11b.h | 27 ------------ drivers/gpu/nvgpu/gv11b/ce_gv11b.c | 27 ++++++++++++ drivers/gpu/nvgpu/gv11b/ce_gv11b.h | 26 +++++++++++ drivers/gpu/nvgpu/gv11b/gr_gv11b.c | 5 ++- drivers/gpu/nvgpu/gv11b/hal_gv11b.c | 4 +- drivers/gpu/nvgpu/gv11b/hw_ce2_gv11b.h | 81 ---------------------------------- drivers/gpu/nvgpu/gv11b/hw_ce_gv11b.h | 81 ++++++++++++++++++++++++++++++++++ 9 files changed, 141 insertions(+), 140 deletions(-) delete mode 100644 drivers/gpu/nvgpu/gv11b/ce2_gv11b.c delete mode 100644 drivers/gpu/nvgpu/gv11b/ce2_gv11b.h create mode 100644 drivers/gpu/nvgpu/gv11b/ce_gv11b.c create mode 100644 drivers/gpu/nvgpu/gv11b/ce_gv11b.h delete mode 100644 drivers/gpu/nvgpu/gv11b/hw_ce2_gv11b.h create mode 100644 drivers/gpu/nvgpu/gv11b/hw_ce_gv11b.h (limited to 'drivers') diff --git a/drivers/gpu/nvgpu/Makefile b/drivers/gpu/nvgpu/Makefile index 4761ba6e..4ea56d8e 100644 --- a/drivers/gpu/nvgpu/Makefile +++ b/drivers/gpu/nvgpu/Makefile @@ -10,7 +10,7 @@ nvgpu-y += \ $(nvgpu-t19x)/gv11b/fb_gv11b.o \ $(nvgpu-t19x)/gv11b/fifo_gv11b.o \ $(nvgpu-t19x)/gv11b/mm_gv11b.o \ - $(nvgpu-t19x)/gv11b/ce2_gv11b.o \ + $(nvgpu-t19x)/gv11b/ce_gv11b.o \ $(nvgpu-t19x)/gv11b/gr_ctx_gv11b.o \ $(nvgpu-t19x)/gv11b/pmu_gv11b.o \ $(nvgpu-t19x)/gv11b/therm_gv11b.o diff --git a/drivers/gpu/nvgpu/gv11b/ce2_gv11b.c b/drivers/gpu/nvgpu/gv11b/ce2_gv11b.c deleted file mode 100644 index d4ba4003..00000000 --- a/drivers/gpu/nvgpu/gv11b/ce2_gv11b.c +++ /dev/null @@ -1,28 +0,0 @@ -/* - * GV11B Graphics Copy Engine (gr host) - * - * 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. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#include "gk20a/gk20a.h" /* FERMI and MAXWELL classes defined here */ -#include "hw_ce2_gv11b.h" -#include "gp10b/ce2_gp10b.h" -#include "ce2_gv11b.h" - -void gv11b_init_ce2(struct gpu_ops *gops) -{ - gp10b_init_ce2(gops); -} diff --git a/drivers/gpu/nvgpu/gv11b/ce2_gv11b.h b/drivers/gpu/nvgpu/gv11b/ce2_gv11b.h deleted file mode 100644 index a7b2f99a..00000000 --- a/drivers/gpu/nvgpu/gv11b/ce2_gv11b.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * - * GV11B graphics copy engine - * - * 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. - * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. - */ -#ifndef __CE2_GV11B_H__ -#define __CE2_GV11B_H__ - -struct gpu_ops; - -void gv11b_init_ce2(struct gpu_ops *gops); - -#endif /*__CE2_GV11B_H__*/ diff --git a/drivers/gpu/nvgpu/gv11b/ce_gv11b.c b/drivers/gpu/nvgpu/gv11b/ce_gv11b.c new file mode 100644 index 00000000..961054e0 --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/ce_gv11b.c @@ -0,0 +1,27 @@ +/* + * Volta GPU series Copy Engine. + * + * 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. + * + * You should have received a copy of the GNU General Public License along with + * this program. + */ + +#include "gk20a/gk20a.h" /* FERMI and MAXWELL classes defined here */ +#include "hw_ce_gv11b.h" +#include "gp10b/ce_gp10b.h" +#include "ce_gv11b.h" + +void gv11b_init_ce(struct gpu_ops *gops) +{ + gp10b_init_ce(gops); +} diff --git a/drivers/gpu/nvgpu/gv11b/ce_gv11b.h b/drivers/gpu/nvgpu/gv11b/ce_gv11b.h new file mode 100644 index 00000000..27dffa5d --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/ce_gv11b.h @@ -0,0 +1,26 @@ +/* + * + * Volta GPU series copy engine + * + * 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. + * + * You should have received a copy of the GNU General Public License along with + * this program. + */ +#ifndef __CE_GV11B_H__ +#define __CE_GV11B_H__ + +struct gpu_ops; + +void gv11b_init_ce(struct gpu_ops *gops); + +#endif /*__CE2_GV11B_H__*/ diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c index ad8e4eff..a4301fa9 100644 --- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.c @@ -1062,6 +1062,9 @@ static int gr_gv11b_dump_gr_status_regs(struct gk20a *g, struct gk20a_debug_output *o) { struct gr_gk20a *gr = &g->gr; + u32 gr_engine_id; + + gr_engine_id = gk20a_fifo_get_gr_engine_id(g); gk20a_debug_output(o, "NV_PGRAPH_STATUS: 0x%x\n", gk20a_readl(g, gr_status_r())); @@ -1082,7 +1085,7 @@ static int gr_gv11b_dump_gr_status_regs(struct gk20a *g, gk20a_debug_output(o, "NV_PGRAPH_FECS_INTR : 0x%x\n", gk20a_readl(g, gr_fecs_intr_r())); gk20a_debug_output(o, "NV_PFIFO_ENGINE_STATUS(GR) : 0x%x\n", - gk20a_readl(g, fifo_engine_status_r(ENGINE_GR_GK20A))); + gk20a_readl(g, fifo_engine_status_r(gr_engine_id))); gk20a_debug_output(o, "NV_PGRAPH_ACTIVITY0: 0x%x\n", gk20a_readl(g, gr_activity_0_r())); gk20a_debug_output(o, "NV_PGRAPH_ACTIVITY1: 0x%x\n", diff --git a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c index e340c97e..876b5748 100644 --- a/drivers/gpu/nvgpu/gv11b/hal_gv11b.c +++ b/drivers/gpu/nvgpu/gv11b/hal_gv11b.c @@ -26,7 +26,7 @@ #include "gv11b/ltc_gv11b.h" #include "gv11b/fecs_trace_gv11b.h" #include "gv11b/gv11b.h" -#include "gv11b/ce2_gv11b.h" +#include "gv11b/ce_gv11b.h" #include "gv11b/gr_ctx_gv11b.h" #include "gv11b/mm_gv11b.h" #include "gv11b/pmu_gv11b.h" @@ -47,7 +47,7 @@ int gv11b_init_hal(struct gk20a *g) gv11b_init_ltc(gops); gv11b_init_gr(gops); gv11b_init_fecs_trace_ops(gops); - gv11b_init_ce2(gops); + gv11b_init_ce(gops); gv11b_init_mm(gops); gv11b_init_gr_ctx(gops); gv11b_init_pmu_ops(gops); diff --git a/drivers/gpu/nvgpu/gv11b/hw_ce2_gv11b.h b/drivers/gpu/nvgpu/gv11b/hw_ce2_gv11b.h deleted file mode 100644 index e58bf271..00000000 --- a/drivers/gpu/nvgpu/gv11b/hw_ce2_gv11b.h +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -/* - * Function naming determines intended use: - * - * _r(void) : Returns the offset for register . - * - * _o(void) : Returns the offset for element . - * - * _w(void) : Returns the word offset for word (4 byte) element . - * - * __s(void) : Returns size of field of register in bits. - * - * __f(u32 v) : Returns a value based on 'v' which has been shifted - * and masked to place it at field of register . This value - * can be |'d with others to produce a full register value for - * register . - * - * __m(void) : Returns a mask for field of register . This - * value can be ~'d and then &'d to clear the value of field for - * register . - * - * ___f(void) : Returns the constant value after being shifted - * to place it at field of register . This value can be |'d - * with others to produce a full register value for . - * - * __v(u32 r) : Returns the value of field from a full register - * value 'r' after being shifted to place its LSB at bit 0. - * This value is suitable for direct comparison with other unshifted - * values appropriate for use in field of register . - * - * ___v(void) : Returns the constant value for defined for - * field of register . This value is suitable for direct - * comparison with unshifted values appropriate for use in field - * of register . - */ -#ifndef _hw_ce2_gv11b_h_ -#define _hw_ce2_gv11b_h_ - -static inline u32 ce2_intr_status_r(u32 i) -{ - return 0x00104410 + i*128; -} -static inline u32 ce2_intr_status_blockpipe_pending_f(void) -{ - return 0x1; -} -static inline u32 ce2_intr_status_blockpipe_reset_f(void) -{ - return 0x1; -} -static inline u32 ce2_intr_status_nonblockpipe_pending_f(void) -{ - return 0x2; -} -static inline u32 ce2_intr_status_nonblockpipe_reset_f(void) -{ - return 0x2; -} -static inline u32 ce2_intr_status_launcherr_pending_f(void) -{ - return 0x4; -} -static inline u32 ce2_intr_status_launcherr_reset_f(void) -{ - return 0x4; -} -#endif diff --git a/drivers/gpu/nvgpu/gv11b/hw_ce_gv11b.h b/drivers/gpu/nvgpu/gv11b/hw_ce_gv11b.h new file mode 100644 index 00000000..9f279207 --- /dev/null +++ b/drivers/gpu/nvgpu/gv11b/hw_ce_gv11b.h @@ -0,0 +1,81 @@ +/* + * 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. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ +/* + * Function naming determines intended use: + * + * _r(void) : Returns the offset for register . + * + * _o(void) : Returns the offset for element . + * + * _w(void) : Returns the word offset for word (4 byte) element . + * + * __s(void) : Returns size of field of register in bits. + * + * __f(u32 v) : Returns a value based on 'v' which has been shifted + * and masked to place it at field of register . This value + * can be |'d with others to produce a full register value for + * register . + * + * __m(void) : Returns a mask for field of register . This + * value can be ~'d and then &'d to clear the value of field for + * register . + * + * ___f(void) : Returns the constant value after being shifted + * to place it at field of register . This value can be |'d + * with others to produce a full register value for . + * + * __v(u32 r) : Returns the value of field from a full register + * value 'r' after being shifted to place its LSB at bit 0. + * This value is suitable for direct comparison with other unshifted + * values appropriate for use in field of register . + * + * ___v(void) : Returns the constant value for defined for + * field of register . This value is suitable for direct + * comparison with unshifted values appropriate for use in field + * of register . + */ +#ifndef _hw_ce_gv11b_h_ +#define _hw_ce_gv11b_h_ + +static inline u32 ce_intr_status_r(u32 i) +{ + return 0x00104410 + i*128; +} +static inline u32 ce_intr_status_blockpipe_pending_f(void) +{ + return 0x1; +} +static inline u32 ce_intr_status_blockpipe_reset_f(void) +{ + return 0x1; +} +static inline u32 ce_intr_status_nonblockpipe_pending_f(void) +{ + return 0x2; +} +static inline u32 ce_intr_status_nonblockpipe_reset_f(void) +{ + return 0x2; +} +static inline u32 ce_intr_status_launcherr_pending_f(void) +{ + return 0x4; +} +static inline u32 ce_intr_status_launcherr_reset_f(void) +{ + return 0x4; +} +#endif -- cgit v1.2.2