From 974f72b104459ebbcc78361aa68444b2c28e20ff Mon Sep 17 00:00:00 2001 From: Lakshmanan M Date: Tue, 22 Oct 2019 11:37:42 +0530 Subject: [PATCH] gpu: nvgpu: add @file syntax in mm header files Add @file syntax in the following mm header files, 1) page_allocator.h 2) kmem.h 3) gmmu.h 4) pd_cache.h 5) pd_cache_priv.h JIRA NVGPU-4105 Change-Id: Ifa8b9ef5f0d11608a5d6f165ba64566a32596972 Signed-off-by: Lakshmanan M Reviewed-on: https://git-master.nvidia.com/r/2223012 Reviewed-by: Rajesh Devaraj Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- .../gpu/nvgpu/common/mm/gmmu/pd_cache_priv.h | 25 +++++++++-------- drivers/gpu/nvgpu/include/nvgpu/gmmu.h | 6 +++++ drivers/gpu/nvgpu/include/nvgpu/kmem.h | 27 ++++++++----------- .../gpu/nvgpu/include/nvgpu/page_allocator.h | 27 +++++++++++-------- drivers/gpu/nvgpu/include/nvgpu/pd_cache.h | 7 +++++ 5 files changed, 54 insertions(+), 38 deletions(-) diff --git a/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache_priv.h b/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache_priv.h index a1f91e49a..2e2d6562c 100644 --- a/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache_priv.h +++ b/drivers/gpu/nvgpu/common/mm/gmmu/pd_cache_priv.h @@ -23,18 +23,11 @@ #ifndef NVGPU_GMMU_PD_CACHE_PRIV_H #define NVGPU_GMMU_PD_CACHE_PRIV_H -#include -#include -#include -#include -#include -#include -#include - -#define pd_dbg(g, fmt, args...) nvgpu_log(g, gpu_dbg_pd_cache, fmt, ##args) - /** - * DOC: PD cache + * @file + * + * Page directory cache private interface + * -------------------------------------- * * To save memory when using sub-page sized PD levels in Pascal and beyond a way * of packing PD tables together is necessary. If a PD table only requires 1024 @@ -73,6 +66,16 @@ * allocated by nvgpu_pd_alloc(). */ +#include +#include +#include +#include +#include +#include +#include + +#define pd_dbg(g, fmt, args...) nvgpu_log(g, gpu_dbg_pd_cache, fmt, ##args) + /** * Minimum size of a cache. The number of different caches in the nvgpu_pd_cache * structure is of course depending on this. diff --git a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h index e155da8cc..4c888a234 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/gmmu.h +++ b/drivers/gpu/nvgpu/include/nvgpu/gmmu.h @@ -23,6 +23,12 @@ #ifndef NVGPU_GMMU_H #define NVGPU_GMMU_H +/** + * @file + * + * GMMU interface. + */ + #include #include #include diff --git a/drivers/gpu/nvgpu/include/nvgpu/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/kmem.h index 620b2d57d..7fcdb6326 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/kmem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/kmem.h @@ -26,7 +26,17 @@ /** * @file * - * Abstract interface for interacting with general Process memory. + * Kmem cache support + * ------------------ + * + * In Linux there is support for the notion of a kmem_cache. It gives better + * memory usage characteristics for lots of allocations of the same size. Think + * structs that get allocated over and over. Normal kmalloc() type routines + * typically round to the next power-of-2 since that's easy. + * + * But if we know the size ahead of time the packing for the allocations can be + * much better. This is the benefit of a slab allocator. This type hides the + * underlying kmem_cache (or absense thereof). */ #include @@ -44,21 +54,6 @@ struct gk20a; #include #endif -/** - * @file - * - * Kmem cache support - * ------------------ - * - * In Linux there is support for the notion of a kmem_cache. It gives better - * memory usage characteristics for lots of allocations of the same size. Think - * structs that get allocated over and over. Normal kmalloc() type routines - * typically round to the next power-of-2 since that's easy. - * - * But if we know the size ahead of time the packing for the allocations can be - * much better. This is the benefit of a slab allocator. This type hides the - * underlying kmem_cache (or absense thereof). - */ struct nvgpu_kmem_cache; #ifdef CONFIG_NVGPU_TRACK_MEM_USAGE diff --git a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h index 4ac1ff67f..47e8b80bc 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/page_allocator.h @@ -23,18 +23,12 @@ #ifndef PAGE_ALLOCATOR_PRIV_H #define PAGE_ALLOCATOR_PRIV_H -#ifdef CONFIG_NVGPU_DGPU - -#include -#include -#include -#include -#include -#include - -struct nvgpu_allocator; - /** + * @file + * + * Page allocator interface + * ------------------------ + * * This allocator implements the ability to do SLAB style allocation since the * GPU has two page sizes available - 4k and 64k/128k. When the default * granularity is the large page size (64k/128k) small allocations become very @@ -54,6 +48,17 @@ struct nvgpu_allocator; * assumed to be 64k) the allocation is satisfied by one of the buckets. */ +#ifdef CONFIG_NVGPU_DGPU + +#include +#include +#include +#include +#include +#include + +struct nvgpu_allocator; + /** * Structure to identify slab allocations. */ diff --git a/drivers/gpu/nvgpu/include/nvgpu/pd_cache.h b/drivers/gpu/nvgpu/include/nvgpu/pd_cache.h index f9eb6ffeb..1426db648 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/pd_cache.h +++ b/drivers/gpu/nvgpu/include/nvgpu/pd_cache.h @@ -23,6 +23,13 @@ #ifndef NVGPU_PD_CACHE_H #define NVGPU_PD_CACHE_H +/** + * @file + * + * Page directory cache interface. + */ + + #include struct gk20a;