mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
Include mm_gp106.h in mm_gp106.c to bring function declarations visible and to fix a Sparse warning. Bug 200088648 Change-Id: Id76f565021de585bc02a53a01e52084ff70009c2 Signed-off-by: Konsta Holtta <kholtta@nvidia.com> Reviewed-on: http://git-master/r/1161607 GVS: Gerrit_Virtual_Submit Reviewed-by: Sachin Nikam <snikam@nvidia.com>
41 lines
1.2 KiB
C
41 lines
1.2 KiB
C
/*
|
|
* GP106 memory management
|
|
*
|
|
* 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.
|
|
*/
|
|
|
|
#include "gk20a/gk20a.h"
|
|
#include "gp10b/mm_gp10b.h"
|
|
#include "gp106/mm_gp106.h"
|
|
|
|
#include "hw_fb_gp106.h"
|
|
|
|
static size_t gp106_mm_get_vidmem_size(struct gk20a *g)
|
|
{
|
|
u32 range = gk20a_readl(g, fb_mmu_local_memory_range_r());
|
|
u32 mag = fb_mmu_local_memory_range_lower_mag_v(range);
|
|
u32 scale = fb_mmu_local_memory_range_lower_scale_v(range);
|
|
u32 ecc = fb_mmu_local_memory_range_ecc_mode_v(range);
|
|
size_t bytes = ((size_t)mag << scale) * SZ_1M;
|
|
|
|
if (ecc)
|
|
bytes = bytes / 16 * 15;
|
|
|
|
return bytes;
|
|
}
|
|
|
|
void gp106_init_mm(struct gpu_ops *gops)
|
|
{
|
|
gp10b_init_mm(gops);
|
|
gops->mm.get_vidmem_size = gp106_mm_get_vidmem_size;
|
|
}
|