#ifndef _ARM_IMX_IMX51_IPUV3_H
#define _ARM_IMX_IMX51_IPUV3_H
#include <dev/wscons/wsconsio.h>
#include <dev/wscons/wsdisplayvar.h>
#include <sys/bus.h>
struct imx51_ipuv3_screen {
LIST_ENTRY(imx51_ipuv3_screen) link;
bus_dmamap_t dma;
bus_dma_segment_t segs[1];
int nsegs;
size_t buf_size;
size_t map_size;
void *buf_va;
int depth;
int stride;
struct ipuv3_dma_descriptor *dma_desc;
paddr_t dma_desc_pa;
};
struct lcd_panel_geometry {
int depth;
short panel_width;
short panel_height;
uint32_t pixel_clk;
short hsync_width;
short left;
short right;
short vsync_width;
short upper;
short lower;
short panel_info;
#define IPUV3PANEL_SHARP (1<<0)
uint32_t panel_sig_pol;
};
struct imx51_ipuv3_softc {
device_t dev;
bus_space_tag_t iot;
bus_space_handle_t cm_ioh;
bus_space_handle_t dmfc_ioh;
bus_space_handle_t di0_ioh;
bus_space_handle_t dp_ioh;
bus_space_handle_t dc_ioh;
bus_space_handle_t idmac_ioh;
bus_space_handle_t cpmem_ioh;
bus_space_handle_t dctmpl_ioh;
bus_dma_tag_t dma_tag;
uint32_t flags;
#define FLAG_NOUSE_ACBIAS (1U<<0)
const struct lcd_panel_geometry *geometry;
int n_screens;
LIST_HEAD(, imx51_ipuv3_screen) screens;
struct imx51_ipuv3_screen *active;
void *ih;
device_t fbdev;
};
struct imx51_ipuv3_softc;
void imx51_ipuv3_attach_sub(struct imx51_ipuv3_softc *,
struct axi_attach_args *, const struct lcd_panel_geometry *);
int imx51_ipuv3_cnattach(bool);
void imx51_ipuv3_start_dma(struct imx51_ipuv3_softc *,
struct imx51_ipuv3_screen *);
void imx51_ipuv3_geometry(struct imx51_ipuv3_softc *,
const struct lcd_panel_geometry *);
int imx51_ipuv3_new_screen(struct imx51_ipuv3_softc *,
struct imx51_ipuv3_screen **);
int imx51_ipuv3_show_screen(void *, void *, int, void (*)(void *, int, int),
void *);
#endif