summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDeepak Nibade <dnibade@nvidia.com>2017-10-30 09:58:43 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-11-02 08:11:02 -0400
commite5c3b05bb2775236679b74194e4ac24612ef39b6 (patch)
tree387430a641a2e9630f56fe4dc7252b9ccdcc30a0 /drivers
parent730ba218c1a57486f05e02cfaddf6a75e95ff498 (diff)
gpu: nvgpu: use struct gk20a for create_gr_sysfs
API gr_gv11b_create_sysfs() and GR HAL create_gr_sysfs() right now receive linux specific struct device But since this function is called from/declared in common code, we need to remove linux dependency from it Hence update the API and GR HAL to receive struct gk20a pointer instead of device pointer Jira NVGPU-259 Change-Id: I65d717ad9f263f0397f8efa5761c64e55c7846eb Signed-off-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1588465 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/nvgpu/gv11b/gr_gv11b.h2
-rw-r--r--drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c7
2 files changed, 5 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
index feebef44..98e7bc50 100644
--- a/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
+++ b/drivers/gpu/nvgpu/gv11b/gr_gv11b.h
@@ -80,7 +80,7 @@ int gr_gv11b_alloc_buffer(struct vm_gk20a *vm, size_t size,
80/*zcull*/ 80/*zcull*/
81void gr_gv11b_program_zcull_mapping(struct gk20a *g, u32 zcull_num_entries, 81void gr_gv11b_program_zcull_mapping(struct gk20a *g, u32 zcull_num_entries,
82 u32 *zcull_map_tiles); 82 u32 *zcull_map_tiles);
83void gr_gv11b_create_sysfs(struct device *dev); 83void gr_gv11b_create_sysfs(struct gk20a *g);
84 84
85bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num); 85bool gr_gv11b_is_valid_class(struct gk20a *g, u32 class_num);
86bool gr_gv11b_is_valid_gfx_class(struct gk20a *g, u32 class_num); 86bool gr_gv11b_is_valid_gfx_class(struct gk20a *g, u32 class_num);
diff --git a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
index d2c690f4..5308f4ea 100644
--- a/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
+++ b/drivers/gpu/nvgpu/gv11b/platform_gv11b_tegra.c
@@ -40,6 +40,7 @@
40#include "gp10b/platform_gp10b.h" 40#include "gp10b/platform_gp10b.h"
41#include "common/linux/platform_gp10b_tegra.h" 41#include "common/linux/platform_gp10b_tegra.h"
42 42
43#include "common/linux/os_linux.h"
43#include "common/linux/platform_gk20a_tegra.h" 44#include "common/linux/platform_gk20a_tegra.h"
44#include "gr_gv11b.h" 45#include "gr_gv11b.h"
45#include "nvgpu_gpuid_t19x.h" 46#include "nvgpu_gpuid_t19x.h"
@@ -188,9 +189,9 @@ static struct device_attribute *dev_attr_mmu_hubtlb_ecc_uncorrected_err_count_ar
188static struct device_attribute *dev_attr_mmu_fillunit_ecc_corrected_err_count_array; 189static struct device_attribute *dev_attr_mmu_fillunit_ecc_corrected_err_count_array;
189static struct device_attribute *dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array; 190static struct device_attribute *dev_attr_mmu_fillunit_ecc_uncorrected_err_count_array;
190 191
191void gr_gv11b_create_sysfs(struct device *dev) 192void gr_gv11b_create_sysfs(struct gk20a *g)
192{ 193{
193 struct gk20a *g = get_gk20a(dev); 194 struct device *dev = dev_from_gk20a(g);
194 int error = 0; 195 int error = 0;
195 /* This stat creation function is called on GR init. GR can get 196 /* This stat creation function is called on GR init. GR can get
196 initialized multiple times but we only need to create the ECC 197 initialized multiple times but we only need to create the ECC
@@ -199,7 +200,7 @@ void gr_gv11b_create_sysfs(struct device *dev)
199 if (g->ecc.gr.t19x.sm_l1_tag_corrected_err_count.counters != NULL) 200 if (g->ecc.gr.t19x.sm_l1_tag_corrected_err_count.counters != NULL)
200 return; 201 return;
201 202
202 gr_gp10b_create_sysfs(dev); 203 gr_gp10b_create_sysfs(g);
203 204
204 error |= gr_gp10b_ecc_stat_create(dev, 205 error |= gr_gp10b_ecc_stat_create(dev,
205 0, 206 0,