]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: pod: Use devfreq for suspend
authorArto Merilainen <amerilainen@nvidia.com>
Mon, 3 Mar 2014 08:29:32 +0000 (10:29 +0200)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Thu, 6 Mar 2014 07:23:03 +0000 (23:23 -0800)
Currently we assume that the suspend callback is called as part of device
suspend routine. This patch modifies the sequence so that we use devfreq
events for getting information about suspending. The code is also adapted
as required.

Bug 1454499

Change-Id: I45adba19c23676c3b206967cf1c8c9c243465648
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/376554
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/gk20a/gk20a.c
drivers/video/tegra/host/gk20a/platform_gk20a_tegra.c
drivers/video/tegra/host/gr3d/gr3d.c
drivers/video/tegra/host/gr3d/pod_scaling.c
drivers/video/tegra/host/gr3d/pod_scaling.h [deleted file]
drivers/video/tegra/host/gr3d/scale3d.c
drivers/video/tegra/host/gr3d/scale3d.h
drivers/video/tegra/host/t114/t114.c
drivers/video/tegra/host/t124/t124.c
drivers/video/tegra/host/t148/t148.c

index fc33225cc99075b6da560c0210932a5964e80db8..8879aac5be69b74a79e041886a6e9372dba9eeec 100644 (file)
@@ -58,7 +58,6 @@
 #include "hw_top_gk20a.h"
 #include "hw_ltc_gk20a.h"
 #include "gk20a_scale.h"
-#include "gr3d/pod_scaling.h"
 #include "dbg_gpu_gk20a.h"
 #include "hal.h"
 
index 5636abe920a31c3a39e7f909d6d473b576f3e231..436fe3d118b105c8cfa02e67ed6de0c908ff2914 100644 (file)
  */
 
 #include "platform_gk20a.h"
+#include "gr3d/scale3d.h"
 #include "gk20a_scale.h"
 #include "nvhost_acm.h"
 #include "bus_client.h"
 #include "class_ids.h"
 #include "t124/syncpt_t124.h"
-#include "gr3d/pod_scaling.h"
 #include "../../../../../arch/arm/mach-tegra/iomap.h"
 #include <linux/tegra-powergate.h>
 #include <linux/nvhost_ioctl.h>
index 3f7335cf688a9596923bc2d869e5d71ef54b6691..c1bea10fd1fa23f872ab8e3a36d266ab9d9d8f51 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Tegra Graphics Host 3D
  *
- * Copyright (c) 2012-2013 NVIDIA Corporation.  All rights reserved.
+ * Copyright (c) 2012-2014 NVIDIA Corporation.  All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -45,7 +45,6 @@
 #include "bus_client.h"
 #include "nvhost_channel.h"
 #include "chip_support.h"
-#include "pod_scaling.h"
 #include "class_ids.h"
 #include "nvhost_job.h"
 
index 67faac916cae66886fc96a3efcaf26c1ae286291..f1a8787dce20daf5ec061ec48cf99a157c9117f4 100644 (file)
 
 #include "nvhost_acm.h"
 #include "scale3d.h"
-#include "pod_scaling.h"
 #include "dev.h"
 
+#define GET_TARGET_FREQ_DONTSCALE      1
+
 /* time frame for load and hint tracking - when events come in at a larger
  * interval, this probably indicates the current estimates are stale
  */
@@ -165,20 +166,15 @@ static void scaling_limit(struct devfreq *df, unsigned long *freq)
 }
 
 /*******************************************************************************
- * nvhost_scale3d_suspend(dev)
+ * nvhost_pod_suspend(dev)
  *
  * Prepare the device for suspend
  ******************************************************************************/
 
-void nvhost_scale3d_suspend(struct device *dev)
+static void nvhost_pod_suspend(struct devfreq *df)
 {
-       struct nvhost_device_data *pdata = dev_get_drvdata(dev);
-       struct devfreq *df = pdata->power_manager;
        struct podgov_info_rec *podgov;
 
-       if (!df)
-               return;
-
        mutex_lock(&df->lock);
 
        podgov = df->data;
@@ -1067,10 +1063,12 @@ static int nvhost_pod_event_handler(struct devfreq *df,
        case DEVFREQ_GOV_START:
                ret = nvhost_pod_init(df);
                break;
-
        case DEVFREQ_GOV_STOP:
                nvhost_pod_exit(df);
                break;
+       case DEVFREQ_GOV_SUSPEND:
+               nvhost_pod_suspend(df);
+               break;
        default:
                break;
        }
diff --git a/drivers/video/tegra/host/gr3d/pod_scaling.h b/drivers/video/tegra/host/gr3d/pod_scaling.h
deleted file mode 100644 (file)
index d16d1de..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * drivers/video/tegra/host/gr3d/pod_scaling.h
- *
- * Tegra Graphics Host Power-On-Demand Scaling
- *
- * Copyright (c) 2012-2013, NVIDIA Corporation.  All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef POD_SCALING_H
-#define POD_SCALING_H
-
-struct platform_device;
-struct dentry;
-
-#define GET_TARGET_FREQ_DONTSCALE      1
-/* Suspend is called when powering down module */
-void nvhost_scale3d_suspend(struct device *);
-#endif
index 4bd828ffa058eb9ebf1c25a05727f35f4fa700ac..274b47ab8fc812353285bfd30c5b79a68b6cea1f 100644 (file)
@@ -76,6 +76,23 @@ static inline struct clk *clk(struct nvhost_device_profile *profile, int index)
        return pdata->clk[index];
 }
 
+/*******************************************************************************
+ * nvhost_scale3d_suspend(dev)
+ *
+ * Prepare the device for suspend
+ ******************************************************************************/
+
+void nvhost_scale3d_suspend(struct device *dev)
+{
+       struct nvhost_device_data *pdata = dev_get_drvdata(dev);
+       struct devfreq *df = pdata->power_manager;
+
+       if (!df)
+               return;
+
+       devfreq_suspend_device(df);
+}
+
 long nvhost_scale3d_get_emc_rate(struct nvhost_emc_params *emc_params,
                                 long freq)
 {
index 0739551b1e42360ad246e594db54c0e2931f7e42..4aa84a8086bf15dcd89f1286670c41333b9eecd6 100644 (file)
@@ -3,7 +3,7 @@
  *
  * Tegra Graphics Host 3D Clock Scaling
  *
- * Copyright (c) 2010-2013, NVIDIA Corporation. All rights reserved.
+ * Copyright (c) 2010-2014, NVIDIA Corporation. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms and conditions of the GNU General Public License,
@@ -36,6 +36,9 @@ struct nvhost_emc_params {
        bool                            linear;
 };
 
+/* Suspend is called when powering down module */
+void nvhost_scale3d_suspend(struct device *);
+
 /* Initialization and de-initialization for module */
 void nvhost_scale3d_init(struct platform_device *pdev);
 void nvhost_scale3d_deinit(struct platform_device *pdev);
index 6324e859a60f5327dca2fa310f3c4186d999ba7e..ed7915d120e4921b9a9c67f0c152ba0771d87fed 100644 (file)
@@ -41,7 +41,6 @@
 #include "chip_support.h"
 #include "nvhost_channel.h"
 #include "chip_support.h"
-#include "gr3d/pod_scaling.h"
 #include "class_ids.h"
 
 /* HACK! This needs to come from DT */
index 66cb5b1c6ca4884d8dee721a99ebbc9eb7e77c68..8b69509f7dd9212241240878400b0b3c3393b9e9 100644 (file)
@@ -39,7 +39,6 @@
 #include "tsec/tsec.h"
 #include "vi/vi.h"
 #include "isp/isp.h"
-#include "gr3d/pod_scaling.h"
 #include "gr3d/scale3d.h"
 
 #include "chip_support.h"
index a8984108692f04b443195951b02d8bcd98567f6b..96fbaaee70b35eb1f328a18b8fc19742dc6ca974 100644 (file)
@@ -36,7 +36,6 @@
 #include "gr3d/gr3d_t114.h"
 #include "gr3d/scale3d.h"
 #include "nvhost_scale.h"
-#include "gr3d/pod_scaling.h"
 #include "msenc/msenc.h"
 #include "tsec/tsec.h"
 #include "linux/nvhost_ioctl.h"