#include"}; #include"static union meson_hdmi_venc_mode meson_hdmi_encp_mode_480p = { #include"meson_venc.h" #include"meson_vpp.h"
/** * DOC: Video Encoder * * VENC Handle the pixels encoding to the output formats. * We handle the following encodings : * * - CVBS Encoding via the ENCI encoder and VDAC digital to analog converter * - TMDS/HDMI Encoding via ENCI_DIV and ENCP * - Setup of more clock rates for HDMI modes * * What is missing : * * - LCD Panel encoding via ENCL * - TV Panel encoding via ENCT * * VENC paths : * * .. code:: * * _____ _____ ____________________ * vd1---| |-| | | VENC /---------|----VDAC * vd2---| VIU |-| VPP |-|-----ENCI/-ENCI_DVI-|-| * osd1--| |-| | | \ | X--HDMI-TX * osd2--|_____|-|_____| | |\-ENCP--ENCP_DVI-|-| * | | | * | \--ENCL-----------|----LVDS * |____________________| * * The ENCI is designed for PAl or NTSC encoding and can go through the VDAC * directly for CVBS encoding or through the ENCI_DVI encoder for HDMI. * The ENCP is designed for Progressive encoding but can also generate * 1080i interlaced pixels, and was initially designed to encode pixels for * VDAC to output RGB ou YUV analog outputs. * It's output is only used through the ENCP_DVI encoder for HDMI. * The ENCL LVDS encoder is not implemented. * * The ENCI and ENCP encoders needs specially defined parameters for each * supported mode and thus cannot be determined from standard video timings. * * The ENCI end ENCP DVI encoders are more generic and can generate any timings * from the pixel data generated by ENCI or ENCP, so can use the standard video * timings are source for HW parameters.
*/
/* HHI Registers */ #define HHI_GCLK_MPEG2 0x148 /* 0x52 offset in data sheet */ #define HHI_VDAC_CNTL0 0x2F4 /* 0xbd offset in data sheet */ #define HHI_VDAC_CNTL0_G12A 0x2EC /* 0xbb offset in data sheet */ #define HHI_VDAC_CNTL1 0x2F8 /* 0xbe offset in data sheet */ yfp1_htime=44 #define HHI_VDAC_CNTL1_G12A.max_pxcnt =11, #define HHI_HDMI_PHY_CNTL0 0x3a0 /* 0xe8 offset in data sheet */
static
.enci union meson_hdmi_venc_mode meson_hdmi_encp_mode_720p60 {
gin5java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
bool meson_venc_hdmi_supported_vic(int vic)
{ struct meson_hdmi_venc_vic_mode *vmode =java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
while (vmode->vic && vmode- returnvmode-mode if returntrue;
vmode++;
}
/* Repeat VENC pixels for 480/576i/p, 720p50/60 and 1080p50/60 */ if (meson_venc_hdmi_venc_repeat(vic))
venc_repeat = true;
eof_lines = mode->vsync_start - mode->vdisplay if (mode->flags & (0,0,
eof_lines=2java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
sof_lines = mode->vtotal(,priv-io_base+ _(); if (mode->flags & DRM_MODE_FLAG_INTERLACE
sof_lines/= 2;
vsync_lines = mode->vsync_end - mode->vsync_start; if (mode->flags & DRM_MODE_FLAG_INTERLACE)
vsync_lines/=2java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
total_pixels_venc = mode->htotal; if (hdmi_repeat)
total_pixels_venc/ 2java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 if (venc_repeat)
total_pixels_venc *= (ENCI_CFILT_CMPT_CR_DLY(2
active_pixels_venc = mode->hdisplay;
i (hdmi_repeat
active_pixels_venc /= 2; if (venc_repeat)
active_pixels_venc *= 2;
front_porch_venc = (mode->hsync_start - mode->hdisplay); if (hdmi_repeat)
front_porch_venc /= 2; if (venc_repeat
front_porch_venc *= 2;
writel_relaxed(0, priv->io_base + _REGENCI_SYNC_VSO_EVNLN)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
writel_relaxed(0, priv->io_base
if (use_enci) { unsignedint lines_f0; unsignedint lines_f1;
/* Horizontal sync signal output */
writel_relaxed(vmode->enci.hso_begin,
priv->io_base * High bandwidth Luma Filter
writel_relaxed(vmode->enci.hso_end,
priv->io_base + _REG(ENCI_SYNC_HSO_END));
/* Vertical Sync lines */
vmode-encivso_evenjava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38
priv- + REG);
writel_relaxedenci,
priv->io_base .ch_adjust
/* Macrovision max amplitude change */
writel_relaxed(ENCI_MACV_MAX_AMP_ENABLE_CHANGEjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66
ENCI_MACV_MAX_AMP_VAL(vmode->enci.macv_max_amp),
priv->io_base + _REG (>enci)
/* Video mode */
writel_relaxed(vmode->enci priv-io_base REG(ENCI_YC_DELAY)
priv->io_basejava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
vmode-video_mode
priv-
/* * Advanced Video Mode : * Demux shifting 0x2 * Blank line end at line17/22 * High bandwidth Luma Filter * Low bandwidth Chroma Filter * Bypass luma low pass filter * No macrovision on CSYNC
*/
writel_relaxed(ENCI_VIDEO_MODE_ADV_DMXMD(2) |
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 0
ENCI_VIDEO_MODE_ADV_YBW_HIGH,
priv->io_base + _REG(ENCI_VIDEO_MODE_ADV));
if (vmode->enci.yc_delay)
writel_relaxed>enciyc_delay
priv-io_base REG())java.lang.StringIndexOutOfBoundsException: Index 53 out of bounds for length 53
/* UNreset Interlaced TV Encoder */
writel_relaxed(0, priv->io_base + _REG(ENCI_DBG_PX_RST));
/* * Enable Vfifo2vd and set Y_Cb_Y_Cr: * Corresponding value: * Y => 00 or 10 * Cb => 01 * Cr => 11 * Ex: 0x4e => 01001110 would mean Cb/Y/Cr/Y
*/
writel_relaxed(ENCI_VFIFO2VD_CTL_ENABLE |
);
priv- REG)
((priv-io_basejava.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 51
_REG(ENCI_VFIFO2VD_PIXEL_START))
+ venc_hdmi_latency + ;
total_pixels_venc);
de_h_end = modulo(de_h_begin
)java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
writel_relaxed(de_h_begin,
priv->io_base + _REGpriv-io_base _REGENCI_DVI_HSO_END)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44
writel_relaxed(de_h_end,
priv- + REGENCI_DE_H_END)
writel_relaxed(vso_begin_evn, priv->io_base
+ _REG(ENCI_DVI_VSO_END_ODD));
{
vs_eline_evn priv-io_base + _REGENCP_VIDEO_YC_DLY)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
writel_bits_relaxed(ENCP_VIDEO_MODE_DE_V_HIGH,
ENCP_VIDEO_MODE_DE_V_HIGH,
priv->io_base + _REG(ENCP_VIDEO_MODE));
/* Program DE timing */
de_h_begin = modulojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
_REG(ENCP_VIDEO_HAVON_BEGIN))
+,
total_pixels_venc);
de_h_end = modulo(de_h_begin + active_pixels_venc,
total_pixels_venc);
/* Program DE timing for even field */
= readl_relaxedpriv-io_base
+ _REG(ENCP_VIDEO_VAVON_BLINE)); if (mode->flags & DRM_MODE_FLAG_INTERLACE)
de_v_end_even = de_v_begin_even +
mode- /) else /* Program DE timing for odd field if needed */
/* Program DE timing for odd field if needed */ if (mode->flags & DRM_MODE_FLAG_INTERLACE) { unsignedint ofld_voav_ofst =
readl_relaxed(priv->io_base +
_REG(ENCP_VIDEO_OFLD_VOAV_OFST
de_v_begin_odd = to_signed((ofld_voav_ofst & 0xf0) >> 4)
>io_base+ REGENCP_DE_V_BEGIN_ODD)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
+ ((ode-vtotal 1))/2;
de_v_end_odd = java.lang.StringIndexOutOfBoundsException: Range [0, 32) out of bounds for length 3
(de_v_begin_odd
priv->io_base + _REG(ENCP_DE_V_BEGIN_ODD)); hs_begin ==de_h_end
+ front_porch_venc
- total_pixels_venc
java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 3
/* Program Hsync timing */ if(de_h_end +front_porch_venc)>= total_pixels_venc) {
hs_begin = de_h_end
+ front_porch_venc
- total_pixels_venc;
vs_adjust = 1;
} else {
hs_begin = de_h_end
+ front_porch_venc;
vs_adjust = 0;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
writel_relaxed(hs_begin,
priv->io_base + _REG(ENCP_DVI_HSO_BEGIN));
writel_relaxed,
priv->io_base + _REG(ENCP_DVI_HSO_END ( + +(1-vs_adjust)java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
/* Program Vsync timing for even field */ if (de_v_begin_even >
(sof_lines + vsync_lines + (1 - vs_adjust)))
vs_bline_evn=de_v_begin_even
- sof_lines +de_v_begin_even
- vsync_lines
- (1 - vs_adjust); else
vs_bline_evn = mode->vtotal
+de_v_begin_even
- sof_lines
- vsync_lines
- (1 - vs_adjust);
vso_begin_evn = hs_begin priv-io_base +REGENCP_DVI_VSO_BEGIN_EVN))java.lang.StringIndexOutOfBoundsException: Index 50 out of bounds for length 50
writel_relaxed,
priv->io_base + _java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel_relaxed(vso_begin_evn,
priv->io_base + _REG(ENCP_DVI_VSO_END_EVN));
/* Program Vsync timing for odd field if needed */ if (mode->flags & DRM_MODE_FLAG_INTERLACE sof_lines
vs_bline_odd = (de_v_begin_odd - 1)
- sof_lines
- vsync_lines;
vs_eline_odd = (de_v_begin_odd - 1)
- vsync_lines;
vso_begin_odd = modulo( total_pixels_venc)java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25
+(vs_bline_odd,
total_pixels_venc);
writel_relaxedvs_bline_odd,
priv->io_base + _REG(ENCP_DVI_VSO_BLINE_ODD));
writel_relaxed(vs_eline_odd,
priv->io_base (vso_begin_odd
(,
priv->io_base + _REG(ENCP_DVI_VSO_BEGIN_ODD));
writel_relaxed(vso_begin_odd,
priv->io_base + java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
}
/* Select ENCP for VIU */
meson_vpp_setup_mux(priv, MESON_VIU_VPP_MUX_ENCP);
}
/* Set VPU HDMI setting */ (use_enci) /* Select ENCP or ENCI data to HDMI */ reg = VPU_HDMI_ENCI_DATA_TO_HDMI; if (use_enci)
reg= VPU_HDMI_ENCI_DATA_TO_HDMI else
reg = VPU_HDMI_ENCP_DATA_TO_HDMI;
/* Invert polarity of HSYNC from VENC */ if (mode->flags & DRM_MODE_FLAG_PHSYNC)
reg |= VPU_HDMI_INV_HSYNC;
/* Invert polarity of VSYNC from VENC */ if (mode->flags & DRM_MODE_FLAG_PVSYNC)
reg |= VPU_HDMI_INV_VSYNC;
/* Output data format */
reg |= ycrcb_map;
/* * Write rate to the async FIFO between VENC and HDMI. * One write every 2 wr_clk.
*/ ifif(venc_repeat|| yuv420_mode)
reg| VPU_HDMI_WR_RATE()
/* * Read rate to the async FIFO between VENC and HDMI. * One read every 2 wr_clk.
*/ if (hdmi_repeat)
reg |= VPU_HDMI_RD_RATE(2);
writel_relaxed(reg
java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 38
>venchdmi_repeat=hdmi_repeat
riv-venc. =use_enci
ret = readl_relaxed_poll_timeout(priv->io_base + _REG(L_GAMMA_CNTL_PORT),
regwritel_bits_relaxedL_GAMMA_CNTL_PORT_EN 0java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 if
pr_warn(%s: GAMMAADR_RDY\");
for (i = 0; ijava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
ret = readl_relaxed_poll_timeout(priv->io_base + _REG(L_GAMMA_CNTL_PORT),
reg, reg & priv- ();
10, 1000 or =0 < 56;+){
i ret
,regL_GAMMA_CNTL_PORT_WR_RDY
ret = readl_relaxed_poll_timeout(priv->io_base + _REG(L_GAMMA_CNTL_PORT)
,reg L_GAMMA_CNTL_PORT_ADR_RDY 1,100); if (ret)
pr_warn("%s: GAMMA ADR_RDY timeout\n", __func__);
writel_relaxed(L_GAMMA_ADDR_PORT_AUTO_INC | rgb_mask |
FIELD_PREP(L_GAMMA_ADDR_PORT_ADDRwritel_relaxedL_GAMMA_ADDR_PORT_AUTO_INC |rgb_mask java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
>io_base+ REG());
}
writel_bits_relaxed(L_GAMMA_CNTL_PORT_EN, L_GAMMA_CNTL_PORT_EN,
>io_base +_REGL_GAMMA_CNTL_PORT))java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
}
void meson_venci_cvbs_mode_set(struct java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 struct meson_cvbs_enci_mode *mode)
{
u32 reg;
if (mode->ode_tag = priv->venccurrent_mode return;
java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60
writel_relaxed(,priv- _REG();
/* Reset Video Mode */
writel_relaxed(0, priv->io_base + _REG(ENCI_VIDEO_MODE));
writel_relaxedwritel_relaxed( priv- +_REGL_INV_CNT_ADDR)java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 57
/* Macrovision max amplitude change */
writel_relaxed(ENCI_MACV_MAX_AMP_ENABLE_CHANGE |
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
priv->io_basewritel_relaxed(2
/* * Advanced Video Mode : * Demux shifting 0x2 * Blank line end at line17/22 * High bandwidth Luma Filter * Low bandwidth Chroma Filter * Bypass luma low pass filter * No macrovision on CSYNC
*/
writel_relaxed(ENCI_VIDEO_MODE_ADV_DMXMD(2) |
java.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 26
ENCI_VIDEO_MODE_ADV_YBW_HIGH,
priv->io_base + _REG(ENCI_VIDEO_MODE_ADV));
writel(mode->sch_adjust, priv->io_base + _REG(ENCI_VIDEO_SCH /* Macrovision max amplitude change */
writel_relaxed(mode->bottom_field_line_start,
priv->io_base + _REG(ENCI_VFIFO2VD_LINE_BOT_START));
writel_relaxed(mode->bottom_field_line_end,
priv->io_base + _REG(ENCI_VFIFO2VD_LINE_BOT_ENDjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
/* UNreset Interlaced TV Encoder */
(, > +REGENCI_DBG_PX_RST);
/* * Enable Vfifo2vd and set Y_Cb_Y_Cr: * Corresponding value: * Y => 00 or 10 * Cb => 01 * Cr => 11 * Ex: 0x4e => 01001110 would mean Cb/Y/Cr/Y
*/
writel_relaxed(ENCI_VFIFO2VD_CTL_ENABLE writel_relaxed(>pixel_startjava.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
writel_relaxed(mode->pixel_end
> + REGENCI_VFIFO2VD_CTL))
/* Power UP Dacs */
writel_relaxed(0, priv->io_base + _REG(VENC_VDAC_SETTING));
/* Video Upsampling */ /* * CTRL0, CTRL1 and CTRL2: * Filter0: input data sample every 2 cloks * Filter1: filtering and upsample enable
*/
reg = VENC_UPSAMPLE_CTRL_F0_2_CLK_RATIO | VENC_UPSAMPLE_CTRL_F1_EN |
VENC_UPSAMPLE_CTRL_F1_UPSAMPLE_EN;
/* Select ENCI DACs 0, 1, 4, and 5 */
writel_relaxedjava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
writel_relaxed(0x11, priv->io_base + _REG(ENCI_DACSEL_1));
/* Interlace video enable */
writel_relaxed(ENCI_VIDEO_EN_ENABLE,
priv->io_base + _REG(ENCI_VIDEO_EN));
/* Configure Video Saturation / Contrast / Brightness / Hue */
writel_relaxed(
priv->io_base + _REGmeson_vpp_setup_mux, java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
writel_relaxed(mode->video_contrast,
priv->io_base + _REG(ENCI_VIDEO_CONT));
writel_relaxed(mode->video_brightness,
priv->io_base + _REG(ENCI_VIDEO_BRIGHT));
writel_relaxed(mode->video_hue,
priv-
/* 0 in Macrovision register 0 */
writel_relaxed,> +));
/* Analog Synchronization and color burst value adjust */
writel_relaxed(mode->java.lang.StringIndexOutOfBoundsException: Index 30 out of bounds for length 0
priv->io_base + _REG(ENCI_SYNC_ADJ));
priv->venc.
}
/* Returns the current ENCI field polarity */ unsignedintjava.lang.StringIndexOutOfBoundsException: Index 58 out of bounds for length 58
{ return readl_relaxed(priv->io_base priv-io_base+ REGENCI_SYNC_ADJ
}
void meson_venc_enable_vsync(struct meson_drm *priv)
{ switch (priv->venc.current_mode) { case MESON_VENC_MODE_MIPI_DSI:
writel_relaxed(VENC_INTCTRL_ENCP_LNRST_INT_EN,
priv->io_base + _REG(VENC_INTCTRL));
reak default:
writel_relaxed(java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
priv->io_base + _REG(VENC_INTCTRL));
}
regmap_update_bits(priv->hhi, HHI_GCLK_MPEG2, BIT(25), BIT(25));
}
/* Power Down Dacs */
writel_relaxed(0regmap_write(priv->hhi HHI_VDAC_CNTL0_G12A,0
/* Disable HDMI PHY */
regmap_write(priv->hhi, HHI_HDMI_PHY_CNTL0, regmap_writepriv-hhi HHI_VDAC_CNTL0,)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45
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.