diff options
author | Sami Kiminki <skiminki@nvidia.com> | 2015-08-07 12:07:58 -0400 |
---|---|---|
committer | Terje Bergstrom <tbergstrom@nvidia.com> | 2016-04-06 22:37:58 -0400 |
commit | 135d6db448cfaf5a366e6572f1a02a67e35d70db (patch) | |
tree | 3f5269b2dbcd8d4bde800392e16bd85690195bff /drivers/gpu/nvgpu | |
parent | d14ab70b59b37858f55af316db49afbd4b0997cd (diff) |
gpu: nvgpu: Add HAL for GPU characteristics
Add function pointer for chip specific GPU characteristics init.
Bug 1637486
Change-Id: I6ce5eea124d8057393dec6e86e72412cc87e1cfa
Signed-off-by: Sami Kiminki <skiminki@nvidia.com>
Signed-off-by: Adeel Raza <araza@nvidia.com>
Reviewed-on: http://git-master/r/780535
(cherry picked from commit f5c240d6ed19b5b9eedff05767c885ad5812c71e)
Reviewed-on: http://git-master/r/1120428
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/hal_gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gm20b/hal_gm20b.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/vgpu.c | 2 |
5 files changed, 8 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index b8753a21..fb0a6aa3 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -889,7 +889,7 @@ static int gk20a_pm_finalize_poweron(struct device *dev) | |||
889 | goto done; | 889 | goto done; |
890 | } | 890 | } |
891 | 891 | ||
892 | err = gk20a_init_gpu_characteristics(g); | 892 | err = g->ops.chip_init_gpu_characteristics(g); |
893 | if (err) { | 893 | if (err) { |
894 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); | 894 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); |
895 | goto done; | 895 | goto done; |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 8a1f82bc..ee78c6e2 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -511,6 +511,8 @@ struct gpu_ops { | |||
511 | void *scatter_buffer_ptr, | 511 | void *scatter_buffer_ptr, |
512 | size_t scatter_buffer_size); | 512 | size_t scatter_buffer_size); |
513 | } cde; | 513 | } cde; |
514 | |||
515 | int (*chip_init_gpu_characteristics)(struct gk20a *g); | ||
514 | }; | 516 | }; |
515 | 517 | ||
516 | struct gk20a { | 518 | struct gk20a { |
diff --git a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c index 9718aad2..6df8f37c 100644 --- a/drivers/gpu/nvgpu/gk20a/hal_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/hal_gk20a.c | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * GK20A Tegra HAL interface. | 4 | * GK20A Tegra HAL interface. |
5 | * | 5 | * |
6 | * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. | 6 | * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify it | 8 | * This program is free software; you can redistribute it and/or modify it |
9 | * under the terms and conditions of the GNU General Public License, | 9 | * under the terms and conditions of the GNU General Public License, |
@@ -70,6 +70,7 @@ int gk20a_init_hal(struct gk20a *g) | |||
70 | gk20a_init_debug_ops(gops); | 70 | gk20a_init_debug_ops(gops); |
71 | gk20a_init_therm_ops(gops); | 71 | gk20a_init_therm_ops(gops); |
72 | gops->name = "gk20a"; | 72 | gops->name = "gk20a"; |
73 | gops->chip_init_gpu_characteristics = gk20a_init_gpu_characteristics; | ||
73 | 74 | ||
74 | c->twod_class = FERMI_TWOD_A; | 75 | c->twod_class = FERMI_TWOD_A; |
75 | c->threed_class = KEPLER_C; | 76 | c->threed_class = KEPLER_C; |
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c index 5fe01833..559fee61 100644 --- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c +++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * GM20B Graphics | 2 | * GM20B Graphics |
3 | * | 3 | * |
4 | * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -139,6 +139,7 @@ int gm20b_init_hal(struct gk20a *g) | |||
139 | gm20b_init_cde_ops(gops); | 139 | gm20b_init_cde_ops(gops); |
140 | gm20b_init_therm_ops(gops); | 140 | gm20b_init_therm_ops(gops); |
141 | gops->name = "gm20b"; | 141 | gops->name = "gm20b"; |
142 | gops->chip_init_gpu_characteristics = gk20a_init_gpu_characteristics; | ||
142 | 143 | ||
143 | c->twod_class = FERMI_TWOD_A; | 144 | c->twod_class = FERMI_TWOD_A; |
144 | c->threed_class = MAXWELL_B; | 145 | c->threed_class = MAXWELL_B; |
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index 5a953e20..4750d7ee 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c | |||
@@ -327,7 +327,7 @@ int vgpu_pm_finalize_poweron(struct device *dev) | |||
327 | goto done; | 327 | goto done; |
328 | } | 328 | } |
329 | 329 | ||
330 | err = gk20a_init_gpu_characteristics(g); | 330 | err = g->ops.chip_init_gpu_characteristics(g); |
331 | if (err) { | 331 | if (err) { |
332 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); | 332 | gk20a_err(dev, "failed to init gk20a gpu characteristics"); |
333 | goto done; | 333 | goto done; |