diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-06-21 18:56:05 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-30 21:34:59 -0400 |
commit | bab823973b0630e2f4515d5aabbe4fb46cdf3195 (patch) | |
tree | 9e19ed71ed9a57b15a3f3b48ffbbbc1b196bf4d6 /drivers/gpu/nvgpu/gk20a/gk20a.c | |
parent | 6f0fcbc667ca55ed25818467069853e6d750cd7d (diff) |
gpu: nvgpu: Use accessor for finding struct device
Use dev_from_gk20a() accessor whenever accessing struct device * from
struct gk20a.
JIRA NVGPU-38
Change-Id: Ide9fca3a56436c8f62e7872580a766c4c1e2353e
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master/r/1507930
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/gk20a/gk20a.c')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index a87d34f9..9452e153 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include "pstate/pstate.h" | 42 | #include "pstate/pstate.h" |
43 | #endif | 43 | #endif |
44 | 44 | ||
45 | |||
46 | #ifdef CONFIG_TEGRA_19x_GPU | 45 | #ifdef CONFIG_TEGRA_19x_GPU |
47 | #include "nvgpu_gpuid_t19x.h" | 46 | #include "nvgpu_gpuid_t19x.h" |
48 | #endif | 47 | #endif |
@@ -152,7 +151,7 @@ int gk20a_prepare_poweroff(struct gk20a *g) | |||
152 | 151 | ||
153 | int gk20a_finalize_poweron(struct gk20a *g) | 152 | int gk20a_finalize_poweron(struct gk20a *g) |
154 | { | 153 | { |
155 | struct gk20a_platform *platform = gk20a_get_platform(g->dev); | 154 | struct gk20a_platform *platform = gk20a_get_platform(dev_from_gk20a(g)); |
156 | int err; | 155 | int err; |
157 | 156 | ||
158 | gk20a_dbg_fn(""); | 157 | gk20a_dbg_fn(""); |
@@ -323,7 +322,7 @@ int gk20a_finalize_poweron(struct gk20a *g) | |||
323 | if (platform->disable_aspm && g->ops.xve.disable_aspm) | 322 | if (platform->disable_aspm && g->ops.xve.disable_aspm) |
324 | g->ops.xve.disable_aspm(g); | 323 | g->ops.xve.disable_aspm(g); |
325 | 324 | ||
326 | g->ops.xve.sw_init(g->dev); | 325 | g->ops.xve.sw_init(dev_from_gk20a(g)); |
327 | g->ops.xve.available_speeds(g, &speed); | 326 | g->ops.xve.available_speeds(g, &speed); |
328 | 327 | ||
329 | /* Set to max speed */ | 328 | /* Set to max speed */ |
@@ -367,7 +366,7 @@ void gk20a_driver_start_unload(struct gk20a *g) | |||
367 | if (g->is_virtual) | 366 | if (g->is_virtual) |
368 | return; | 367 | return; |
369 | 368 | ||
370 | gk20a_wait_for_idle(g->dev); | 369 | gk20a_wait_for_idle(dev_from_gk20a(g)); |
371 | 370 | ||
372 | nvgpu_wait_for_deferred_interrupts(g); | 371 | nvgpu_wait_for_deferred_interrupts(g); |
373 | gk20a_channel_cancel_pending_sema_waits(g); | 372 | gk20a_channel_cancel_pending_sema_waits(g); |
@@ -407,7 +406,7 @@ int gk20a_wait_for_idle(struct device *dev) | |||
407 | int gk20a_init_gpu_characteristics(struct gk20a *g) | 406 | int gk20a_init_gpu_characteristics(struct gk20a *g) |
408 | { | 407 | { |
409 | struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; | 408 | struct nvgpu_gpu_characteristics *gpu = &g->gpu_characteristics; |
410 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | 409 | struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); |
411 | 410 | ||
412 | gpu->L2_cache_size = g->ops.ltc.determine_L2_size_bytes(g); | 411 | gpu->L2_cache_size = g->ops.ltc.determine_L2_size_bytes(g); |
413 | gpu->on_board_video_memory_size = 0; /* integrated GPU */ | 412 | gpu->on_board_video_memory_size = 0; /* integrated GPU */ |
@@ -499,7 +498,8 @@ int gk20a_init_gpu_characteristics(struct gk20a *g) | |||
499 | gpu->map_buffer_batch_limit = 256; | 498 | gpu->map_buffer_batch_limit = 256; |
500 | 499 | ||
501 | if (platform->clk_round_rate) | 500 | if (platform->clk_round_rate) |
502 | gpu->max_freq = platform->clk_round_rate(g->dev, UINT_MAX); | 501 | gpu->max_freq = platform->clk_round_rate(dev_from_gk20a(g), |
502 | UINT_MAX); | ||
503 | 503 | ||
504 | g->ops.gr.get_preemption_mode_flags(g, &g->gr.preemption_mode_rec); | 504 | g->ops.gr.get_preemption_mode_flags(g, &g->gr.preemption_mode_rec); |
505 | gpu->graphics_preemption_mode_flags = | 505 | gpu->graphics_preemption_mode_flags = |