diff options
Diffstat (limited to 'drivers/gpu/nvgpu/tegra')
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | 17 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | 3 |
2 files changed, 13 insertions, 7 deletions
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c index 4f799a82..3e2a0adf 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gk20a_tegra.c | |||
@@ -112,12 +112,13 @@ static void gk20a_tegra_secure_page_destroy(struct device *dev, | |||
112 | int gk20a_tegra_secure_page_alloc(struct device *dev) | 112 | int gk20a_tegra_secure_page_alloc(struct device *dev) |
113 | { | 113 | { |
114 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 114 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
115 | struct gk20a *g = get_gk20a(dev); | ||
115 | struct secure_page_buffer *secure_buffer = &platform->secure_buffer; | 116 | struct secure_page_buffer *secure_buffer = &platform->secure_buffer; |
116 | DEFINE_DMA_ATTRS(attrs); | 117 | DEFINE_DMA_ATTRS(attrs); |
117 | dma_addr_t iova; | 118 | dma_addr_t iova; |
118 | size_t size = PAGE_SIZE; | 119 | size_t size = PAGE_SIZE; |
119 | 120 | ||
120 | if (platform->is_fmodel) | 121 | if (g->is_fmodel) |
121 | return -EINVAL; | 122 | return -EINVAL; |
122 | 123 | ||
123 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, | 124 | (void)dma_alloc_attrs(&tegra_vpr_dev, size, &iova, |
@@ -389,10 +390,11 @@ done: | |||
389 | 390 | ||
390 | static int gk20a_tegra_railgate(struct device *dev) | 391 | static int gk20a_tegra_railgate(struct device *dev) |
391 | { | 392 | { |
393 | struct gk20a *g = get_gk20a(dev); | ||
392 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 394 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
393 | int ret = 0; | 395 | int ret = 0; |
394 | 396 | ||
395 | if (platform->is_fmodel || | 397 | if (g->is_fmodel || |
396 | !tegra_dvfs_is_rail_up(platform->gpu_rail)) | 398 | !tegra_dvfs_is_rail_up(platform->gpu_rail)) |
397 | return 0; | 399 | return 0; |
398 | 400 | ||
@@ -442,11 +444,12 @@ err_power_off: | |||
442 | 444 | ||
443 | static int gk20a_tegra_unrailgate(struct device *dev) | 445 | static int gk20a_tegra_unrailgate(struct device *dev) |
444 | { | 446 | { |
447 | struct gk20a *g = get_gk20a(dev); | ||
445 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 448 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
446 | int ret = 0; | 449 | int ret = 0; |
447 | bool first = false; | 450 | bool first = false; |
448 | 451 | ||
449 | if (platform->is_fmodel) | 452 | if (g->is_fmodel) |
450 | return 0; | 453 | return 0; |
451 | 454 | ||
452 | if (!platform->gpu_rail) { | 455 | if (!platform->gpu_rail) { |
@@ -517,10 +520,11 @@ err_clk_on: | |||
517 | 520 | ||
518 | static bool gk20a_tegra_is_railgated(struct device *dev) | 521 | static bool gk20a_tegra_is_railgated(struct device *dev) |
519 | { | 522 | { |
523 | struct gk20a *g = get_gk20a(dev); | ||
520 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 524 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
521 | bool ret = false; | 525 | bool ret = false; |
522 | 526 | ||
523 | if (!platform->is_fmodel) | 527 | if (!g->is_fmodel) |
524 | ret = !tegra_dvfs_is_rail_up(platform->gpu_rail); | 528 | ret = !tegra_dvfs_is_rail_up(platform->gpu_rail); |
525 | 529 | ||
526 | return ret; | 530 | return ret; |
@@ -534,10 +538,11 @@ static bool gk20a_tegra_is_railgated(struct device *dev) | |||
534 | 538 | ||
535 | static int gm20b_tegra_railgate(struct device *dev) | 539 | static int gm20b_tegra_railgate(struct device *dev) |
536 | { | 540 | { |
541 | struct gk20a *g = get_gk20a(dev); | ||
537 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 542 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
538 | int ret = 0; | 543 | int ret = 0; |
539 | 544 | ||
540 | if (platform->is_fmodel || | 545 | if (g->is_fmodel || |
541 | !tegra_dvfs_is_rail_up(platform->gpu_rail)) | 546 | !tegra_dvfs_is_rail_up(platform->gpu_rail)) |
542 | return 0; | 547 | return 0; |
543 | 548 | ||
@@ -601,7 +606,7 @@ static int gm20b_tegra_unrailgate(struct device *dev) | |||
601 | int ret = 0; | 606 | int ret = 0; |
602 | bool first = false; | 607 | bool first = false; |
603 | 608 | ||
604 | if (platform->is_fmodel) | 609 | if (g->is_fmodel) |
605 | return 0; | 610 | return 0; |
606 | 611 | ||
607 | #ifdef CONFIG_TEGRA_CLK_FRAMEWORK | 612 | #ifdef CONFIG_TEGRA_CLK_FRAMEWORK |
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c index 26ac44a3..d04a2885 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | |||
@@ -72,10 +72,11 @@ static void gr_gp10b_remove_sysfs(struct device *dev); | |||
72 | 72 | ||
73 | int gp10b_tegra_get_clocks(struct device *dev) | 73 | int gp10b_tegra_get_clocks(struct device *dev) |
74 | { | 74 | { |
75 | struct gk20a *g = get_gk20a(dev); | ||
75 | struct gk20a_platform *platform = dev_get_drvdata(dev); | 76 | struct gk20a_platform *platform = dev_get_drvdata(dev); |
76 | unsigned int i; | 77 | unsigned int i; |
77 | 78 | ||
78 | if (platform->is_fmodel) | 79 | if (g->is_fmodel) |
79 | return 0; | 80 | return 0; |
80 | 81 | ||
81 | platform->num_clks = 0; | 82 | platform->num_clks = 0; |