diff options
author | Aingara Paramakuru <aparamakuru@nvidia.com> | 2014-11-03 11:55:48 -0500 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2015-03-18 15:12:25 -0400 |
commit | 5bac50c04406dd88bd4aad285601067620c540d4 (patch) | |
tree | c6625bf96cf9d550d120c96e635286a3e9d771e6 /drivers | |
parent | 36834282354de2760e54b1381e03e0fe8bc8b2a4 (diff) |
gpu: nvgpu: vgpu: debugger interface fixes
To run CUDA apps, the following minimal changes have been
made:
- power-gating is disabled for vgpu
- regop rd/wr returns -ENOSYS
Tools (debugger/profiler) support is known to not work and
not needed at this time.
Bug 200043227
Change-Id: I923caad78450e72d310fb9290cf2849ed5460ad5
Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com>
Reviewed-on: http://git-master/r/592878
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 16 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/regops_gk20a.c | 11 |
5 files changed, 36 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c index 3bcbdfd9..34351f93 100644 --- a/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/ctrl_gk20a.c | |||
@@ -258,7 +258,6 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg | |||
258 | struct zbc_entry *zbc_val; | 258 | struct zbc_entry *zbc_val; |
259 | struct zbc_query_params *zbc_tbl; | 259 | struct zbc_query_params *zbc_tbl; |
260 | int i, err = 0; | 260 | int i, err = 0; |
261 | struct gk20a_platform *platform = platform_get_drvdata(dev); | ||
262 | 261 | ||
263 | gk20a_dbg_fn(""); | 262 | gk20a_dbg_fn(""); |
264 | 263 | ||
@@ -320,7 +319,8 @@ long gk20a_ctrl_dev_ioctl(struct file *filp, unsigned int cmd, unsigned long arg | |||
320 | case NVGPU_GPU_IOCTL_ZBC_SET_TABLE: | 319 | case NVGPU_GPU_IOCTL_ZBC_SET_TABLE: |
321 | set_table_args = (struct nvgpu_gpu_zbc_set_table_args *)buf; | 320 | set_table_args = (struct nvgpu_gpu_zbc_set_table_args *)buf; |
322 | 321 | ||
323 | if (platform->virtual_dev) | 322 | /* not supported for vgpu */ |
323 | if (gk20a_gpu_is_virtual(dev)) | ||
324 | return -ENOMEM; | 324 | return -ENOMEM; |
325 | 325 | ||
326 | zbc_val = kzalloc(sizeof(struct zbc_entry), GFP_KERNEL); | 326 | zbc_val = kzalloc(sizeof(struct zbc_entry), GFP_KERNEL); |
diff --git a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c index bd24e269..72998280 100644 --- a/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/dbg_gpu_gk20a.c | |||
@@ -90,6 +90,11 @@ static int gk20a_dbg_gpu_do_dev_open(struct inode *inode, | |||
90 | dbg_session->g = g; | 90 | dbg_session->g = g; |
91 | dbg_session->is_profiler = is_profiler; | 91 | dbg_session->is_profiler = is_profiler; |
92 | dbg_session->is_pg_disabled = false; | 92 | dbg_session->is_pg_disabled = false; |
93 | /* For vgpu, all power-gating features are currently disabled | ||
94 | * in the server. Set is_pg_disable to true to reflect this | ||
95 | * on the client side. */ | ||
96 | if (gk20a_gpu_is_virtual(pdev)) | ||
97 | dbg_session->is_pg_disabled = true; | ||
93 | 98 | ||
94 | INIT_LIST_HEAD(&dbg_session->dbg_s_list_node); | 99 | INIT_LIST_HEAD(&dbg_session->dbg_s_list_node); |
95 | init_waitqueue_head(&dbg_session->dbg_events.wait_queue); | 100 | init_waitqueue_head(&dbg_session->dbg_events.wait_queue); |
@@ -492,7 +497,8 @@ static int nvgpu_ioctl_channel_reg_ops(struct dbg_session_gk20a *dbg_s, | |||
492 | } | 497 | } |
493 | 498 | ||
494 | /* be sure that ctx info is in place */ | 499 | /* be sure that ctx info is in place */ |
495 | if (!gr_context_info_available(dbg_s, &g->gr)) { | 500 | if (!gk20a_gpu_is_virtual(dbg_s->pdev) && |
501 | !gr_context_info_available(dbg_s, &g->gr)) { | ||
496 | gk20a_err(dev, "gr context data not available\n"); | 502 | gk20a_err(dev, "gr context data not available\n"); |
497 | return -ENODEV; | 503 | return -ENODEV; |
498 | } | 504 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 7b0db427..419b8675 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -1299,7 +1299,7 @@ static int gk20a_probe(struct platform_device *dev) | |||
1299 | 1299 | ||
1300 | platform_set_drvdata(dev, platform); | 1300 | platform_set_drvdata(dev, platform); |
1301 | 1301 | ||
1302 | if (platform->virtual_dev) | 1302 | if (gk20a_gpu_is_virtual(dev)) |
1303 | return vgpu_probe(dev); | 1303 | return vgpu_probe(dev); |
1304 | 1304 | ||
1305 | gk20a = kzalloc(sizeof(struct gk20a), GFP_KERNEL); | 1305 | gk20a = kzalloc(sizeof(struct gk20a), GFP_KERNEL); |
@@ -1449,7 +1449,7 @@ static int __exit gk20a_remove(struct platform_device *dev) | |||
1449 | 1449 | ||
1450 | gk20a_dbg_fn(""); | 1450 | gk20a_dbg_fn(""); |
1451 | 1451 | ||
1452 | if (platform->virtual_dev) | 1452 | if (gk20a_gpu_is_virtual(dev)) |
1453 | return vgpu_remove(dev); | 1453 | return vgpu_remove(dev); |
1454 | 1454 | ||
1455 | if (platform->has_cde) | 1455 | if (platform->has_cde) |
@@ -1527,7 +1527,9 @@ int gk20a_busy(struct platform_device *pdev) | |||
1527 | { | 1527 | { |
1528 | int ret = 0; | 1528 | int ret = 0; |
1529 | struct gk20a *g = get_gk20a(pdev); | 1529 | struct gk20a *g = get_gk20a(pdev); |
1530 | #ifdef CONFIG_PM_RUNTIME | ||
1530 | struct gk20a_platform *platform = gk20a_get_platform(pdev); | 1531 | struct gk20a_platform *platform = gk20a_get_platform(pdev); |
1532 | #endif | ||
1531 | 1533 | ||
1532 | down_read(&g->busy_lock); | 1534 | down_read(&g->busy_lock); |
1533 | 1535 | ||
@@ -1549,7 +1551,7 @@ int gk20a_busy(struct platform_device *pdev) | |||
1549 | } | 1551 | } |
1550 | #else | 1552 | #else |
1551 | if (!g->power_on) { | 1553 | if (!g->power_on) { |
1552 | ret = platform->virtual_dev ? | 1554 | ret = gk20a_gpu_is_virtual(pdev) ? |
1553 | vgpu_pm_finalize_poweron(&pdev->dev) | 1555 | vgpu_pm_finalize_poweron(&pdev->dev) |
1554 | : gk20a_pm_finalize_poweron(&pdev->dev); | 1556 | : gk20a_pm_finalize_poweron(&pdev->dev); |
1555 | if (ret) | 1557 | if (ret) |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index afe1447e..ca6a8ae0 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -713,15 +713,21 @@ enum { | |||
713 | KEPLER_CHANNEL_GPFIFO_C = 0xA26F, | 713 | KEPLER_CHANNEL_GPFIFO_C = 0xA26F, |
714 | }; | 714 | }; |
715 | 715 | ||
716 | static inline bool gk20a_gpu_is_virtual(struct platform_device *dev) | ||
717 | { | ||
718 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
719 | |||
720 | return platform->virtual_dev; | ||
721 | } | ||
722 | |||
716 | static inline int support_gk20a_pmu(struct platform_device *dev) | 723 | static inline int support_gk20a_pmu(struct platform_device *dev) |
717 | { | 724 | { |
718 | if (IS_ENABLED(CONFIG_GK20A_PMU)) { | 725 | if (IS_ENABLED(CONFIG_GK20A_PMU)) { |
719 | struct gk20a_platform *platform = gk20a_get_platform(dev); | 726 | /* gPMU is not supported for vgpu */ |
727 | return !gk20a_gpu_is_virtual(dev); | ||
728 | } | ||
720 | 729 | ||
721 | /* we have not supported GPU PMU for virtualization now */ | 730 | return 0; |
722 | return !platform->virtual_dev; | ||
723 | } else | ||
724 | return 0; | ||
725 | } | 731 | } |
726 | 732 | ||
727 | void gk20a_create_sysfs(struct platform_device *dev); | 733 | void gk20a_create_sysfs(struct platform_device *dev); |
diff --git a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c index fe444c78..cbdd1a55 100644 --- a/drivers/gpu/nvgpu/gk20a/regops_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/regops_gk20a.c | |||
@@ -392,6 +392,17 @@ int exec_regops_gk20a(struct dbg_session_gk20a *dbg_s, | |||
392 | 392 | ||
393 | ch = dbg_s->ch; | 393 | ch = dbg_s->ch; |
394 | 394 | ||
395 | /* For vgpu, the regops routines need to be handled in the | ||
396 | * context of the server and support for that does not exist. | ||
397 | * | ||
398 | * The two users of the regops interface are the compute driver | ||
399 | * and tools. The compute driver will work without a functional | ||
400 | * regops implementation, so we return -ENOSYS. This will allow | ||
401 | * compute apps to run with vgpu. Tools will not work in this | ||
402 | * configuration and are not required to work at this time. */ | ||
403 | if (gk20a_gpu_is_virtual(dbg_s->pdev)) | ||
404 | return -ENOSYS; | ||
405 | |||
395 | ok = g->allow_all || validate_reg_ops(dbg_s, | 406 | ok = g->allow_all || validate_reg_ops(dbg_s, |
396 | &ctx_rd_count, &ctx_wr_count, | 407 | &ctx_rd_count, &ctx_wr_count, |
397 | ops, num_ops); | 408 | ops, num_ops); |