我现在让DM368输出colorbar到电视上显示, 使用pRGB格式输出时, colorbar的显示是正常的, 如下所示:
寄存器的配置如下:
static void davinci_enc_set_prgb(struct vid_enc_mode_info *mode_info)
{
u32 reg;
if ((strcmp(mode_info->name, VID_ENC_STD_480P_60) == 0) || (strcmp(mode_info->name, VID_ENC_STD_576P_50) == 0))
{
enableDigitalOutput(0);
}
else // 720p, 1080i
{
enableDigitalOutput(1);
}
dispc_reg_out(VENC_VIDCTL, 0x141);
dispc_reg_out(VENC_DCLKCTL, 0);
dispc_reg_out(VENC_DCLKPTN0, 0);
/* Set the OSD Divisor to 1. */
dispc_reg_out(VENC_OSDCLK0, 0);
dispc_reg_out(VENC_OSDCLK1, 1);
/* Clear composite mode register */
dispc_reg_out(VENC_CVBS, 0);
/* DM365 pinmux */
dispc_reg_out(VENC_CLKCTL, 0x11);
davinci_cfg_reg(DM365_VOUT_HVSYNC);
davinci_cfg_reg(DM365_VOUT_COUTL_EN);
davinci_cfg_reg(DM365_VOUT_COUTH_EN);
reg = __raw_readl(IO_ADDRESS(0x01c40004)); //pin mux 1
reg &= ~(3 << 18);
reg |= (2 << 18);
reg &= ~(3 << 20);
reg |= (1 << 20);
__raw_writel(reg, IO_ADDRESS(0x01c40004));
reg = __raw_readl(IO_ADDRESS(0x01c40010)); //pin mux 4
reg |= (0xf << 10);
reg |= 0xff;
__raw_writel(reg, IO_ADDRESS(0x01c40010));
reg = __raw_readl(IO_ADDRESS(0x01c40004));
printk("pinmux1:0x%08x\n", reg);
osd_write_left_margin(mode_info->left_margin – get_venc_xoff());
osd_write_upper_margin(mode_info->upper_margin);
/* Set VIDCTL to select VCLKE = 1,
VCLKZ =0, SYDIR = 0 (set o/p), DOMD = 0 */
dispc_reg_merge(VENC_VIDCTL, 1 << VENC_VIDCTL_VCLKE_SHIFT,
VENC_VIDCTL_VCLKE);
dispc_reg_merge(VENC_VIDCTL, 0 << VENC_VIDCTL_VCLKZ_SHIFT,
VENC_VIDCTL_VCLKZ);
dispc_reg_merge(VENC_VIDCTL, 0 << VENC_VIDCTL_SYDIR_SHIFT,
VENC_VIDCTL_SYDIR);
dispc_reg_merge(VENC_VIDCTL, 0 << VENC_VIDCTL_YCDIR_SHIFT,
VENC_VIDCTL_YCDIR);
dispc_reg_merge(VENC_DCLKCTL,
1 << VENC_DCLKCTL_DCKEC_SHIFT, VENC_DCLKCTL_DCKEC);
dispc_reg_out(VENC_DCLKPTN0, 0x1);
davinci_enc_set_display_timing(mode_info);
if ((strcmp(mode_info->name, VID_ENC_STD_480P_60) == 0) || (strcmp(mode_info->name, VID_ENC_STD_576P_50) == 0))
{
dispc_reg_out(VENC_SYNCCTL, (VENC_SYNCCTL_SYEV | VENC_SYNCCTL_SYEH | VENC_SYNCCTL_HPL | VENC_SYNCCTL_VPL));
}
else // 720p, 1080i
{
dispc_reg_out(VENC_SYNCCTL, (VENC_SYNCCTL_SYEV | VENC_SYNCCTL_SYEH));
}
/* Configure VMOD. No change in VENC bit */
if (!mode_info->interlaced)
{
dispc_reg_out(VENC_VMOD, 0x2011);
}
else
{
dispc_reg_out(VENC_VMOD, 0x2211);
}
dispc_reg_out(VENC_LCDOUT, 0x1);
}
当让DM368输出colorbar到电视上显示, 使用YUV422格式输出时, colorbar的颜色显示不对, 白色的变成黑色了, 黄色变成了棕色, 如下所示:
寄存器的配置如下:
static void davinci_enc_set_ycbcr16(struct vid_enc_mode_info *mode_info)
{
u32 reg;
if ((strcmp(mode_info->name, VID_ENC_STD_480P_60) == 0) || (strcmp(mode_info->name, VID_ENC_STD_576P_50) == 0))
{
enableDigitalOutput(0);
}
else // 720p, 1080i
{
enableDigitalOutput(1);
}
dispc_reg_out(VENC_VIDCTL, 0x141);
dispc_reg_out(VENC_DCLKCTL, 0);
dispc_reg_out(VENC_DCLKPTN0, 0);
/* Set the OSD Divisor to 1. */
dispc_reg_out(VENC_OSDCLK0, 0);
dispc_reg_out(VENC_OSDCLK1, 1);
/* Clear composite mode register */
dispc_reg_out(VENC_CVBS, 0);
/* DM365 pinmux */
dispc_reg_out(VENC_CLKCTL, 0x11);
davinci_cfg_reg(DM365_VOUT_HVSYNC);
davinci_cfg_reg(DM365_VOUT_COUTL_EN);
davinci_cfg_reg(DM365_VOUT_COUTH_EN);
reg = __raw_readl(IO_ADDRESS(0x01c40004)); //pin mux 1
reg &= ~(3 << 20);
reg |= (1 << 20);
__raw_writel(reg, IO_ADDRESS(0x01c40004));
reg = __raw_readl(IO_ADDRESS(0x01c40004));
printk("pinmux1:0x%08x\n", reg);
osd_write_left_margin(mode_info->left_margin – get_venc_xoff());
osd_write_upper_margin(mode_info->upper_margin);
/* Set VIDCTL to select VCLKE = 1,
VCLKZ =0, SYDIR = 0 (set o/p), DOMD = 0 */
dispc_reg_merge(VENC_VIDCTL, 1 << VENC_VIDCTL_VCLKE_SHIFT,
VENC_VIDCTL_VCLKE);
dispc_reg_merge(VENC_VIDCTL, 0 << VENC_VIDCTL_VCLKZ_SHIFT,
VENC_VIDCTL_VCLKZ);
dispc_reg_merge(VENC_VIDCTL, 0 << VENC_VIDCTL_SYDIR_SHIFT,
VENC_VIDCTL_SYDIR);
dispc_reg_merge(VENC_VIDCTL, 0 << VENC_VIDCTL_YCDIR_SHIFT,
VENC_VIDCTL_YCDIR);
dispc_reg_merge(VENC_DCLKCTL,
1 << VENC_DCLKCTL_DCKEC_SHIFT, VENC_DCLKCTL_DCKEC);
dispc_reg_out(VENC_DCLKPTN0, 0x1);
davinci_enc_set_display_timing(mode_info);
if ((strcmp(mode_info->name, VID_ENC_STD_480P_60) == 0) || (strcmp(mode_info->name, VID_ENC_STD_576P_50) == 0))
{
dispc_reg_out(VENC_SYNCCTL, (VENC_SYNCCTL_SYEV | VENC_SYNCCTL_SYEH | VENC_SYNCCTL_HPL | VENC_SYNCCTL_VPL));
}
else // 720p, 1080i
{
dispc_reg_out(VENC_SYNCCTL, (VENC_SYNCCTL_SYEV | VENC_SYNCCTL_SYEH));
}
/* Configure VMOD. No change in VENC bit */
if (!mode_info->interlaced)
{
dispc_reg_out(VENC_VMOD, 0x0011);
}
else
{
dispc_reg_out(VENC_VMOD, 0x0211);
}
dispc_reg_out(VENC_LCDOUT, 0x1);
}
请问下是什么原因导致颜色显示不正常的? 有哪些寄存器还需要配置, 谢谢.
Chris Meng:
你好,
你说的color bar是你DDR上的,还是VENC内部的?
如果是DDR上的,请确认使用的OSD video window配置正确。
如果是VENC内部的,什么是RGB/YUV输出?
zhu tao1:
回复 Chris Meng:
color bar是VENC内部的, VENC输出YUV422的信号,
有一个HDMI编码芯片IT66121与DM368相连, IT66121输入为YUV422, 输出设为YUV422, YUV444或RGB444,
在电视上显示的结果都是一样的, 会偏色.
Chris Meng:
回复 zhu tao1:
你好,
是yuv422 16-bit输出么?YCCCTL.YCP配置0和1都尝试过么?
zhu tao1:
回复 Chris Meng:
是yuv422 16-bit输出, YCCCTL.YCP配置成0和1都试过了, 都会偏色.
Chris Meng:
回复 zhu tao1:
你好,
你是否有调整过IT66121芯片的配置?
或者你测量一下DM36x输出信号,看Y上的信号上开始白色是否有高电平输出,看是否输出正常?
user5228532:
回复 zhu tao1:
麻烦问下 是color spase 配置吗