summaryrefslogtreecommitdiffstats
path: root/include/video
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2014-12-14 17:37:51 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-07-13 08:38:19 +0200
commit70007036a5e65247b7e9ccfa1fe6763e8e94d21d (patch)
tree249186893183d410441dc125ec10d3c794ccc789 /include/video
parentc76bfc96384333830d0301fb2e5e4ba557ceaac4 (diff)
downloadbarebox-70007036a5e65247b7e9ccfa1fe6763e8e94d21d.tar.gz
barebox-70007036a5e65247b7e9ccfa1fe6763e8e94d21d.tar.xz
video: Add Video Pipeline (VPL) support
Complex video pipelines are modelled with the of_graph bindings in the devicetree. This patch adds a ioctl infrastructure to issue commands to the remote endpoint of a of_graph. Currently defined ioctls are prepare/unprepare, enable/disable and get_modes. This is enough to control LVDS or HDMI encoder or simple panels. A device node which contains of_graph endpoints can be registered as a VPL entity. An entity can receive ioctls via the .ioctl callback and also issue ioctls by calling vpl_ioctl. The core itself will never iterate over the entire pipeline. Instead, the different VPL entities should forward an ioctl to the next instance in the pipeline whenever necessary. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include/video')
-rw-r--r--include/video/vpl.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/include/video/vpl.h b/include/video/vpl.h
new file mode 100644
index 0000000000..846007f4f5
--- /dev/null
+++ b/include/video/vpl.h
@@ -0,0 +1,46 @@
+#ifndef __VIDEO_VPL_H
+#define __VIDEO_VPL_H
+
+#include <fb.h>
+
+#define VPL_PREPARE 0x67660001
+#define VPL_UNPREPARE 0x67660002
+#define VPL_ENABLE 0x67660003
+#define VPL_DISABLE 0x67660004
+#define VPL_GET_VIDEOMODES 0x67660005
+
+struct vpl {
+ int (*ioctl)(struct vpl *, unsigned int port,
+ unsigned int cmd, void *ptr);
+ struct device_node *node;
+ struct list_head list;
+};
+
+int vpl_register(struct vpl *);
+int vpl_ioctl(struct vpl *, unsigned int port,
+ unsigned int cmd, void *ptr);
+
+struct vpl *of_vpl_get(struct device_node *node, int port);
+
+static inline int vpl_ioctl_prepare(struct vpl *vpl, unsigned int port,
+ struct fb_videomode *mode)
+{
+ return vpl_ioctl(vpl, port, VPL_PREPARE, mode);
+}
+
+static inline int vpl_ioctl_unprepare(struct vpl *vpl, unsigned int port)
+{
+ return vpl_ioctl(vpl, port, VPL_UNPREPARE, NULL);
+}
+
+static inline int vpl_ioctl_enable(struct vpl *vpl, unsigned int port)
+{
+ return vpl_ioctl(vpl, port, VPL_ENABLE, NULL);
+}
+
+static inline int vpl_ioctl_disable(struct vpl *vpl, unsigned int port)
+{
+ return vpl_ioctl(vpl, port, VPL_DISABLE, NULL);
+}
+
+#endif /* __VIDEO_VPL_H */