From 9e4bbd2c9b4d5d9712921a7db058061e4f8cd389 Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Thu, 30 Aug 2018 14:52:16 -0700 Subject: gpu: nvgpu: Add configurable comptag_mem_deduct sysfs node per device Adding a comptag_mem_deduct in the platform_gk20a has certain problems: 1) It's not really convenient for platform users to configure it. 2) All products using the same GPU have to share the same configuration. So this patch moves this comptag_mem_deduct from struct platform_gk20a to struct gr_gk20a (per device). And it adds an sysfs node for products or platform users to easily configure from user space. Note: The comptag memory will not be allocated until the GPU driver goes through the final poweron routine. So the user space has a small window to configure this sysfs node. Bug 2327574 Bug 2284925 Change-Id: Ie7d00b082704e422645c0ea254b59e22f9fc3b7f Signed-off-by: Nicolin Chen Reviewed-on: https://git-master.nvidia.com/r/1810334 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h index 303e1f53..44b6de8d 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.h @@ -373,6 +373,12 @@ struct gr_gk20a { u32 gfxp_wfi_timeout_count; u32 gfxp_wfi_timeout_unit; + /* + * The deductible memory size for max_comptag_mem (in MBytes) + * Usually close to memory size that running system is taking + */ + u32 comptag_mem_deduct; + struct gr_ctx_buffer_desc global_ctx_buffer[NR_GLOBAL_CTX_BUF]; struct nvgpu_mem mmu_wr_mem; -- cgit v1.2.2