From 1a7484c901fe1abe0c35593ec96ff10e162099c4 Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Thu, 25 Jan 2018 15:31:18 +0200 Subject: gpu: nvgpu: ce: store fences in a separate array Simplify the copyengine code massively by storing the job post fence pointers in an array of fences instead of mixing them up in the command buffer memory. The post fences are used when the ring buffer of a context gets full and we need to wait for the oldest slot to free up. NVGPU-43 NVGPU-52 Change-Id: I36969e19676bec0f38de9a6357767a8d5cbcd329 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1646037 Reviewed-by: svc-mobile-coverity Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/ce2_gk20a.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/gk20a/ce2_gk20a.h') diff --git a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h index 0b475f65..1a102070 100644 --- a/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/ce2_gk20a.h @@ -36,9 +36,8 @@ int gk20a_ce2_nonstall_isr(struct gk20a *g, u32 inst_id, u32 pri_base); #define NVGPU_CE_LOWER_ADDRESS_OFFSET_MASK 0xffffffff #define NVGPU_CE_UPPER_ADDRESS_OFFSET_MASK 0xff -#define NVGPU_CE_COMMAND_BUF_SIZE 8192 -#define NVGPU_CE_MAX_COMMAND_BUFF_SIZE_PER_KICKOFF 256 -#define NVGPU_CE_MAX_COMMAND_BUFF_SIZE_FOR_TRACING 8 +#define NVGPU_CE_MAX_INFLIGHT_JOBS 32 +#define NVGPU_CE_MAX_COMMAND_BUFF_BYTES_PER_KICKOFF 256 /* dma launch_flags */ enum { @@ -106,11 +105,11 @@ struct gk20a_gpu_ctx { /* cmd buf mem_desc */ struct nvgpu_mem cmd_buf_mem; + struct gk20a_fence *postfences[NVGPU_CE_MAX_INFLIGHT_JOBS]; struct nvgpu_list_node list; u32 cmd_buf_read_queue_offset; - u32 cmd_buf_end_queue_offset; }; static inline struct gk20a_gpu_ctx * -- cgit v1.2.2