summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_arb.h
diff options
context:
space:
mode:
authorThomas Fleury <tfleury@nvidia.com>2016-09-13 17:23:45 -0400
committerDeepak Nibade <dnibade@nvidia.com>2016-12-27 04:56:51 -0500
commit3d9c33c5953e383527c7e4af594adfe0c82b5788 (patch)
tree6de4ae86667c763ed0deef3add9336b570ca15ff /drivers/gpu/nvgpu/clk/clk_arb.h
parentc320ccfa952a2796db27d97111791bcbeff9f5c7 (diff)
gpu: nvgpu: clk arbiter skeleton
Add clock arbiter skeleton with support of clock sessions, notifications on clock changes, request numbering, and asynchronous handling of clock requests. Provides minimum behaviour to allow unit tests implementation. Actual arbitration and clock settings will be done separately. For now, dummy arbiter keeps last requested target mhz. Actual arbiter may move to a lockless implementation. Jira DNVGPU-125 Change-Id: I6a8e443fb0d15dc5f1993e7260256d71acddd106 Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: http://git-master/r/1223476 (cherry picked from commit cb130825d84e4124d273bd443e2b62d493377461) Reviewed-on: http://git-master/r/1243105 GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_arb.h')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_arb.h63
1 files changed, 63 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_arb.h b/drivers/gpu/nvgpu/clk/clk_arb.h
new file mode 100644
index 00000000..9981041b
--- /dev/null
+++ b/drivers/gpu/nvgpu/clk/clk_arb.h
@@ -0,0 +1,63 @@
1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 */
13
14#include "gk20a/gk20a.h"
15
16#ifndef _CLK_ARB_H_
17#define _CLK_ARB_H_
18
19struct nvgpu_clk_arb;
20struct nvgpu_clk_session;
21
22int nvgpu_clk_arb_init_arbiter(struct gk20a *g);
23
24int nvgpu_clk_arb_get_arbiter_clk_range(struct gk20a *g, u32 api_domain,
25 u16 *min_mhz, u16 *max_mhz);
26
27int nvgpu_clk_arb_get_arbiter_actual_mhz(struct gk20a *g,
28 u32 api_domain, u16 *actual_mhz);
29
30int nvgpu_clk_arb_get_arbiter_clk_f_points(struct gk20a *g,
31 u32 api_domain, u32 *max_points, u16 *fpoints);
32
33u32 nvgpu_clk_arb_get_arbiter_req_nr(struct gk20a *g);
34
35u32 nvgpu_clk_arb_get_arbiter_clk_domains(struct gk20a *g);
36
37void nvgpu_clk_arb_cleanup_arbiter(struct gk20a *g);
38
39int nvgpu_clk_arb_install_session_fd(struct gk20a *g,
40 struct nvgpu_clk_session *session);
41
42int nvgpu_clk_arb_init_session(struct gk20a *g,
43 struct nvgpu_clk_session **_session);
44
45void nvgpu_clk_arb_cleanup_session(struct gk20a *g,
46 struct nvgpu_clk_session *session);
47
48void nvgpu_clk_arb_apply_session_constraints(struct gk20a *g,
49 struct nvgpu_clk_session *session);
50
51int nvgpu_clk_arb_set_session_target_mhz(struct nvgpu_clk_session *session,
52 u32 api_domain, u16 target_mhz);
53
54int nvgpu_clk_arb_get_session_target_mhz(struct nvgpu_clk_session *session,
55 u32 api_domain, u16 *target_mhz);
56
57u32 nvgpu_clk_arb_get_session_req_nr(struct gk20a *g,
58 struct nvgpu_clk_session *session);
59
60
61
62#endif /* _CLK_ARB_H_ */
63