]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: Inform EDP in prescale
authorArto Merilainen <amerilainen@nvidia.com>
Sat, 1 Feb 2014 10:14:03 +0000 (12:14 +0200)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Tue, 4 Feb 2014 13:45:10 +0000 (05:45 -0800)
This far EDP was informed about changed load as part of postscale
callback when we changed the frequency. The theory behind this idea
has been that we need to inform EDP due to changed constraint.

However, we have seen cases where updating load information for EDP
would be beneficial more often. This patch modifies the call sequence
so that we inform EDP each time we submit work to GPU.

Bug 1441874

Change-Id: I07a804e0a07ea7efc6024a273437c33a02a8939d
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/362631
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
drivers/video/tegra/host/gk20a/gk20a_scale.c
drivers/video/tegra/host/gr3d/scale3d.c
drivers/video/tegra/host/nvhost_scale.c

index 7cf33e886476d5c26393ff45f8793e5d50d199a4..92ee08144a16f58a0d85b48ceb29677084e6e713 100644 (file)
@@ -72,18 +72,11 @@ void nvhost_gk20a_scale_callback(struct nvhost_device_profile *profile,
                                 unsigned long freq)
 {
        struct gk20a *g = get_gk20a(profile->pdev);
-       struct nvhost_device_data *pdata = platform_get_drvdata(profile->pdev);
        struct nvhost_emc_params *emc_params = profile->private_data;
        long after = gk20a_clk_get_rate(g);
        long emc_target = nvhost_scale3d_get_emc_rate(emc_params, after);
 
        nvhost_module_set_devfreq_rate(profile->pdev, 2, emc_target);
-
-       if (pdata->gpu_edp_device) {
-               u32 avg = 0;
-               gk20a_pmu_load_norm(g, &avg);
-               tegra_edp_notify_gpu_load(avg);
-       }
 }
 
 /*
@@ -178,6 +171,14 @@ static void gk20a_scale_notify(struct platform_device *pdev, bool busy)
        struct nvhost_device_data *pdata = platform_get_drvdata(pdev);
        struct nvhost_device_profile *profile = pdata->power_profile;
        struct devfreq *devfreq = pdata->power_manager;
+       struct gk20a *g = get_gk20a(pdev);
+
+       /* inform edp about new constraint */
+       if (pdata->gpu_edp_device) {
+               u32 avg = 0;
+               gk20a_pmu_load_norm(g, &avg);
+               tegra_edp_notify_gpu_load(avg);
+       }
 
        /* Is the device profile initialised? */
        if (!(profile && devfreq))
index a43a08460bea5e0eb1671194d32e148b076872e9..4bd828ffa058eb9ebf1c25a05727f35f4fa700ac 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,
@@ -34,7 +34,6 @@
 #include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/ftrace.h>
-#include <linux/platform_data/tegra_edp.h>
 #include <linux/tegra-soc.h>
 
 #include "chip_support.h"
@@ -101,7 +100,6 @@ void nvhost_scale3d_callback(struct nvhost_device_profile *profile,
                             unsigned long freq)
 {
        struct nvhost_gr3d_params *gr3d_params = profile->private_data;
-       struct nvhost_device_data *pdata = platform_get_drvdata(profile->pdev);
        struct nvhost_emc_params *emc_params = &gr3d_params->emc_params;
        long hz;
        long after;
@@ -111,12 +109,6 @@ void nvhost_scale3d_callback(struct nvhost_device_profile *profile,
        hz = nvhost_scale3d_get_emc_rate(emc_params, after);
        nvhost_module_set_devfreq_rate(profile->pdev, gr3d_params->clk_3d_emc,
                                       hz);
-
-       if (pdata->gpu_edp_device) {
-               u32 avg = 0;
-               actmon_op().read_avg_norm(profile->actmon, &avg);
-               tegra_edp_notify_gpu_load(avg);
-       }
 }
 
 /*
index c1830e11c63c9ebc65ffa597d6f69f4daa9f600c..89792f019e6866b2a8a5cc9b1d13d38bfc4f7780 100644 (file)
@@ -23,6 +23,7 @@
 #include <linux/export.h>
 #include <linux/slab.h>
 #include <linux/clk/tegra.h>
+#include <linux/platform_data/tegra_edp.h>
 #include <linux/tegra-soc.h>
 
 #include <governor.h>
@@ -183,6 +184,13 @@ static void nvhost_scale_notify(struct platform_device *pdev, bool busy)
        if (!profile)
                return;
 
+       /* inform edp about new constraint */
+       if (pdata->gpu_edp_device) {
+               u32 avg = 0;
+               actmon_op().read_avg_norm(profile->actmon, &avg);
+               tegra_edp_notify_gpu_load(avg);
+       }
+
        /* If defreq is disabled, set the freq to max or min */
        if (!devfreq) {
                unsigned long freq = busy ? UINT_MAX : 0;