summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/common/linux/clk_arb_linux.h')
-rw-r--r--drivers/gpu/nvgpu/common/linux/clk_arb_linux.h27
1 files changed, 23 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h b/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
index e5ada25d..464590d5 100644
--- a/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
+++ b/drivers/gpu/nvgpu/common/linux/clk_arb_linux.h
@@ -39,6 +39,18 @@
39 * The defines here should finally move to clk_arb.h, once these are 39 * The defines here should finally move to clk_arb.h, once these are
40 * refactored to be free of Linux fields. 40 * refactored to be free of Linux fields.
41 */ 41 */
42
43enum clk_arb_work_item_type {
44 CLK_ARB_WORK_UPDATE_VF_TABLE,
45 CLK_ARB_WORK_UPDATE_ARB
46};
47
48struct nvgpu_clk_arb_work_item {
49 enum clk_arb_work_item_type item_type;
50 struct nvgpu_clk_arb *arb;
51 struct nvgpu_list_node worker_item;
52};
53
42struct nvgpu_clk_arb { 54struct nvgpu_clk_arb {
43 struct nvgpu_spinlock sessions_lock; 55 struct nvgpu_spinlock sessions_lock;
44 struct nvgpu_spinlock users_lock; 56 struct nvgpu_spinlock users_lock;
@@ -62,10 +74,8 @@ struct nvgpu_clk_arb {
62 u16 gpc2clk_min, gpc2clk_max; 74 u16 gpc2clk_min, gpc2clk_max;
63 u16 mclk_min, mclk_max; 75 u16 mclk_min, mclk_max;
64 76
65 struct work_struct update_fn_work; 77 struct nvgpu_clk_arb_work_item update_vf_table_work_item;
66 struct workqueue_struct *update_work_queue; 78 struct nvgpu_clk_arb_work_item update_arb_work_item;
67 struct work_struct vf_table_fn_work;
68 struct workqueue_struct *vf_table_work_queue;
69 79
70 struct nvgpu_cond request_wq; 80 struct nvgpu_cond request_wq;
71 81
@@ -140,5 +150,14 @@ nvgpu_clk_dev_from_link(struct nvgpu_list_node *node)
140 ((uintptr_t)node - offsetof(struct nvgpu_clk_dev, link)); 150 ((uintptr_t)node - offsetof(struct nvgpu_clk_dev, link));
141}; 151};
142 152
153static inline struct nvgpu_clk_arb_work_item *
154nvgpu_clk_arb_work_item_from_worker_item(struct nvgpu_list_node *node)
155{
156 return (struct nvgpu_clk_arb_work_item *)
157 ((uintptr_t)node - offsetof(struct nvgpu_clk_arb_work_item, worker_item));
158};
159
160void nvgpu_clk_arb_worker_enqueue(struct gk20a *g,
161 struct nvgpu_clk_arb_work_item *work_item);
143#endif /* __NVGPU_CLK_ARB_LINUX_H__ */ 162#endif /* __NVGPU_CLK_ARB_LINUX_H__ */
144 163