From ee2aaef308025a0df3ca566da8102e9398aa7dfe Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Wed, 16 Jun 2021 16:10:44 +0530 Subject: [PATCH] gpu: nvgpu: Report non zero num_sub_partition_per_fbpa value only for dGPU All Tegra iGPUs don't have real FBPA/FBSP units at all. So num_sub_partition_per_fbpa should be 0 for iGPUs. JIRA NVGPU-5656 Change-Id: I30050caf8f9f6b5185404a64dbbbe02f67046093 Signed-off-by: Lakshmanan M Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2545978 Tested-by: mobile promotions Reviewed-by: svc_kernel_abi Reviewed-by: Dinesh T Reviewed-by: Vaibhav Kachore Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c index 257b54ceb..9abfe4ecc 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_ctrl.c @@ -474,10 +474,23 @@ static long gk20a_ctrl_ioctl_gpu_characteristics( gpu.lts_per_ltc = nvgpu_ltc_get_slices_per_ltc(g); gpu.cbc_cache_line_size = nvgpu_ltc_get_cacheline_size(g); - /* All nvgpu supported GPUs have 64 bit FBIO channel - * So number of Sub partition per FBPA is always 0x2. + /* + * TODO : Need to replace with proper HAL. */ - gpu.num_sub_partition_per_fbpa = 0x2; + if (g->pci_device_id != (u16)0) { + /* All nvgpu supported dGPUs have 64 bit FBIO channel + * So number of Sub partition per FBPA is always 0x2. + * Half FBPA (32BIT channel mode) enablement + * (1 sub partition per FBPA) is disabled for tegra dGPUs. + */ + gpu.num_sub_partition_per_fbpa = 0x2; + } else { + /* + * All iGPUs don't have real FBPA/FBSP units at all. + * So num_sub_partition_per_fbpa should be 0 for iGPUs. + */ + gpu.num_sub_partition_per_fbpa = 0x00; + } if ((g->ops.clk.get_maxrate) && nvgpu_platform_is_silicon(g)) { gpu.max_freq = g->ops.clk.get_maxrate(g,