diff options
author | Terje Bergstrom <tbergstrom@nvidia.com> | 2011-07-26 14:09:02 +0300 |
---|---|---|
committer | Varun Colbert <vcolbert@nvidia.com> | 2011-08-15 17:03:48 -0700 |
commit | f82ab0099542584b5fbbead9f7e7ac7c6ecedad5 (patch) | |
tree | 3e8949bd109e35c1411b8ea28d492aa1c5f62b17 | |
parent | 0908837e1ee70103f403be038f14ea7a67ad272a (diff) |
nvhost: Move include files to kernel/include
To prepare for kernel modularization, nvhost include files need to be
moved from mach-tegra/include to kernel/include. At the same time
user space specific part is split into nvhost_ioctl.h.
Bug 854182
Change-Id: I3694a40d786028733310ecf5b59341282af571be
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: http://git-master/r/43211
Reviewed-by: Varun Colbert <vcolbert@nvidia.com>
Tested-by: Varun Colbert <vcolbert@nvidia.com>
25 files changed, 113 insertions, 78 deletions
diff --git a/arch/arm/mach-tegra/board-aruba-panel.c b/arch/arm/mach-tegra/board-aruba-panel.c index 21f7a49580f0..1d534081f627 100644 --- a/arch/arm/mach-tegra/board-aruba-panel.c +++ b/arch/arm/mach-tegra/board-aruba-panel.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-aruba-panel.c * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include <asm/mach-types.h> #include <linux/platform_device.h> #include <linux/pwm_backlight.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include <mach/irqs.h> #include <mach/iomap.h> diff --git a/arch/arm/mach-tegra/board-cardhu-panel.c b/arch/arm/mach-tegra/board-cardhu-panel.c index 9264af525105..6b4d8e3f725b 100644 --- a/arch/arm/mach-tegra/board-cardhu-panel.c +++ b/arch/arm/mach-tegra/board-cardhu-panel.c @@ -27,7 +27,7 @@ #include <linux/earlysuspend.h> #include <linux/pwm_backlight.h> #include <asm/atomic.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include <mach/irqs.h> #include <mach/iomap.h> diff --git a/arch/arm/mach-tegra/board-enterprise-panel.c b/arch/arm/mach-tegra/board-enterprise-panel.c index b5227c87d341..62079a5a09f5 100644 --- a/arch/arm/mach-tegra/board-enterprise-panel.c +++ b/arch/arm/mach-tegra/board-enterprise-panel.c @@ -27,7 +27,7 @@ #include <linux/earlysuspend.h> #include <linux/tegra_pwm_bl.h> #include <asm/atomic.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include <mach/irqs.h> #include <mach/iomap.h> diff --git a/arch/arm/mach-tegra/board-harmony-panel.c b/arch/arm/mach-tegra/board-harmony-panel.c index 2a40eb3d305a..1498c44aba4f 100644 --- a/arch/arm/mach-tegra/board-harmony-panel.c +++ b/arch/arm/mach-tegra/board-harmony-panel.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-harmony-panel.c * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,7 +25,7 @@ #include <asm/mach-types.h> #include <linux/platform_device.h> #include <linux/pwm_backlight.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include <mach/irqs.h> #include <mach/iomap.h> diff --git a/arch/arm/mach-tegra/board-ventana-panel.c b/arch/arm/mach-tegra/board-ventana-panel.c index 5ad6acd57472..3f9fcd7a871d 100644 --- a/arch/arm/mach-tegra/board-ventana-panel.c +++ b/arch/arm/mach-tegra/board-ventana-panel.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-ventana-panel.c * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,7 +26,7 @@ #include <linux/platform_device.h> #include <linux/earlysuspend.h> #include <linux/pwm_backlight.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include <mach/irqs.h> #include <mach/iomap.h> diff --git a/arch/arm/mach-tegra/board-whistler-panel.c b/arch/arm/mach-tegra/board-whistler-panel.c index b485b36445ed..346b9cc1dfb1 100644 --- a/arch/arm/mach-tegra/board-whistler-panel.c +++ b/arch/arm/mach-tegra/board-whistler-panel.c @@ -1,7 +1,7 @@ /* * arch/arm/mach-tegra/board-whistler-panel.c * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,7 +28,7 @@ #include <linux/kernel.h> #include <linux/pwm_backlight.h> #include <linux/tegra_pwm_bl.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include <mach/irqs.h> #include <mach/iomap.h> diff --git a/arch/arm/mach-tegra/include/mach/tegra_dc_ext.h b/arch/arm/mach-tegra/include/mach/tegra_dc_ext.h index f94626f5a980..559bc129c082 100644 --- a/arch/arm/mach-tegra/include/mach/tegra_dc_ext.h +++ b/arch/arm/mach-tegra/include/mach/tegra_dc_ext.h @@ -19,8 +19,6 @@ #ifndef __MACH_TEGRA_DC_EXT_H #define __MACH_TEGRA_DC_EXT_H -#include <mach/nvhost.h> - struct tegra_dc_ext; #ifdef CONFIG_TEGRA_DC_EXTENSIONS diff --git a/drivers/video/tegra/dc/dc.c b/drivers/video/tegra/dc/dc.c index 9a06791dcb21..371e3c26a326 100644 --- a/drivers/video/tegra/dc/dc.c +++ b/drivers/video/tegra/dc/dc.c @@ -40,7 +40,7 @@ #include <mach/dc.h> #include <mach/fb.h> #include <mach/mc.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/latency_allowance.h> #include "dc_reg.h" diff --git a/drivers/video/tegra/dc/dsi.c b/drivers/video/tegra/dc/dsi.c index 6f046553998a..b278946f24c4 100644 --- a/drivers/video/tegra/dc/dsi.c +++ b/drivers/video/tegra/dc/dsi.c @@ -30,7 +30,7 @@ #include <mach/clk.h> #include <mach/dc.h> #include <mach/fb.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <../gpio-names.h> #include "dc_reg.h" diff --git a/drivers/video/tegra/dc/hdmi.c b/drivers/video/tegra/dc/hdmi.c index 8dbfb299d6d5..7768ad1978e5 100644 --- a/drivers/video/tegra/dc/hdmi.c +++ b/drivers/video/tegra/dc/hdmi.c @@ -34,7 +34,7 @@ #include <mach/clk.h> #include <mach/dc.h> #include <mach/fb.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/hdmi-audio.h> #include <video/tegrafb.h> diff --git a/drivers/video/tegra/dc/nvhdcp.c b/drivers/video/tegra/dc/nvhdcp.c index bac87781bb9d..5ff53949864e 100644 --- a/drivers/video/tegra/dc/nvhdcp.c +++ b/drivers/video/tegra/dc/nvhdcp.c @@ -26,7 +26,6 @@ #include <asm/atomic.h> #include <mach/dc.h> -#include <mach/nvhost.h> #include <mach/kfuse.h> #include <video/nvhdcp.h> diff --git a/drivers/video/tegra/dc/overlay.c b/drivers/video/tegra/dc/overlay.c index 6f42242a7102..c8a49c8ed3b3 100644 --- a/drivers/video/tegra/dc/overlay.c +++ b/drivers/video/tegra/dc/overlay.c @@ -33,7 +33,7 @@ #include <mach/dc.h> #include <mach/fb.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include "dc_priv.h" #include "../nvmap/nvmap.h" diff --git a/drivers/video/tegra/fb.c b/drivers/video/tegra/fb.c index 6aff1cab30d4..0787131d8dd8 100644 --- a/drivers/video/tegra/fb.c +++ b/drivers/video/tegra/fb.c @@ -36,7 +36,7 @@ #include <mach/dc.h> #include <mach/fb.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include "host/dev.h" diff --git a/drivers/video/tegra/host/bus.c b/drivers/video/tegra/host/bus.c index a633950aeaff..0ba30dd99ffa 100644 --- a/drivers/video/tegra/host/bus.c +++ b/drivers/video/tegra/host/bus.c @@ -2,11 +2,9 @@ * drivers/video/tegra/host/bus.c * * Copyright (C) 2010 Google, Inc. + * Author: Erik Gilling <konkers@google.com> * - * Author: - * Erik Gilling <konkers@google.com> - * - * based heavily on drivers/base/platform.c + * Copyright (C) 2010-2011 NVIDIA Corporation * * This software is licensed under the terms of the GNU General Public * License version 2, as published by the Free Software Foundation, and @@ -20,8 +18,7 @@ */ #include <linux/pm_runtime.h> - -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include "dev.h" diff --git a/drivers/video/tegra/host/chip_support.h b/drivers/video/tegra/host/chip_support.h index c63200189b34..a0b0f0278a0f 100644 --- a/drivers/video/tegra/host/chip_support.h +++ b/drivers/video/tegra/host/chip_support.h @@ -23,6 +23,7 @@ #define _NVHOST_CHIP_SUPPORT_H_ struct output; +struct nvhost_waitchk; struct nvhost_chip_support { struct { diff --git a/drivers/video/tegra/host/dev.c b/drivers/video/tegra/host/dev.c index 16479962127d..37d18bc2d175 100644 --- a/drivers/video/tegra/host/dev.c +++ b/drivers/video/tegra/host/dev.c @@ -37,7 +37,8 @@ #include <asm/io.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> +#include <linux/nvhost_ioctl.h> #include <mach/nvmap.h> #include <mach/gpufuse.h> diff --git a/drivers/video/tegra/host/nvhost_cdma.h b/drivers/video/tegra/host/nvhost_cdma.h index 64d17249f6af..e48d733850a9 100644 --- a/drivers/video/tegra/host/nvhost_cdma.h +++ b/drivers/video/tegra/host/nvhost_cdma.h @@ -26,7 +26,7 @@ #include <linux/sched.h> #include <linux/semaphore.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include "nvhost_acm.h" diff --git a/drivers/video/tegra/host/nvhost_channel.h b/drivers/video/tegra/host/nvhost_channel.h index e108a2078911..c939a19d3fad 100644 --- a/drivers/video/tegra/host/nvhost_channel.h +++ b/drivers/video/tegra/host/nvhost_channel.h @@ -3,7 +3,7 @@ * * Tegra Graphics Host Channel * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,7 @@ #define NVHOST_MAX_HANDLES 1280 struct nvhost_master; +struct nvhost_waitchk; struct nvhost_channeldesc { const char *name; diff --git a/drivers/video/tegra/host/nvhost_hwctx.h b/drivers/video/tegra/host/nvhost_hwctx.h index 83d93bd871eb..06df90e58fb5 100644 --- a/drivers/video/tegra/host/nvhost_hwctx.h +++ b/drivers/video/tegra/host/nvhost_hwctx.h @@ -26,7 +26,7 @@ #include <linux/string.h> #include <linux/kref.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> struct nvhost_channel; diff --git a/drivers/video/tegra/host/nvhost_syncpt.c b/drivers/video/tegra/host/nvhost_syncpt.c index 71233096c0c6..6236dedf5f88 100644 --- a/drivers/video/tegra/host/nvhost_syncpt.c +++ b/drivers/video/tegra/host/nvhost_syncpt.c @@ -3,7 +3,7 @@ * * Tegra Graphics Host Syncpoints * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include <linux/nvhost_ioctl.h> #include "nvhost_syncpt.h" #include "dev.h" diff --git a/drivers/video/tegra/host/nvhost_syncpt.h b/drivers/video/tegra/host/nvhost_syncpt.h index b6db72e915a9..c8f8b4bb1262 100644 --- a/drivers/video/tegra/host/nvhost_syncpt.h +++ b/drivers/video/tegra/host/nvhost_syncpt.h @@ -3,7 +3,7 @@ * * Tegra Graphics Host Syncpoints * - * Copyright (c) 2010, NVIDIA Corporation. + * Copyright (c) 2010-2011, NVIDIA Corporation. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,10 +25,13 @@ #include <linux/kernel.h> #include <linux/sched.h> -#include <mach/nvhost.h> +#include <linux/nvhost.h> #include <mach/nvmap.h> #include <asm/atomic.h> +struct nvhost_syncpt; +struct nvhost_waitchk; + /* host managed and invalid syncpt id */ #define NVSYNCPT_GRAPHICS_HOST (0) #define NVSYNCPT_INVALID (-1) diff --git a/drivers/video/tegra/host/t20/syncpt_t20.c b/drivers/video/tegra/host/t20/syncpt_t20.c index ade896e6299e..781654b656da 100644 --- a/drivers/video/tegra/host/t20/syncpt_t20.c +++ b/drivers/video/tegra/host/t20/syncpt_t20.c @@ -20,6 +20,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ +#include <linux/nvhost_ioctl.h> #include "../nvhost_syncpt.h" #include "../dev.h" diff --git a/include/linux/nvhost.h b/include/linux/nvhost.h new file mode 100644 index 000000000000..a1d211de1ef1 --- /dev/null +++ b/include/linux/nvhost.h @@ -0,0 +1,73 @@ +/* + * include/linux/nvhost.h + * + * Tegra graphics host driver + * + * Copyright (c) 2009-2011, NVIDIA Corporation. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that 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, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +#ifndef __LINUX_NVHOST_H +#define __LINUX_NVHOST_H + +#include <linux/device.h> +#include <linux/types.h> + +struct nvhost_master; + +struct nvhost_device { + const char *name; + struct device dev; + int id; + u32 num_resources; + struct resource *resource; + + struct nvhost_master *host; +}; + +extern int nvhost_device_register(struct nvhost_device *); +extern void nvhost_device_unregister(struct nvhost_device *); + +extern struct bus_type nvhost_bus_type; + +struct nvhost_driver { + int (*probe)(struct nvhost_device *); + int (*remove)(struct nvhost_device *); + void (*shutdown)(struct nvhost_device *); + int (*suspend)(struct nvhost_device *, pm_message_t state); + int (*resume)(struct nvhost_device *); + struct device_driver driver; +}; + +extern int nvhost_driver_register(struct nvhost_driver *); +extern void nvhost_driver_unregister(struct nvhost_driver *); +extern struct resource *nvhost_get_resource(struct nvhost_device *, + unsigned int, unsigned int); +extern int nvhost_get_irq(struct nvhost_device *, unsigned int); +extern struct resource *nvhost_get_resource_byname(struct nvhost_device *, + unsigned int, const char *); +extern int nvhost_get_irq_byname(struct nvhost_device *, const char *); + +#define to_nvhost_device(x) container_of((x), struct nvhost_device, dev) +#define to_nvhost_driver(drv) (container_of((drv), struct nvhost_driver, \ + driver)) + +#define nvhost_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) +#define nvhost_set_drvdata(_dev, data) dev_set_drvdata(&(_dev)->dev, (data)) + +int nvhost_bus_register(struct nvhost_master *host); + +#endif diff --git a/arch/arm/mach-tegra/include/mach/nvhost.h b/include/linux/nvhost_ioctl.h index 8d7031791eab..6e49827b873c 100644 --- a/arch/arm/mach-tegra/include/mach/nvhost.h +++ b/include/linux/nvhost_ioctl.h @@ -1,5 +1,5 @@ /* - * include/linux/nvhost.h + * include/linux/nvhost_ioctl.h * * Tegra graphics host driver * @@ -20,60 +20,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -#ifndef __LINUX_NVHOST_H -#define __LINUX_NVHOST_H +#ifndef __LINUX_NVHOST_IOCTL_H +#define __LINUX_NVHOST_IOCTL_H -#include <linux/device.h> #include <linux/ioctl.h> #include <linux/types.h> -struct nvhost_master; - -struct nvhost_device { - const char *name; - struct device dev; - int id; - u32 num_resources; - struct resource *resource; - - struct nvhost_master *host; -}; - -extern int nvhost_device_register(struct nvhost_device *); -extern void nvhost_device_unregister(struct nvhost_device *); - -extern struct bus_type nvhost_bus_type; - -struct nvhost_driver { - int (*probe)(struct nvhost_device *); - int (*remove)(struct nvhost_device *); - void (*shutdown)(struct nvhost_device *); - int (*suspend)(struct nvhost_device *, pm_message_t state); - int (*resume)(struct nvhost_device *); - struct device_driver driver; -}; - -extern int nvhost_driver_register(struct nvhost_driver *); -extern void nvhost_driver_unregister(struct nvhost_driver *); -extern struct resource *nvhost_get_resource(struct nvhost_device *, unsigned int, unsigned int); -extern int nvhost_get_irq(struct nvhost_device *, unsigned int); -extern struct resource *nvhost_get_resource_byname(struct nvhost_device *, unsigned int, const char *); -extern int nvhost_get_irq_byname(struct nvhost_device *, const char *); - -#define to_nvhost_device(x) container_of((x), struct nvhost_device, dev) -#define to_nvhost_driver(drv) (container_of((drv), struct nvhost_driver, \ - driver)) - -#define nvhost_get_drvdata(_dev) dev_get_drvdata(&(_dev)->dev) -#define nvhost_set_drvdata(_dev,data) dev_set_drvdata(&(_dev)->dev, (data)) - -int nvhost_bus_register(struct nvhost_master *host); - #if !defined(__KERNEL__) #define __user #endif +#define NVHOST_INVALID_SYNCPOINT 0xFFFFFFFF #define NVHOST_NO_TIMEOUT (-1) +#define NVHOST_NO_CONTEXT 0x0 #define NVHOST_IOCTL_MAGIC 'H' /* version 0 header (used with write() submit interface) */ @@ -214,6 +173,7 @@ struct nvhost_ctrl_module_regrdwr_args { #define NVHOST_IOCTL_CTRL_LAST \ _IOC_NR(NVHOST_IOCTL_CTRL_SYNCPT_WAITEX) -#define NVHOST_IOCTL_CTRL_MAX_ARG_SIZE sizeof(struct nvhost_ctrl_module_regrdwr_args) +#define NVHOST_IOCTL_CTRL_MAX_ARG_SIZE \ + sizeof(struct nvhost_ctrl_module_regrdwr_args) #endif diff --git a/arch/arm/mach-tegra/include/trace/events/nvhost.h b/include/trace/events/nvhost.h index 2a1845950ed5..2a1845950ed5 100644 --- a/arch/arm/mach-tegra/include/trace/events/nvhost.h +++ b/include/trace/events/nvhost.h |