From b07a304ba3e747c80fe3e0a16caec88c8e1e8b28 Mon Sep 17 00:00:00 2001 From: Terje Bergstrom Date: Tue, 10 Jul 2018 09:54:10 -0700 Subject: gpu: nvgpu: Use HAL for calls from MM to FB mm_gv11b.c has several direct calls to fb_gv11b.h. Redirect them to go via a HAL. Also make sure the HALs are using parameter with correct signedness and prefix the parameter constants with NVGPU_FB_MMU_. MMU buffer table indices were also defined in fb_gv11b.h, even though the tables themselves are defined in include/nvgpu/mm.h. Move the indices to include/nvgpu/mm.h and prefix them with NVGPU_MM_MMU_. JIRA NVGPU-714 Change-Id: Ieeae7c5664b8f53f8313cfad0a771d14637caa08 Signed-off-by: Terje Bergstrom Reviewed-on: https://git-master.nvidia.com/r/1776131 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gk20a.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index b59baa78..4ff85ee3 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -162,6 +162,13 @@ struct nvgpu_gpfifo_userdata { * should go in struct gk20a or be implemented with the boolean flag API defined * in nvgpu/enabled.h */ + +/* index for FB fault buffer functions */ +#define NVGPU_FB_MMU_FAULT_NONREPLAY_REG_INDEX 0U +#define NVGPU_FB_MMU_FAULT_REPLAY_REG_INDEX 1U +#define NVGPU_FB_MMU_FAULT_BUF_DISABLED 0U +#define NVGPU_FB_MMU_FAULT_BUF_ENABLED 1U + struct gpu_ops { struct { int (*determine_L2_size_bytes)(struct gk20a *gk20a); @@ -564,6 +571,11 @@ struct gpu_ops { u32 (*read_mmu_fault_status)(struct gk20a *g); int (*mmu_invalidate_replay)(struct gk20a *g, u32 invalidate_replay_val); + bool (*mmu_fault_pending)(struct gk20a *g); + bool (*is_fault_buf_enabled)(struct gk20a *g, u32 index); + void (*fault_buf_set_state_hw)(struct gk20a *g, + u32 index, u32 state); + void (*fault_buf_configure_hw)(struct gk20a *g, u32 index); } fb; struct { void (*slcg_bus_load_gating_prod)(struct gk20a *g, bool prod); -- cgit v1.2.2