/** * struct xvtc_device - Xilinx Video Timing Controller device structure * @xvip: Xilinx Video IP device * @list: entry in the global VTC list * @has_detector: the VTC has a timing detector * @has_generator: the VTC has a timing generator * @config: generator timings configuration
*/ struct xvtc_device { struct xvip_device xvip; struct list_head list;
int xvtc_generator_start(struct xvtc_device *xvtc, conststruct xvtc_config *config)
{ int ret;
if (!xvtc->has_generator) return -ENXIO;
ret = clk_prepare_enable(xvtc->xvip.clk); if (ret < 0) return ret;
/* We don't care about the chroma active signal, encoding parameters are * not important for now.
*/
xvtc_gen_write(xvtc, XVTC_POLARITY,
XVTC_POLARITY_ACTIVE_CHROMA_POL |
XVTC_POLARITY_ACTIVE_VIDEO_POL |
XVTC_POLARITY_HSYNC_POL | XVTC_POLARITY_VSYNC_POL |
XVTC_POLARITY_HBLANK_POL | XVTC_POLARITY_VBLANK_POL);
/* Hardcode the polarity to active high, as required by the video in to * AXI4-stream core.
*/
xvtc_gen_write(xvtc, XVTC_ENCODING, 0);
/* Configure the timings. The VBLANK and VSYNC signals assertion and * deassertion are hardcoded to the first pixel of the line.
*/
xvtc_gen_write(xvtc, XVTC_ACTIVE_SIZE,
(config->vblank_start << XVTC_ACTIVE_VSIZE_SHIFT) |
(config->hblank_start << XVTC_ACTIVE_HSIZE_SHIFT));
xvtc_gen_write(xvtc, XVTC_HSIZE, config->hsize);
xvtc_gen_write(xvtc, XVTC_VSIZE, config->vsize);
xvtc_gen_write(xvtc, XVTC_HSYNC,
(config->hsync_end << XVTC_HSYNC_END_SHIFT) |
(config->hsync_start << XVTC_HSYNC_START_SHIFT));
xvtc_gen_write(xvtc, XVTC_F0_VBLANK_H, 0);
xvtc_gen_write(xvtc, XVTC_F0_VSYNC_V,
(config->vsync_end << XVTC_F0_VSYNC_VEND_SHIFT) |
(config->vsync_start << XVTC_F0_VSYNC_VSTART_SHIFT));
xvtc_gen_write(xvtc, XVTC_F0_VSYNC_H, 0);
/* Enable the generator. Set the source of all generator parameters to * generator registers.
*/
xvip_write(&xvtc->xvip, XVIP_CTRL_CONTROL,
XVTC_CONTROL_ACTIVE_CHROMA_POL_SRC |
XVTC_CONTROL_ACTIVE_VIDEO_POL_SRC |
XVTC_CONTROL_HSYNC_POL_SRC | XVTC_CONTROL_VSYNC_POL_SRC |
XVTC_CONTROL_HBLANK_POL_SRC | XVTC_CONTROL_VBLANK_POL_SRC |
XVTC_CONTROL_CHROMA_SRC | XVTC_CONTROL_VBLANK_HOFF_SRC |
XVTC_CONTROL_VSYNC_END_SRC | XVTC_CONTROL_VSYNC_START_SRC |
XVTC_CONTROL_ACTIVE_VSIZE_SRC |
XVTC_CONTROL_FRAME_VSIZE_SRC | XVTC_CONTROL_HSYNC_END_SRC |
XVTC_CONTROL_HSYNC_START_SRC |
XVTC_CONTROL_ACTIVE_HSIZE_SRC |
XVTC_CONTROL_FRAME_HSIZE_SRC | XVTC_CONTROL_GEN_ENABLE |
XVIP_CTRL_CONTROL_REG_UPDATE);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.