]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
video: tegra: host: gk20a: Don't use private nvhost headers
authorArto Merilainen <amerilainen@nvidia.com>
Wed, 19 Mar 2014 07:05:23 +0000 (09:05 +0200)
committerTerje Bergstrom <tbergstrom@nvidia.com>
Tue, 25 Mar 2014 14:07:51 +0000 (07:07 -0700)
This patch modifies the code so that private nvhost headers are never
included inside the gk20a driver. The public header is still used and
hence this patch leaves some dependencies against nvhost driver.

Change-Id: I599930b379af7679a0cdc06a0b5632024503f8e3
Signed-off-by: Arto Merilainen <amerilainen@nvidia.com>
Reviewed-on: http://git-master/r/383710
Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Tested-by: Terje Bergstrom <tbergstrom@nvidia.com>
29 files changed:
drivers/video/tegra/host/bus_client.c
drivers/video/tegra/host/bus_client.h
drivers/video/tegra/host/gk20a/Makefile
drivers/video/tegra/host/gk20a/as_gk20a.h
drivers/video/tegra/host/gk20a/channel_gk20a.c
drivers/video/tegra/host/gk20a/channel_gk20a.h
drivers/video/tegra/host/gk20a/channel_sync_gk20a.c
drivers/video/tegra/host/gk20a/clk_gk20a.c
drivers/video/tegra/host/gk20a/ctrl_gk20a.c
drivers/video/tegra/host/gk20a/dbg_gpu_gk20a.c
drivers/video/tegra/host/gk20a/fb_gk20a.c
drivers/video/tegra/host/gk20a/fifo_gk20a.c
drivers/video/tegra/host/gk20a/gk20a.c
drivers/video/tegra/host/gk20a/gk20a.h
drivers/video/tegra/host/gk20a/gk20a_gating_reglist.c
drivers/video/tegra/host/gk20a/gk20a_scale.c
drivers/video/tegra/host/gk20a/gk20a_sysfs.c
drivers/video/tegra/host/gk20a/gr_ctx_gk20a.c
drivers/video/tegra/host/gk20a/gr_ctx_gk20a_sim.c
drivers/video/tegra/host/gk20a/gr_gk20a.c
drivers/video/tegra/host/gk20a/ltc_common.c
drivers/video/tegra/host/gk20a/mm_gk20a.c
drivers/video/tegra/host/gk20a/mm_gk20a.h
drivers/video/tegra/host/gk20a/platform_gk20a_tegra.c
drivers/video/tegra/host/gk20a/priv_ring_gk20a.c
drivers/video/tegra/host/gk20a/regops_gk20a.c
drivers/video/tegra/host/gk20a/therm_gk20a.c
drivers/video/tegra/host/t124/t124.c
include/linux/nvhost.h

index 41d2fe9f9617c3ec2a2509c504337bd3a62ef87d..2d76a5d0f95cd6beef55a41a4dd4bdfea32735a6 100644 (file)
@@ -1357,3 +1357,4 @@ nvhost_client_request_firmware(struct platform_device *dev, const char *fw_name)
        /* note: caller must release_firmware */
        return fw;
 }
+EXPORT_SYMBOL(nvhost_client_request_firmware);
index a2d3d2347905cf4557dfb76f232875ce16a11c76..43627c536fa81ae1339cd2c5eede622c1cec393d 100644 (file)
@@ -38,10 +38,6 @@ int nvhost_client_device_init(struct platform_device *dev);
 
 int nvhost_client_device_release(struct platform_device *dev);
 
-const struct firmware *
-nvhost_client_request_firmware(struct platform_device *dev,
-       const char *fw_name);
-
 int nvhost_client_device_get_resources(struct platform_device *dev);
 
 #endif
index 6b1211cd8ebb52c260dfd926078a9dddd4a672db..f9b06b72eead2126ad46bf8db926c8f94e6ed1a5 100644 (file)
@@ -1,6 +1,5 @@
 
 GCOV_PROFILE := y
-ccflags-y += -Idrivers/video/tegra/host
 ccflags-y += -Idrivers/devfreq
 ccflags-y += -Wno-multichar
 ccflags-y += -Werror
index fef409fee334da2a79b9e5965bf517c784b0c363..be0e97075f5aae33084c06a6387087a871d5a6ec 100644 (file)
@@ -18,6 +18,7 @@
 #define __GK20A_AS_H
 
 #include <linux/atomic.h>
+#include <linux/cdev.h>
 #include <linux/fs.h>
 
 #include <linux/nvhost_as_ioctl.h>
index dbe82c379ab12cbe5aa9f8819b04c6c680acad93..6056f558359f6c5b37083e02be5681892cbb6739 100644 (file)
@@ -1325,11 +1325,11 @@ static void trace_write_pushbuffer(struct channel_gk20a *c, struct gpfifo *g)
                 * Write in batches of 128 as there seems to be a limit
                 * of how much you can output to ftrace at once.
                 */
-               for (i = 0; i < words; i += TRACE_MAX_LENGTH) {
+               for (i = 0; i < words; i += 128U) {
                        trace_gk20a_push_cmdbuf(
                                c->g->dev->name,
                                0,
-                               min(words - i, TRACE_MAX_LENGTH),
+                               min(words - i, 128U),
                                offset + i * sizeof(u32),
                                mem);
                }
@@ -1893,7 +1893,7 @@ int gk20a_channel_resume(struct gk20a *g)
 
        for (chid = 0; chid < f->num_channels; chid++) {
                if (f->channel[chid].in_use) {
-                       nvhost_dbg_info("resume channel %d", chid);
+                       gk20a_dbg_info("resume channel %d", chid);
                        g->ops.fifo.bind_channel(&f->channel[chid]);
                        channels_in_use = true;
                }
index c97e85741a339f73deda570a0dd0b47fa91fe7da..429db85d4177e4da1476f830d26c73fb0b49acfe 100644 (file)
@@ -30,7 +30,6 @@ struct gk20a;
 struct gr_gk20a;
 struct dbg_session_gk20a;
 
-#include "nvhost_channel.h"
 #include "channel_sync_gk20a.h"
 
 #include "mm_gk20a.h"
index 9f9c3ba7ac71cdcc42f3261b79a3576f626473e5..286e974e73334be30ee8d43274b85e3f67d561a0 100644 (file)
@@ -21,7 +21,7 @@
 #include "gk20a.h"
 
 #ifdef CONFIG_SYNC
-#include "../../../staging/android/sync.h"
+#include "../../../../staging/android/sync.h"
 #endif
 
 #ifdef CONFIG_TEGRA_GK20A
index acc7f8f36d03438a360053c92483a7ae1d93afdb..151a332b8cbd95b6af3b518257e212b7a29bd52a 100644 (file)
@@ -25,8 +25,6 @@
 #include <linux/clk/tegra.h>
 #include <mach/thermal.h>
 
-#include "../dev.h"
-
 #include "gk20a.h"
 #include "hw_trim_gk20a.h"
 #include "hw_timer_gk20a.h"
index 1d959b739291e292110353b2b122e6d8b991c489..9128959f60a7bb08d5c72bd1643b298b3f1d7da0 100644 (file)
 #include <linux/cdev.h>
 #include <linux/nvhost_gpu_ioctl.h>
 
-#include "dev.h"
-#include "class_ids.h"
-#include "bus_client.h"
-#include "nvhost_acm.h"
-
 #include "gk20a.h"
 
 int gk20a_ctrl_dev_open(struct inode *inode, struct file *filp)
index 8306473bd65a44e6d0e56ebf0b599a6017b58d6e..da7d733e3fd0e91c55d91b92a4ed4c7cbc1f3be8 100644 (file)
@@ -23,8 +23,6 @@
 #include <linux/nvhost.h>
 #include <linux/nvhost_dbg_gpu_ioctl.h>
 
-#include "dev.h"
-#include "nvhost_acm.h"
 #include "gk20a.h"
 #include "gr_gk20a.h"
 #include "dbg_gpu_gk20a.h"
index e82d1b2114c86f4cd91ec3259ef0f0ce1832f2e1..52f2db4d9e28f156adcf58500c2af417ffc9cabd 100644 (file)
@@ -14,8 +14,8 @@
  */
 
 #include <linux/types.h>
-#include <dev.h>
-#include "gk20a/gk20a.h"
+
+#include "gk20a.h"
 #include "kind_gk20a.h"
 #include "hw_mc_gk20a.h"
 
index 00968d36c9563be65b2f92a35eb4b1f2a386d9c9..5575b995a100c6212338f2c4c4ea3bf380d8fbb4 100644 (file)
 #include <linux/scatterlist.h>
 #include <trace/events/gk20a.h>
 #include <linux/dma-mapping.h>
+#include <linux/nvhost.h>
 
-#include "../dev.h"
-
-#include "debug_gk20a.h"
 #include "gk20a.h"
+#include "debug_gk20a.h"
 #include "hw_fifo_gk20a.h"
 #include "hw_pbdma_gk20a.h"
 #include "hw_ccsr_gk20a.h"
index 927241d291e804348d4e6c8b6cf64c9fcdc5db8a..4cc500dee6f2836115e7d8d661e3903bf56b5da5 100644 (file)
 
 #include <mach/pm_domains.h>
 
-#include "dev.h"
-#include "class_ids.h"
-#include "bus_client.h"
-#include "nvhost_acm.h"
-
 #include "gk20a.h"
 #include "debug_gk20a.h"
 #include "ctrl_gk20a.h"
@@ -1352,9 +1347,6 @@ static int gk20a_probe(struct platform_device *dev)
 
        set_gk20a(dev, gk20a);
        gk20a->dev = dev;
-#ifdef CONFIG_TEGRA_GK20A
-       gk20a->host = nvhost_get_host(dev);
-#endif
 
        err = gk20a_user_init(dev);
        if (err)
@@ -1676,6 +1668,7 @@ gk20a_request_firmware(struct gk20a *g, const char *fw_name)
        if (!fw)
                fw = nvhost_client_request_firmware(g->dev, fw_name);
 #endif
+
        if (!fw) {
                dev_err(dev, "failed to get firmware\n");
                return NULL;
index 22ab13795c566c526acabfbfc378c7b121495589..caa29d8dfc6ae1148f3b5fffb18327585b68a263 100644 (file)
@@ -28,11 +28,13 @@ struct channel_gk20a;
 struct gr_gk20a;
 struct sim_gk20a;
 
-#include "dev.h"
-
-#include <linux/tegra-soc.h>
+#include <linux/sched.h>
 #include <linux/spinlock.h>
 #include <linux/nvhost_gpu_ioctl.h>
+#include <linux/tegra-soc.h>
+
+#include "../../../../../arch/arm/mach-tegra/iomap.h"
+
 #include "as_gk20a.h"
 #include "clk_gk20a.h"
 #include "fifo_gk20a.h"
@@ -43,8 +45,6 @@ struct sim_gk20a;
 #include "therm_gk20a.h"
 #include "platform_gk20a.h"
 
-#include "../../../../../arch/arm/mach-tegra/iomap.h"
-
 extern struct platform_device tegra_gk20a_device;
 
 bool is_gk20a_module(struct platform_device *dev);
@@ -133,7 +133,6 @@ struct gpu_ops {
 };
 
 struct gk20a {
-       struct nvhost_master *host;
        struct platform_device *dev;
 
        struct resource *reg_mem;
@@ -413,10 +412,6 @@ static inline struct device *dev_from_gk20a(struct gk20a *g)
 {
        return &g->dev->dev;
 }
-static inline struct nvhost_syncpt *syncpt_from_gk20a(struct gk20a* g)
-{
-       return &(nvhost_get_host(g->dev)->syncpt);
-}
 static inline struct gk20a *gk20a_from_as(struct gk20a_as *as)
 {
        return container_of(as, struct gk20a, as);
index e5ae38bc8996dfb15c9240511ec412155b804a82..c6478a5e1328140ad4451ff8ef624aded875fec0 100644 (file)
@@ -21,7 +21,6 @@
 #define __gk20a_gating_reglist_h__
 
 #include <linux/types.h>
-#include "dev.h"
 #include "gk20a_gating_reglist.h"
 
 struct gating_desc {
index 8293007deafcd052a519a64c804dd6742f436ddf..d1fd71fe4e369c4e25747d9eedc8124c48d968c4 100644 (file)
 
 #include <governor.h>
 
-#include "dev.h"
-#include "chip_support.h"
-#include "nvhost_acm.h"
 #include "gk20a.h"
 #include "pmu_gk20a.h"
 #include "clk_gk20a.h"
 #include "gk20a_scale.h"
-#include "gr3d/scale3d.h"
 
 static ssize_t gk20a_scale_load_show(struct device *dev,
                                     struct device_attribute *attr,
index 67057f602fb698a34132b308b4408167efbd6a5a..f6b43f506bd0634436da03bea8ba4cfd95bde188 100644 (file)
  */
 
 #include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
 #include <linux/kernel.h>
 #include <linux/fb.h>
 
-#include "../dev.h"
+#include <mach/clk.h>
+
 #include "gk20a.h"
 #include "gr_gk20a.h"
 #include "fifo_gk20a.h"
-#include "nvhost_acm.h"
-#include <mach/clk.h>
 
 
 #define PTIMER_FP_FACTOR                       1000000
index 525dc28f21a363f4023d7d872616d52838127e56..59404f1d886814ff1f3f6ea0195cdba239afbc08 100644 (file)
@@ -21,9 +21,6 @@
 
 #include <linux/firmware.h>
 
-#include "dev.h"
-#include "bus_client.h"
-
 #include "gk20a.h"
 #include "gr_ctx_gk20a.h"
 #include "hw_gr_gk20a.h"
index d4393439a5d6f51d348a617cc8facb5c29ad7eea..12bba1fd7249a2c691aa907238af2c36288ec8e8 100644 (file)
@@ -19,8 +19,6 @@
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "../dev.h"
-
 #include "gk20a.h"
 #include "gr_ctx_gk20a.h"
 
index 988812b64f8595c3b4c98441e42c45ca38bcbe05..0a7b89ccb4e13ce58320e822414317f2ff113c16 100644 (file)
@@ -25,9 +25,7 @@
 #include <linux/vmalloc.h>
 #include <linux/dma-mapping.h>
 #include <linux/firmware.h>
-
-#include "../dev.h"
-#include "bus_client.h"
+#include <linux/nvhost.h>
 
 #include "gk20a.h"
 #include "kind_gk20a.h"
@@ -50,7 +48,6 @@
 #include "hw_fb_gk20a.h"
 #include "hw_therm_gk20a.h"
 #include "hw_pbdma_gk20a.h"
-#include "chip_support.h"
 #include "gr_pri_gk20a.h"
 #include "regops_gk20a.h"
 #include "dbg_gpu_gk20a.h"
index 6c18cd33ad337e03f65829357e9af605bd391f59..2eb9329cb17f369a1ec2816b4d3ac82e98df4c6e 100644 (file)
@@ -24,8 +24,6 @@
 #include "gk20a.h"
 #include "gr_gk20a.h"
 
-#include "dev.h"
-
 static int gk20a_determine_L2_size_bytes(struct gk20a *g)
 {
        const u32 gpuid = GK20A_GPUID(g->gpu_characteristics.arch,
index 0c7dde41755d33ab259b898714102cf317683497..b22df5e87de6c60953fa7360ee5a698d49a21211 100644 (file)
@@ -31,7 +31,6 @@
 #include <linux/dma-buf.h>
 #include <asm/cacheflush.h>
 
-#include "dev.h"
 #include "gk20a.h"
 #include "mm_gk20a.h"
 #include "hw_gmmu_gk20a.h"
index 241e0bde170ab9c7767b383128030305f8f3735c..23d15c232763b2f96ffc262a20bfe9f5a8059d5b 100644 (file)
@@ -137,6 +137,7 @@ struct pm_ctx_desc {
 };
 
 struct gr_ctx_buffer_desc;
+struct platform_device;
 struct gr_ctx_buffer_desc {
        void (*destroy)(struct platform_device *, struct gr_ctx_buffer_desc *);
        struct sg_table *sgt;
index ed149c8fc3c23610a87c7bff3b0ec969e600065f..97c301c625c7192d9695d7fcaf14273e907bd93e 100644 (file)
  * more details.
  */
 
-#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 <linux/debugfs.h>
-#include "t124/syncpt_t124.h"
-#include "../../../../../arch/arm/mach-tegra/iomap.h"
 #include <linux/tegra-powergate.h>
 #include <linux/platform_data/tegra_edp.h>
 #include <linux/nvhost_ioctl.h>
 #include <mach/irqs.h>
 #include <mach/pm_domains.h>
 
+#include "../../../../../arch/arm/mach-tegra/iomap.h"
+
 #include "gk20a.h"
 #include "hal_gk20a.h"
+#include "platform_gk20a.h"
+#include "gk20a_scale.h"
 
 #define TEGRA_GK20A_INTR               INT_GPU
 #define TEGRA_GK20A_INTR_NONSTALL      INT_GPU_NONSTALL
index acee82c38cc87343cf75579858f6d6e14462c8b6..aea1a80bbcad36003a741bf7c27a8a1b0da53639 100644 (file)
@@ -18,8 +18,6 @@
 
 #include <linux/delay.h>       /* for mdelay */
 
-#include "../dev.h"
-
 #include "gk20a.h"
 #include "hw_mc_gk20a.h"
 #include "hw_pri_ringmaster_gk20a.h"
index 70cdaf3fab66dbd7cccd0c06822e3323b690590d..4a115fb10fac7ce196c22f9269566e5bb7656a47 100644 (file)
@@ -22,7 +22,6 @@
 #include <linux/bsearch.h>
 #include <linux/nvhost_dbg_gpu_ioctl.h>
 
-#include "dev.h"
 #include "gk20a.h"
 #include "gr_gk20a.h"
 #include "dbg_gpu_gk20a.h"
index 028872453d0f55553ad2a95fabca3fc1413d51ec..da9119798c1f02e723f3b934f0ba816f324a14aa 100644 (file)
  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
-#include "../dev.h"
-
-#include "../t124/t124.h"
-
 #include "gk20a.h"
 #include "hw_chiplet_pwr_gk20a.h"
 #include "hw_gr_gk20a.h"
index 909fb65a83d0904626b349694f733d21bbcfdf98..f133f62d8165b01857fc368d5d02818682910434 100644 (file)
@@ -23,6 +23,7 @@
 #include <mach/mc.h>
 
 #include "dev.h"
+#include "nvhost_channel.h"
 #include "nvhost_job.h"
 #include "class_ids.h"
 
index 300f06b9886b51928a641f1e5da3cc0cfa15fa02..22ef155bc4ca51f0d93b644f66645952a6dfecd7 100644 (file)
@@ -299,8 +299,18 @@ int nvhost_intr_register_notifier(struct platform_device *pdev,
 
 #ifdef CONFIG_TEGRA_GRHOST
 void nvhost_debug_dump_device(struct platform_device *pdev);
+const struct firmware *
+nvhost_client_request_firmware(struct platform_device *dev,
+       const char *fw_name);
 #else
 static inline void nvhost_debug_dump_device(struct platform_device *pdev) {}
+
+static inline const struct firmware *
+nvhost_client_request_firmware(struct platform_device *dev,
+       const char *fw_name)
+{
+       return NULL;
+}
 #endif
 
 #ifdef CONFIG_TEGRA_GRHOST_SYNC