summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/vgpu/vgpu.c
diff options
context:
space:
mode:
authorAingara Paramakuru <aparamakuru@nvidia.com>2014-10-27 15:10:23 -0400
committerDan Willemsen <dwillemsen@nvidia.com>2015-03-18 15:11:59 -0400
commit70674c2f873afc3d0e215a866cac34258ef20c0e (patch)
tree1fea3c730ae2cb0ada28a8cf083c8acfaca46775 /drivers/gpu/nvgpu/vgpu/vgpu.c
parentf82d6e9d190449b06066eff1a01700e8387eb7c2 (diff)
gpu: nvgpu: vgpu: add PM domain support
vgpu "poweron" and "poweroff" routines now get invoked using the PM domain callbacks, instead of the obsolete gk20a_get_client/gk20a_put_client routines. Bug 1570878 Change-Id: I9a5254936904f75cb3c8a14c2bf5066f919b6588 Signed-off-by: Aingara Paramakuru <aparamakuru@nvidia.com> Reviewed-on: http://git-master/r/590492 Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/vgpu/vgpu.c')
-rw-r--r--drivers/gpu/nvgpu/vgpu/vgpu.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/vgpu/vgpu.c b/drivers/gpu/nvgpu/vgpu/vgpu.c
index 84fd6d18..82a0851e 100644
--- a/drivers/gpu/nvgpu/vgpu/vgpu.c
+++ b/drivers/gpu/nvgpu/vgpu/vgpu.c
@@ -304,6 +304,27 @@ done:
304 return err; 304 return err;
305} 305}
306 306
307static int vgpu_pm_initialise_domain(struct platform_device *pdev)
308{
309 struct gk20a_platform *platform = platform_get_drvdata(pdev);
310 struct dev_power_governor *pm_domain_gov = NULL;
311 struct generic_pm_domain *domain = &platform->g->pd;
312
313 domain->name = "gpu";
314
315#ifdef CONFIG_PM_RUNTIME
316 pm_domain_gov = &pm_domain_always_on_gov;
317#endif
318
319 pm_genpd_init(domain, pm_domain_gov, true);
320
321 domain->dev_ops.save_state = vgpu_pm_prepare_poweroff;
322 domain->dev_ops.restore_state = vgpu_pm_finalize_poweron;
323
324 device_set_wakeup_capable(&pdev->dev, 0);
325 return pm_genpd_add_device(domain, &pdev->dev);
326}
327
307static int vgpu_pm_init(struct platform_device *dev) 328static int vgpu_pm_init(struct platform_device *dev)
308{ 329{
309 int err = 0; 330 int err = 0;
@@ -311,6 +332,11 @@ static int vgpu_pm_init(struct platform_device *dev)
311 gk20a_dbg_fn(""); 332 gk20a_dbg_fn("");
312 333
313 pm_runtime_enable(&dev->dev); 334 pm_runtime_enable(&dev->dev);
335
336 /* genpd will take care of runtime power management if it is enabled */
337 if (IS_ENABLED(CONFIG_PM_GENERIC_DOMAINS))
338 err = vgpu_pm_initialise_domain(dev);
339
314 return err; 340 return err;
315} 341}
316 342