diff options
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.h')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/vgpu.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.h b/drivers/gpu/nvgpu/vgpu/vgpu.h index f79c8aab..e1fff966 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.h +++ b/drivers/gpu/nvgpu/vgpu/vgpu.h | |||
@@ -21,6 +21,42 @@ | |||
21 | #include "gk20a/gk20a.h" | 21 | #include "gk20a/gk20a.h" |
22 | 22 | ||
23 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION | 23 | #ifdef CONFIG_TEGRA_GR_VIRTUALIZATION |
24 | |||
25 | struct vgpu_priv_data { | ||
26 | u64 virt_handle; | ||
27 | struct task_struct *intr_handler; | ||
28 | }; | ||
29 | |||
30 | static inline | ||
31 | struct vgpu_priv_data *vgpu_get_priv_data_from_dev(struct device *dev) | ||
32 | { | ||
33 | struct gk20a_platform *plat = gk20a_get_platform(dev); | ||
34 | |||
35 | return (struct vgpu_priv_data *)plat->vgpu_priv; | ||
36 | } | ||
37 | |||
38 | static inline struct vgpu_priv_data *vgpu_get_priv_data(struct gk20a *g) | ||
39 | { | ||
40 | return vgpu_get_priv_data_from_dev(g->dev); | ||
41 | } | ||
42 | |||
43 | static inline u64 vgpu_get_handle_from_dev(struct device *dev) | ||
44 | { | ||
45 | struct vgpu_priv_data *priv = vgpu_get_priv_data_from_dev(dev); | ||
46 | |||
47 | if (unlikely(!priv)) { | ||
48 | dev_err(dev, "invalid vgpu_priv_data in %s\n", __func__); | ||
49 | return INT_MAX; | ||
50 | } | ||
51 | |||
52 | return priv->virt_handle; | ||
53 | } | ||
54 | |||
55 | static inline u64 vgpu_get_handle(struct gk20a *g) | ||
56 | { | ||
57 | return vgpu_get_handle_from_dev(g->dev); | ||
58 | } | ||
59 | |||
24 | int vgpu_pm_prepare_poweroff(struct device *dev); | 60 | int vgpu_pm_prepare_poweroff(struct device *dev); |
25 | int vgpu_pm_finalize_poweron(struct device *dev); | 61 | int vgpu_pm_finalize_poweron(struct device *dev); |
26 | int vgpu_probe(struct platform_device *dev); | 62 | int vgpu_probe(struct platform_device *dev); |