diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2017-04-14 18:25:57 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-04-28 01:07:04 -0400 |
commit | f6c92780ffe3b79cb84fb6d4321dcc13d2a07f73 (patch) | |
tree | b3a186dce91e621e0145a1a5bb1afca1e1b2de55 | |
parent | cacd455dfdcb8864e296268a230cc490759a3f9e (diff) |
gpu: nvgpu: Move ptimer_src_freq to gk20a
Copy ptimer_src_freq to struct gk20a at probe time, and access it from
gk20a instead of platform_gk20a.
JIRA NVGPU-16
Change-Id: I92c1b83d6e2305a19eb2cd267b7dd8d97c1fdc44
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/1463544
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/driver_common.c | 1 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/vgpu/vgpu.c | 1 |
4 files changed, 5 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/driver_common.c b/drivers/gpu/nvgpu/common/linux/driver_common.c index b4d88b08..4919b03f 100644 --- a/drivers/gpu/nvgpu/common/linux/driver_common.c +++ b/drivers/gpu/nvgpu/common/linux/driver_common.c | |||
@@ -108,6 +108,7 @@ static void nvgpu_init_pm_vars(struct gk20a *g) | |||
108 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; | 108 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; |
109 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; | 109 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; |
110 | g->has_syncpoints = platform->has_syncpoints; | 110 | g->has_syncpoints = platform->has_syncpoints; |
111 | g->ptimer_src_freq = platform->ptimer_src_freq; | ||
111 | 112 | ||
112 | /* set default values to aelpg parameters */ | 113 | /* set default values to aelpg parameters */ |
113 | g->pmu.aelpg_param[0] = APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US; | 114 | g->pmu.aelpg_param[0] = APCTRL_SAMPLING_PERIOD_PG_DEFAULT_US; |
diff --git a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c index e89e9f68..b96adc5a 100644 --- a/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/fifo_gk20a.c | |||
@@ -760,7 +760,6 @@ int gk20a_init_fifo_reset_enable_hw(struct gk20a *g) | |||
760 | u32 mask; | 760 | u32 mask; |
761 | u32 timeout; | 761 | u32 timeout; |
762 | unsigned int i; | 762 | unsigned int i; |
763 | struct gk20a_platform *platform = dev_get_drvdata(g->dev); | ||
764 | u32 host_num_pbdma = nvgpu_get_litter_value(g, GPU_LIT_HOST_NUM_PBDMA); | 763 | u32 host_num_pbdma = nvgpu_get_litter_value(g, GPU_LIT_HOST_NUM_PBDMA); |
765 | 764 | ||
766 | gk20a_dbg_fn(""); | 765 | gk20a_dbg_fn(""); |
@@ -803,7 +802,7 @@ int gk20a_init_fifo_reset_enable_hw(struct gk20a *g) | |||
803 | 802 | ||
804 | timeout = GRFIFO_TIMEOUT_CHECK_PERIOD_US; | 803 | timeout = GRFIFO_TIMEOUT_CHECK_PERIOD_US; |
805 | timeout = scale_ptimer(timeout, | 804 | timeout = scale_ptimer(timeout, |
806 | ptimer_scalingfactor10x(platform->ptimer_src_freq)); | 805 | ptimer_scalingfactor10x(g->ptimer_src_freq)); |
807 | timeout |= fifo_eng_timeout_detection_enabled_f(); | 806 | timeout |= fifo_eng_timeout_detection_enabled_f(); |
808 | gk20a_writel(g, fifo_eng_timeout_r(), timeout); | 807 | gk20a_writel(g, fifo_eng_timeout_r(), timeout); |
809 | 808 | ||
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 616c25ee..6c846251 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -996,6 +996,8 @@ struct gk20a { | |||
996 | 996 | ||
997 | u32 default_pri_timeout; | 997 | u32 default_pri_timeout; |
998 | 998 | ||
999 | u32 ptimer_src_freq; | ||
1000 | |||
999 | unsigned int aggressive_sync_destroy_thresh; | 1001 | unsigned int aggressive_sync_destroy_thresh; |
1000 | bool aggressive_sync_destroy; | 1002 | bool aggressive_sync_destroy; |
1001 | 1003 | ||
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c index a98006f2..0f1fa814 100644 --- a/drivers/gpu/nvgpu/vgpu/vgpu.c +++ b/drivers/gpu/nvgpu/vgpu/vgpu.c | |||
@@ -241,6 +241,7 @@ static void vgpu_init_vars(struct gk20a *g, struct gk20a_platform *platform) | |||
241 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; | 241 | g->aggressive_sync_destroy = platform->aggressive_sync_destroy; |
242 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; | 242 | g->aggressive_sync_destroy_thresh = platform->aggressive_sync_destroy_thresh; |
243 | g->has_syncpoints = platform->has_syncpoints; | 243 | g->has_syncpoints = platform->has_syncpoints; |
244 | g->ptimer_src_freq = platform->ptimer_src_freq; | ||
244 | } | 245 | } |
245 | 246 | ||
246 | static int vgpu_init_support(struct platform_device *pdev) | 247 | static int vgpu_init_support(struct platform_device *pdev) |