aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2/dsscomp/dsscomp.h
diff options
context:
space:
mode:
authorLajos Molnar <molnar@ti.com>2011-05-06 04:06:39 -0700
committerRebecca Schultz Zavin <rebecca@android.com>2011-07-11 17:00:31 -0700
commit1c863283b7cd34f3e54095b70e8107e2ce1b6d0e (patch)
treefa45d40aa9e773ecb516c18ad21d7937aea07301 /drivers/video/omap2/dsscomp/dsscomp.h
parent7af6fc804bed4a7805f9235e24ca270f3f3e1806 (diff)
downloadkernel_samsung_tuna-1c863283b7cd34f3e54095b70e8107e2ce1b6d0e.zip
kernel_samsung_tuna-1c863283b7cd34f3e54095b70e8107e2ce1b6d0e.tar.gz
kernel_samsung_tuna-1c863283b7cd34f3e54095b70e8107e2ce1b6d0e.tar.bz2
OMAP:DSS:DSSCOMP: New composition module
This patch implements a new DSS composition module. DSSCOMP allows specifying a whole composition for a DSS display: 1. set overlay information for all overlays on a manager 2. reroute the overlays to the manager (overlay must be disabled just as when using sysfs) 3. set manager information 4. optionally call manager->apply() that programs the DISPC 4. optionally do an update (after a sync call) DSS already implements coordinated updates by separating overlay information setting from the applicaion of those settings (which happens only in manager->apply()). However current users of DSS call manager->apply() for each change, which make coordinated change impossible. This API also implements auto cropping of all layers to the display region. This makes switching displays and handling display resolution changes easier (without getting "failed to setup overlay" messages.) DSSCOMP operates on 3 levels. base.c contains the basic DSS operations, such as setting DSS overlay and managers using DSSCOMP's setting structures. Theoretically, DSSCOMP could be used via only these operations. queue.c contains the queuing mechanism. This module maintains compositions queued to each overlay manager (the basic DSS composition entity). Each composition is referred to by a unique sync-id. Queueing operations consist of creating a composition, setting/getting manager/overlay information for the composition, applying the composition to the display (which also displays it on manually updated panels), waiting on various states of a composition. For now the basic queuing mechanism of DSSCOMP is "queue and forget". Therefore, it is not necessary to dequeue each frame queued. A consequence of this methodology is that if one applies a composition to a display, any prior unapplied compositions will be dropped. The queuing interface tracks which overlay is assigned to which manager. This is done at the DSS programming level, as that is the most reliable place to monitor overlay ownership. Nonetheless, the device interface uses overlay information to verify overlay ownership - which may be slightly out of sync. The user of DSSCOMP should maintain overlay ownership to ensure flawless sharing of overlays between managers. (E.g. should not use an overlay on a new manager, until the overlay has been disabled on the previous manager, and that composition has been programmed.) device.c contains the device hooks to operating system, and the file interface (via /dev/dsscomp's ioctls). /dev/dsscomp works on top of the queueing mechanism. There are 3 levels of header files. linux/dsscomp.h: basic dsscomp structures and ioctls plat/dsscomp.h: kernel dsscomp interface (on top of linux/dsscomp.h) local dsscomp.h: common implementation structures and shared methods Note: plat/dsscomp.h defines a handle typedef that causes a checkpatch warning. I feel that the creation of a handle typedef is warranted. Limitations: - no WB support - unsure whether to call sync on non-manual update panels - cannot get overlay/manager information on a composition without first having set it - not fully operational - still debugging some unit test issues Change-Id: Ie62e8eeccfd6f3cae9e39e30d5105fa2bad68c62 Signed-off-by: Lajos Molnar <molnar@ti.com>
Diffstat (limited to 'drivers/video/omap2/dsscomp/dsscomp.h')
-rw-r--r--drivers/video/omap2/dsscomp/dsscomp.h83
1 files changed, 83 insertions, 0 deletions
diff --git a/drivers/video/omap2/dsscomp/dsscomp.h b/drivers/video/omap2/dsscomp/dsscomp.h
new file mode 100644
index 0000000..baf8034
--- /dev/null
+++ b/drivers/video/omap2/dsscomp/dsscomp.h
@@ -0,0 +1,83 @@
+/*
+ * linux/drivers/video/omap2/dsscomp/base.c
+ *
+ * DSS Composition basic operation support
+ *
+ * Copyright (C) 2011 Texas Instruments, Inc
+ * Author: Lajos Molnar <molnar@ti.com>
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published by
+ * the Free Software Foundation.
+ *
+ * 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, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef _DSSCOMP_H
+#define _DSSCOMP_H
+
+#include <linux/miscdevice.h>
+#include <linux/debugfs.h>
+
+#define MAX_OVERLAYS 5
+#define MAX_MANAGERS 3
+#define MAX_DISPLAYS 4
+
+#define DEBUG_OVERLAYS (1 << 0)
+#define DEBUG_COMPOSITIONS (1 << 1)
+#define DEBUG_PHASES (1 << 2)
+#define DEBUG_WAITS (1 << 3)
+
+/*
+ * Utility macros
+ */
+#define ZERO(c) memset(&c, 0, sizeof(c))
+#define ZEROn(c, n) memset(c, 0, sizeof(*c) * n)
+#define DEV(c) (c->dev.this_device)
+
+/**
+ * DSS Composition Device Driver
+ *
+ * @dev: misc device base
+ * @dbgfs: debugfs hook
+ */
+struct dsscomp_dev {
+ struct miscdevice dev;
+ struct dentry *dbgfs;
+
+ /* cached DSS objects */
+ u32 num_ovls;
+ struct omap_overlay *ovls[MAX_OVERLAYS];
+ u32 num_mgrs;
+ struct omap_overlay_manager *mgrs[MAX_MANAGERS];
+ u32 num_displays;
+ struct omap_dss_device *displays[MAX_DISPLAYS];
+};
+
+extern int debug;
+
+/*
+ * Kernel interface
+ */
+int dsscomp_queue_init(struct dsscomp_dev *cdev);
+void dsscomp_queue_exit(void);
+
+/* basic operation - if not using queues */
+int set_dss_ovl_info(struct dss2_ovl_info *oi);
+int set_dss_mgr_info(struct dss2_mgr_info *mi);
+struct omap_overlay_manager *find_dss_mgr(int display_ix);
+
+/*
+ * Debug functions
+ */
+void dump_ovl_info(struct dsscomp_dev *cdev, struct dss2_ovl_info *oi);
+void dump_comp_info(struct dsscomp_dev *cdev, struct dsscomp_setup_mgr_data *d,
+ const char *phase);
+
+#endif