diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/gr_gp10b.c | 13 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | 23 |
2 files changed, 20 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c index 4898502d..6de6b599 100644 --- a/drivers/gpu/nvgpu/gp10b/gr_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/gr_gp10b.c | |||
@@ -21,6 +21,9 @@ | |||
21 | #include <dt-bindings/soc/gm20b-fuse.h> | 21 | #include <dt-bindings/soc/gm20b-fuse.h> |
22 | #include <dt-bindings/soc/gp10b-fuse.h> | 22 | #include <dt-bindings/soc/gp10b-fuse.h> |
23 | 23 | ||
24 | #include <nvgpu/timers.h> | ||
25 | #include <nvgpu/kmem.h> | ||
26 | |||
24 | #include "gk20a/gk20a.h" | 27 | #include "gk20a/gk20a.h" |
25 | #include "gk20a/gr_gk20a.h" | 28 | #include "gk20a/gr_gk20a.h" |
26 | #include "gk20a/dbg_gpu_gk20a.h" | 29 | #include "gk20a/dbg_gpu_gk20a.h" |
@@ -29,8 +32,6 @@ | |||
29 | #include "gp10b/gr_gp10b.h" | 32 | #include "gp10b/gr_gp10b.h" |
30 | #include "gp10b_sysfs.h" | 33 | #include "gp10b_sysfs.h" |
31 | 34 | ||
32 | #include <nvgpu/timers.h> | ||
33 | |||
34 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> | 35 | #include <nvgpu/hw/gp10b/hw_gr_gp10b.h> |
35 | #include <nvgpu/hw/gp10b/hw_fifo_gp10b.h> | 36 | #include <nvgpu/hw/gp10b/hw_fifo_gp10b.h> |
36 | #include <nvgpu/hw/gp10b/hw_ctxsw_prog_gp10b.h> | 37 | #include <nvgpu/hw/gp10b/hw_ctxsw_prog_gp10b.h> |
@@ -1479,7 +1480,7 @@ static int gr_gp10b_load_smid_config(struct gk20a *g) | |||
1479 | u32 tpc_index, gpc_index; | 1480 | u32 tpc_index, gpc_index; |
1480 | u32 max_gpcs = nvgpu_get_litter_value(g, GPU_LIT_NUM_GPCS); | 1481 | u32 max_gpcs = nvgpu_get_litter_value(g, GPU_LIT_NUM_GPCS); |
1481 | 1482 | ||
1482 | tpc_sm_id = kcalloc(gr_cwd_sm_id__size_1_v(), sizeof(u32), GFP_KERNEL); | 1483 | tpc_sm_id = nvgpu_kcalloc(g, gr_cwd_sm_id__size_1_v(), sizeof(u32)); |
1483 | if (!tpc_sm_id) | 1484 | if (!tpc_sm_id) |
1484 | return -ENOMEM; | 1485 | return -ENOMEM; |
1485 | 1486 | ||
@@ -1512,7 +1513,7 @@ static int gr_gp10b_load_smid_config(struct gk20a *g) | |||
1512 | for (i = 0; i < gr_cwd_sm_id__size_1_v(); i++) | 1513 | for (i = 0; i < gr_cwd_sm_id__size_1_v(); i++) |
1513 | gk20a_writel(g, gr_cwd_sm_id_r(i), tpc_sm_id[i]); | 1514 | gk20a_writel(g, gr_cwd_sm_id_r(i), tpc_sm_id[i]); |
1514 | 1515 | ||
1515 | kfree(tpc_sm_id); | 1516 | nvgpu_kfree(g, tpc_sm_id); |
1516 | 1517 | ||
1517 | return 0; | 1518 | return 0; |
1518 | } | 1519 | } |
@@ -2224,7 +2225,7 @@ static int gp10b_gr_fuse_override(struct gk20a *g) | |||
2224 | if (count <= 0) | 2225 | if (count <= 0) |
2225 | return count; | 2226 | return count; |
2226 | 2227 | ||
2227 | fuses = kmalloc(sizeof(u32) * count * 2, GFP_KERNEL); | 2228 | fuses = nvgpu_kmalloc(g, sizeof(u32) * count * 2); |
2228 | if (!fuses) | 2229 | if (!fuses) |
2229 | return -ENOMEM; | 2230 | return -ENOMEM; |
2230 | of_property_read_u32_array(np, "fuse-overrides", fuses, count * 2); | 2231 | of_property_read_u32_array(np, "fuse-overrides", fuses, count * 2); |
@@ -2247,7 +2248,7 @@ static int gp10b_gr_fuse_override(struct gk20a *g) | |||
2247 | } | 2248 | } |
2248 | } | 2249 | } |
2249 | 2250 | ||
2250 | kfree(fuses); | 2251 | nvgpu_kfree(g, fuses); |
2251 | 2252 | ||
2252 | return 0; | 2253 | return 0; |
2253 | } | 2254 | } |
diff --git a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c index 27db9c12..8e8792f6 100644 --- a/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c +++ b/drivers/gpu/nvgpu/tegra/linux/platform_gp10b_tegra.c | |||
@@ -16,18 +16,19 @@ | |||
16 | #include <linux/of_platform.h> | 16 | #include <linux/of_platform.h> |
17 | #include <linux/nvhost.h> | 17 | #include <linux/nvhost.h> |
18 | #include <linux/debugfs.h> | 18 | #include <linux/debugfs.h> |
19 | #include <soc/tegra/tegra_powergate.h> | ||
20 | #include <linux/platform_data/tegra_edp.h> | 19 | #include <linux/platform_data/tegra_edp.h> |
21 | #include <linux/dma-buf.h> | 20 | #include <linux/dma-buf.h> |
22 | #include <linux/nvmap.h> | 21 | #include <linux/nvmap.h> |
23 | #include <linux/reset.h> | 22 | #include <linux/reset.h> |
24 | #include <linux/hashtable.h> | 23 | #include <linux/hashtable.h> |
25 | |||
26 | #include <linux/platform/tegra/emc_bwmgr.h> | 24 | #include <linux/platform/tegra/emc_bwmgr.h> |
27 | 25 | ||
28 | #include <uapi/linux/nvgpu.h> | 26 | #include <uapi/linux/nvgpu.h> |
29 | 27 | ||
30 | #include <soc/tegra/tegra_bpmp.h> | 28 | #include <soc/tegra/tegra_bpmp.h> |
29 | #include <soc/tegra/tegra_powergate.h> | ||
30 | |||
31 | #include <nvgpu/kmem.h> | ||
31 | 32 | ||
32 | #include "clk.h" | 33 | #include "clk.h" |
33 | 34 | ||
@@ -540,11 +541,13 @@ static int ecc_stat_create(struct device *dev, | |||
540 | num_hw_units = g->gr.tpc_count; | 541 | num_hw_units = g->gr.tpc_count; |
541 | 542 | ||
542 | /* Allocate arrays */ | 543 | /* Allocate arrays */ |
543 | dev_attr_array = kzalloc(sizeof(struct device_attribute) * num_hw_units, GFP_KERNEL); | 544 | dev_attr_array = nvgpu_kzalloc(g, sizeof(struct device_attribute) * |
544 | ecc_stat->counters = kzalloc(sizeof(u32) * num_hw_units, GFP_KERNEL); | 545 | num_hw_units); |
545 | ecc_stat->names = kzalloc(sizeof(char *) * num_hw_units, GFP_KERNEL); | 546 | ecc_stat->counters = nvgpu_kzalloc(g, sizeof(u32) * num_hw_units); |
547 | ecc_stat->names = nvgpu_kzalloc(g, sizeof(char *) * num_hw_units); | ||
546 | for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { | 548 | for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { |
547 | ecc_stat->names[hw_unit] = kzalloc(sizeof(char) * ECC_STAT_NAME_MAX_SIZE, GFP_KERNEL); | 549 | ecc_stat->names[hw_unit] = nvgpu_kzalloc(g, sizeof(char) * |
550 | ECC_STAT_NAME_MAX_SIZE); | ||
548 | } | 551 | } |
549 | 552 | ||
550 | for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { | 553 | for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { |
@@ -604,12 +607,12 @@ static void ecc_stat_remove(struct device *dev, | |||
604 | hash_del(&ecc_stat->hash_node); | 607 | hash_del(&ecc_stat->hash_node); |
605 | 608 | ||
606 | /* Free arrays */ | 609 | /* Free arrays */ |
607 | kfree(ecc_stat->counters); | 610 | nvgpu_kfree(g, ecc_stat->counters); |
608 | for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { | 611 | for (hw_unit = 0; hw_unit < num_hw_units; hw_unit++) { |
609 | kfree(ecc_stat->names[hw_unit]); | 612 | nvgpu_kfree(g, ecc_stat->names[hw_unit]); |
610 | } | 613 | } |
611 | kfree(ecc_stat->names); | 614 | nvgpu_kfree(g, ecc_stat->names); |
612 | kfree(dev_attr_array); | 615 | nvgpu_kfree(g, dev_attr_array); |
613 | } | 616 | } |
614 | 617 | ||
615 | void gr_gp10b_create_sysfs(struct device *dev) | 618 | void gr_gp10b_create_sysfs(struct device *dev) |