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>
47 lines
1.1 KiB
C
47 lines
1.1 KiB
C
#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 */
|