From 0aa4cea63b906401df1bece74cef4a566054cf59 Mon Sep 17 00:00:00 2001 From: Deepak Nibade Date: Mon, 30 Oct 2017 06:53:17 -0700 Subject: gpu: nvgpu: use struct gk20a for create_gr_sysfs API gr_gp10b_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: I7effa16407d47a2ab5f9562ec4a4dec975a32d6c Signed-off-by: Deepak Nibade Reviewed-on: https://git-master.nvidia.com/r/1588464 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c | 6 ++++-- drivers/gpu/nvgpu/gk20a/gk20a.h | 2 +- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 2 +- drivers/gpu/nvgpu/gp10b/gr_gp10b.h | 2 +- 4 files changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers/gpu') diff --git a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c index fb8686c2..1f7a7694 100644 --- a/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/common/linux/platform_gp10b_tegra.c @@ -31,6 +31,8 @@ #include #include +#include "os_linux.h" + #include "clk.h" #include "gk20a/platform_gk20a.h" @@ -610,10 +612,10 @@ void gp10b_ecc_stat_remove(struct device *dev, nvgpu_kfree(g, dev_attr_array); } -void gr_gp10b_create_sysfs(struct device *dev) +void gr_gp10b_create_sysfs(struct gk20a *g) { int error = 0; - struct gk20a *g = get_gk20a(dev); + struct device *dev = dev_from_gk20a(g); /* This stat creation function is called on GR init. GR can get initialized multiple times but we only need to create the ECC diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 20e0450e..7e7d9688 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h @@ -356,7 +356,7 @@ struct gpu_ops { u32 gpc_exception); void (*enable_gpc_exceptions)(struct gk20a *g); void (*enable_exceptions)(struct gk20a *g); - void (*create_gr_sysfs)(struct device *dev); + void (*create_gr_sysfs)(struct gk20a *g); u32 (*get_lrf_tex_ltc_dram_override)(struct gk20a *g); int (*record_sm_error_state)(struct gk20a *g, u32 gpc, u32 tpc); diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index a95368c3..e30c595e 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -4865,7 +4865,7 @@ static int gk20a_init_gr_setup_sw(struct gk20a *g) gr->sw_ready = true; if (g->ops.gr.create_gr_sysfs) - g->ops.gr.create_gr_sysfs(dev_from_gk20a(g)); + g->ops.gr.create_gr_sysfs(g); gk20a_dbg_fn("done"); return 0; diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h index a537f147..45ac5305 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.h @@ -56,7 +56,7 @@ enum { int gr_gp10b_init_fs_state(struct gk20a *g); int gr_gp10b_alloc_buffer(struct vm_gk20a *vm, size_t size, struct nvgpu_mem *mem); -void gr_gp10b_create_sysfs(struct device *dev); +void gr_gp10b_create_sysfs(struct gk20a *g); int gr_gp10b_handle_fecs_error(struct gk20a *g, struct channel_gk20a *__ch, struct gr_gk20a_isr_data *isr_data); -- cgit v1.2.2