summaryrefslogtreecommitdiff
path: root/drivers/video/tegra/dc/dc_priv.h
diff options
context:
space:
mode:
authorGary King <gking@nvidia.com>2010-08-31 16:45:55 -0700
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:36:05 -0800
commit9959643c6064aa0004d6de393dd9921bb6cc3cf2 (patch)
treeea21088e48234fc5d1a836bcbee3458bc98e0345 /drivers/video/tegra/dc/dc_priv.h
parentd91682bc73fa7b86a0db3a1d39e6735498df9ec8 (diff)
video: tegra: add host1x support to driver
includes changes by: Antti Hatala <ahatala@nvidia.com> (1) Gary King <gking@nvidia.com> (1) Erik Gilling <konkers@android.com> (2) Antti Hatala <ahatala@nvidia.com> video: tegra: dc: use nvhost driver for host1x power management Gary King <gking@nvidia.com> video: tegra: fb: add ioctl to flip dc windows to nvmap handles Erik Gilling <konkers@android.com> video: tegra: dc: increment syncpoints following window flips video: tegra: drain syncpt waits on display disable Original commit messages: ** video: tegra: dc: use nvhost driver for host1x power management Incrementing the frame done syncpoint value from the display interrupt requires that the host module is powered on. As the syncpoint state is saved and restored automatically by the host driver a cpu increment of a syncpoint in the powered down state will be lost. Also adds checks for host module being powered. ** video: tegra: fb: add ioctl to flip dc windows to nvmap handles tegra user-space graphics drivers may allocate framebuffers using nvmap rather than rendering to the common framebuffer, this may be done to support deeper buffer pipelining, color formats and pixel layouts other than the initial bootup framebuffer, etc. to use this ioctl, a caller must first specify an nvmap fd which is already open in the calling process so that the subsequent flip ioctls may be properly validated. flips are performed asynchronously, with flip completion notifications provided back to the caller via the host1x syncpoint mechanism based on earlier changes made by Antti Hatala <ahatala@nvidia.com> and Erik Gilling <konkers@android.com> Change-Id: I4e8a8bb92085a485d65fd87d89112b2969ee37ff Signed-off-by: Gary King <gking@nvidia.com>
Diffstat (limited to 'drivers/video/tegra/dc/dc_priv.h')
-rw-r--r--drivers/video/tegra/dc/dc_priv.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/drivers/video/tegra/dc/dc_priv.h b/drivers/video/tegra/dc/dc_priv.h
index 2297be40f030..39a03e8fb9c0 100644
--- a/drivers/video/tegra/dc/dc_priv.h
+++ b/drivers/video/tegra/dc/dc_priv.h
@@ -22,6 +22,7 @@
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/wait.h>
+#include "../host/dev.h"
struct tegra_dc;
@@ -54,7 +55,6 @@ struct tegra_dc {
int irq;
struct clk *clk;
- struct clk *host1x_clk;
bool enabled;
@@ -74,17 +74,33 @@ struct tegra_dc {
struct resource *fb_mem;
struct tegra_fb_info *fb;
+
+ u32 syncpt_id;
+ u32 syncpt_min;
+ u32 syncpt_max;
};
+static inline void tegra_dc_io_start(struct tegra_dc *dc)
+{
+ nvhost_module_busy(&dc->ndev->host->mod);
+}
+
+static inline void tegra_dc_io_end(struct tegra_dc *dc)
+{
+ nvhost_module_idle(&dc->ndev->host->mod);
+}
+
static inline unsigned long tegra_dc_readl(struct tegra_dc *dc,
unsigned long reg)
{
+ BUG_ON(!nvhost_module_powered(&dc->ndev->host->mod));
return readl(dc->base + reg * 4);
}
static inline void tegra_dc_writel(struct tegra_dc *dc, unsigned long val,
unsigned long reg)
{
+ BUG_ON(!nvhost_module_powered(&dc->ndev->host->mod));
writel(val, dc->base + reg * 4);
}