diff options
author | Peter Daifuku <pdaifuku@nvidia.com> | 2017-10-06 19:27:14 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-10-13 18:20:18 -0400 |
commit | 57fb527a7e33384341fc18f1f918d5a8225057f5 (patch) | |
tree | 23bb49f879ac495834237c99564f0589d637f07e /drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c | |
parent | 3d343c9eeaa3415851d1c71b8815eb7dc2677b5a (diff) |
gpu: nvgpu: vgpu: flatten out vgpu hal
Instead of calling the native HAL init function then adding
multiple layers of modification for VGPU, flatten out the sequence
so that all entry points are set statically and visible in a
single file.
JIRA ESRM-30
Change-Id: Ie424abb48bce5038874851d399baac5e4bb7d27c
Signed-off-by: Peter Daifuku <pdaifuku@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1574616
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c')
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c index ec2fcd8e..fa6109ad 100644 --- a/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c +++ b/drivers/gpu/nvgpu/vgpu/gp10b/vgpu_gr_gp10b.c | |||
@@ -31,7 +31,7 @@ | |||
31 | 31 | ||
32 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> | 32 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> |
33 | 33 | ||
34 | static void vgpu_gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, | 34 | void vgpu_gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, |
35 | struct gr_ctx_desc *gr_ctx) | 35 | struct gr_ctx_desc *gr_ctx) |
36 | { | 36 | { |
37 | struct tegra_vgpu_cmd_msg msg = {0}; | 37 | struct tegra_vgpu_cmd_msg msg = {0}; |
@@ -59,7 +59,7 @@ static void vgpu_gr_gp10b_free_gr_ctx(struct gk20a *g, struct vm_gk20a *vm, | |||
59 | nvgpu_kfree(g, gr_ctx); | 59 | nvgpu_kfree(g, gr_ctx); |
60 | } | 60 | } |
61 | 61 | ||
62 | static int vgpu_gr_gp10b_alloc_gr_ctx(struct gk20a *g, | 62 | int vgpu_gr_gp10b_alloc_gr_ctx(struct gk20a *g, |
63 | struct gr_ctx_desc **__gr_ctx, | 63 | struct gr_ctx_desc **__gr_ctx, |
64 | struct vm_gk20a *vm, | 64 | struct vm_gk20a *vm, |
65 | u32 class, | 65 | u32 class, |
@@ -115,7 +115,7 @@ fail: | |||
115 | return err; | 115 | return err; |
116 | } | 116 | } |
117 | 117 | ||
118 | static int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, | 118 | int vgpu_gr_gp10b_set_ctxsw_preemption_mode(struct gk20a *g, |
119 | struct gr_ctx_desc *gr_ctx, | 119 | struct gr_ctx_desc *gr_ctx, |
120 | struct vm_gk20a *vm, u32 class, | 120 | struct vm_gk20a *vm, u32 class, |
121 | u32 graphics_preempt_mode, | 121 | u32 graphics_preempt_mode, |
@@ -267,7 +267,7 @@ fail: | |||
267 | return err; | 267 | return err; |
268 | } | 268 | } |
269 | 269 | ||
270 | static int vgpu_gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, | 270 | int vgpu_gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, |
271 | u32 graphics_preempt_mode, | 271 | u32 graphics_preempt_mode, |
272 | u32 compute_preempt_mode) | 272 | u32 compute_preempt_mode) |
273 | { | 273 | { |
@@ -316,7 +316,7 @@ static int vgpu_gr_gp10b_set_preemption_mode(struct channel_gk20a *ch, | |||
316 | return err; | 316 | return err; |
317 | } | 317 | } |
318 | 318 | ||
319 | static int vgpu_gr_gp10b_init_ctx_state(struct gk20a *g) | 319 | int vgpu_gr_gp10b_init_ctx_state(struct gk20a *g) |
320 | { | 320 | { |
321 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); | 321 | struct vgpu_priv_data *priv = vgpu_get_priv_data(g); |
322 | int err; | 322 | int err; |
@@ -334,14 +334,3 @@ static int vgpu_gr_gp10b_init_ctx_state(struct gk20a *g) | |||
334 | 334 | ||
335 | return 0; | 335 | return 0; |
336 | } | 336 | } |
337 | |||
338 | void vgpu_gp10b_init_gr_ops(struct gpu_ops *gops) | ||
339 | { | ||
340 | vgpu_gm20b_init_gr_ops(gops); | ||
341 | gops->gr.alloc_gr_ctx = vgpu_gr_gp10b_alloc_gr_ctx; | ||
342 | gops->gr.free_gr_ctx = vgpu_gr_gp10b_free_gr_ctx; | ||
343 | gops->gr.init_ctx_state = vgpu_gr_gp10b_init_ctx_state; | ||
344 | gops->gr.set_preemption_mode = vgpu_gr_gp10b_set_preemption_mode; | ||
345 | gops->gr.set_ctxsw_preemption_mode = | ||
346 | vgpu_gr_gp10b_set_ctxsw_preemption_mode; | ||
347 | } | ||