aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/pvr.h8
-rw-r--r--include/video/omapdss.h55
-rw-r--r--include/video/sgx-util.h64
3 files changed, 127 insertions, 0 deletions
diff --git a/include/linux/pvr.h b/include/linux/pvr.h
new file mode 100644
index 00000000000..49f64e00f84
--- /dev/null
+++ b/include/linux/pvr.h
@@ -0,0 +1,8 @@
+#ifndef __PVR_H
+#define __PVR_H
+
+struct sgx_platform_data {
+ unsigned long fclock_max;
+};
+
+#endif
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 892b97f8e15..26b3b9a1e8b 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -22,6 +22,7 @@
#include <linux/kobject.h>
#include <linux/device.h>
#include <linux/platform_device.h>
+#include <linux/notifier.h>
#include <asm/atomic.h>
#define DISPC_IRQ_FRAMEDONE (1 << 0)
@@ -188,6 +189,48 @@ enum omap_dss_clk_source {
OMAP_DSS_CLK_SRC_DSI2_PLL_HSDIV_DSI, /* OMAP4: PLL2_CLK2 */
};
+/**
+ * Go event is triggered when all dss caches are clean (including shadow
+ * registers).
+ *
+ * This is used in xserver xv implementation to block writing to overlay until
+ * dss has completed reading same memory area.
+ *
+ * Example use in xv:
+ * If there is manual update triggered by gfx overlay first wait_for_go()
+ * doesn't block but wait_gfx() would block.
+ ** Frame 5 to first "buffer"
+ * wait_for_go()
+ * fill frame
+ * pan to first "buffer"
+ * update_window() for frame 1
+ * request update notify
+ ** Frame 6 to second "buffer" (wait_gfx() would block here)
+ * wait_for_go()
+ * fill frame
+ * pan to second "buffer"
+ ** Frame 7 to first "buffer"
+ * wait_for_go() blocking
+ * First update completes
+ * wait_for_go() returns
+ * update notify arrives
+ * update_window() for frame 2
+ * fill frame
+ * pan to third frame
+ *
+ * Update event is sent when manual update completes. Update event is not
+ * available for automatic update displays (returns -EINVAL).
+ */
+enum omap_dss_notify_event {
+ OMAP_DSS_NOTIFY_NONE = 0 << 0,
+ OMAP_DSS_NOTIFY_GO_MGR = 1 << 0,
+ OMAP_DSS_NOTIFY_UPDATE_MGR = 2 << 0,
+ OMAP_DSS_NOTIFY_MASK_MGR = 3 << 0,
+ OMAP_DSS_NOTIFY_GO_OVL = 1 << 2,
+ OMAP_DSS_NOTIFY_UPDATE_OVL = 2 << 2,
+ OMAP_DSS_NOTIFY_MASK_OVL = 3 << 2,
+};
+
/* RFBI */
struct rfbi_timings {
@@ -349,6 +392,8 @@ struct omap_overlay {
struct omap_overlay_info *info);
int (*wait_for_go)(struct omap_overlay *ovl);
+ int (*notify)(struct omap_overlay *ovl,
+ enum omap_dss_notify_event events);
};
struct omap_overlay_manager_info {
@@ -392,6 +437,8 @@ struct omap_overlay_manager {
int (*apply)(struct omap_overlay_manager *mgr);
int (*wait_for_go)(struct omap_overlay_manager *mgr);
+ int (*notify)(struct omap_overlay_manager *mgr,
+ enum omap_dss_notify_event events);
int (*wait_for_vsync)(struct omap_overlay_manager *mgr);
int (*enable)(struct omap_overlay_manager *mgr);
@@ -584,10 +631,18 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num);
int omap_dss_get_num_overlays(void);
struct omap_overlay *omap_dss_get_overlay(int num);
+void omap_dss_lock_cache(void);
+void omap_dss_unlock_cache(void);
+
void omapdss_default_get_resolution(struct omap_dss_device *dssdev,
u16 *xres, u16 *yres);
int omapdss_default_get_recommended_bpp(struct omap_dss_device *dssdev);
+int omap_dss_register_notifier(struct notifier_block *nb);
+int omap_dss_unregister_notifier(struct notifier_block *nb);
+
+int omap_dss_request_notify(enum omap_dss_notify_event event, long value);
+
typedef void (*omap_dispc_isr_t) (void *arg, u32 mask);
int omap_dispc_register_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
int omap_dispc_unregister_isr(omap_dispc_isr_t isr, void *arg, u32 mask);
diff --git a/include/video/sgx-util.h b/include/video/sgx-util.h
new file mode 100644
index 00000000000..4a5bd7ff50a
--- /dev/null
+++ b/include/video/sgx-util.h
@@ -0,0 +1,64 @@
+/*
+ * SGX utility functions
+ *
+ * Copyright (C) 2010 Nokia 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.,
+ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+ */
+
+#ifndef __SGX_UTIL_H
+#define __SGX_UTIL_H
+
+#include <linux/kernel.h>
+
+#define OMAPLFB_PAGE_SIZE 4096
+
+/* Greatest common divisor */
+static unsigned long gcd(unsigned long a, unsigned long b)
+{
+ unsigned long r;
+
+ if (a < b) {
+ r = a;
+ a = b;
+ b = r;
+ }
+
+ while ((r = a % b) != 0) {
+ a = b;
+ b = r;
+ }
+
+ return b;
+}
+
+/*
+ * Workout the smallest size that is aligned to both 4K (for the SGX)
+ * and line length (for the fbdev driver).
+ */
+static unsigned int sgx_buffer_align(unsigned stride, unsigned size)
+{
+ unsigned lcm;
+
+ if (!stride || !size)
+ return 0;
+
+ lcm = stride * OMAPLFB_PAGE_SIZE / gcd(stride,
+ OMAPLFB_PAGE_SIZE);
+
+ return roundup(size, lcm);
+}
+
+#endif /* __SGX_UTIL_H */