From 8d311e5a91df62d8a6425d7593abb4df989d3ae9 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 1 Feb 2016 12:33:56 +0530 Subject: [PATCH] gpu: nvgpu: add max freq to gpu characteristics Bug 200097029 Change-Id: Id63dad1629b1d1919cbbfb20b0cb85d4855f526d Signed-off-by: Deepak Nibade Reviewed-on: http://git-master/r/1000724 Reviewed-by: Terje Bergstrom Tested-by: Terje Bergstrom --- drivers/gpu/nvgpu/gk20a/gk20a.c | 3 +++ include/uapi/linux/nvgpu.h | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 1000eba2d..4ddb244b9 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c @@ -1962,6 +1962,7 @@ int gk20a_do_unidle(void) int gk20a_init_gpu_characteristics(struct gk20a *g) { struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; + struct gk20a_platform *platform = platform_get_drvdata(g->dev); gpu->L2_cache_size = g->ops.ltc.determine_L2_size_bytes(g); gpu->on_board_video_memory_size = 0; /* integrated GPU */ @@ -2029,6 +2030,8 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) gpu->map_buffer_batch_limit = 256; + gpu->max_freq = platform->clk_round_rate(g->dev, UINT_MAX); + return 0; } diff --git a/include/uapi/linux/nvgpu.h b/include/uapi/linux/nvgpu.h index 1172a07e5..984d13197 100644 --- a/include/uapi/linux/nvgpu.h +++ b/include/uapi/linux/nvgpu.h @@ -1,7 +1,7 @@ /* * NVGPU Public Interface Header * - * Copyright (c) 2011-2015, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2011-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, @@ -179,6 +179,8 @@ struct nvgpu_gpu_characteristics { * num_maps */ __u32 map_buffer_batch_limit; + __u64 max_freq; + /* Notes: - This struct can be safely appended with new fields. However, always keep the structure size multiple of 8 and make sure that the binary