3.2.1.2.1. Configuration Requirements
Configuration of the video timing requires a detailed understanding of the requirements of the intended display in your system and Altera recommends that you consult your display manufacturer for guidance. When entering the horizontal timing parameters, it is important to calculate the values based on the video input clock rate. This clock rate may be different from the datasheet values.
You must consider the following factors described in this section when determining the timing configuration to ensure that the system is viable. Otherwise, the output video may be corrupted or lose synchronization. In some cases, it may be necessary to increase the MIPI data rate or increase the lane count on the MIPI D-PHY interface to ensure that sufficient bandwidth is available to carry the required video stream.
The timing parameters are defined in the same way as the Video Timing Generator IP in the Altera Video and Vision Processing Suite. Note that all horizontal values are defined in horizontal units rather than clock cycles. In the YCbCr 12-bit format, the horizontal unit is a pair of pixels, due to the way that 4:2:0 data is carried. In all other formats, the horizontal unit is a single pixel.
For example, if the IP is configured with 2 pixels-in-parallel on the AXI4-Stream video interface with the data type RGB 24-bit and HTOTAL=2200, then the line interval is 1100 clock cycles. This should be considered when calculating line intervals and frame rates.
The configuration of all horizontal timing parameters (HTOTAL, HB_END, HS_START, HS_END, V1S_HSTART, V1S_HEND) must be an integer value that is the multiple of the configured number of pixels in parallel at the input. For example, if the IP is configured with 2 pixels in parallel, then both HB_END and HTOTAL must be a multiple of 2.
For YCbCr 12-bit format, the relationship is:
Altera recommends that you calculate and observe the minimum value of HTOTAL that is supported for a given system. The following formula indicates the shortest line interval that is supported by the selected configuration of the IP.
If the MIPI D-PHY IP link is configured longer than the default timing interval parameters, this value requires a corresponding increase. This value is calculated and displayed in the Parameter Editor. If your HTOTAL value does not comply with this value, an error is displayed. Disabling the video timing parameter validation option avoids this error but may result in video corruption and loss of synchronization.
- packed_pixel_width is the number of bits required to insert a single pixel into the packed output stream. For example, 16 for the RGB-16bit data type. When loosely-packed data types are selected, the packed pixel width should account for the additional bits consumed in these formats. For example, YCbCr 20bit (Loose) requires 24-bits per pixel when packing the video stream with unused bits, therefore the pixel width used in these calculations must use the higher value.
- active_line_length is the number of pixels per video line.
- lanes is the number of MIPI lanes configured in the MIPI DSI-2 IP and MIPI D-PHY IP.
- ppi_width is the bit width of the PPI interface between the MIPI DSI-2 IP and MIPI D-PHY IP, which is fixed to 16.
- pixels_in_parallel is the configured pixels in parallel at the streaming video input to the MIPI DSI-2 IP.
The line interval and frame rate can be calculated from the configured timing values. The video timing generation operates on the same clock used on the AXI4-Stream video input interface. When the option for the common video input and MIPI link clocks is enabled, this clock is the MIPI D-PHY link word clock, and this clock frequency is calculated and displayed in the MIPI D-PHY IP parameter editor for the configured IP. When the option for the common clocks is disabled, this is the frequency of your supplied input clock.
Refactoring this formula, if your frame rate and total line count is fixed, you can calculate the required horizontal timing parameters based on these values using the following formula. Note, you must ensure that HTOTAL complies with HTOTALmin:
It is important to consider the available bandwidth on both the AXI4-Stream and MIPI interfaces to ensure that your chosen video timing is feasible. The MIPI interface must have sufficient bandwidth to pass a line of video data within the line interval shown by the calculation above. An approximation of the configured peak data transfer rates on input and output can be calculated as follows:
For example, a system carrying YCbCr 20bit (Packed) data with a line length of 1280 pixels, 815 total lines per frame (active + blanking) at 60 frames per second has a peak input data rate of 1.25Gbps + MIPI signaling overheads.
When comparing input and output rates, the MIPI DSI-2 in-band sync signaling and MIPI D-PHY LP/HS transition duration must be taken into consideration. The above calculation for data_rate_output_bps ignores these values. The HTOTALmin calculation provides a more accurate horizontal timing estimate.