There are so much helpfull information in the discussion but I've still got some prroblem:
Though I want to output 960P(1280x960),I am planning to add a config for 720p(1280x720) output as the discussion in https://community.nxp.com/docs/DOC-94019. mentioned first.But I don't how to modify the code for the clock setting because I am using L_4.1.15_2.1.0_GA.
The patch I don't know how to apply:
--- a/drivers/mxc/ipu3/ipu_disp.c
+++ b/drivers/mxc/ipu3/ipu_disp.c
@@ -2600,13 +2600,13 @@ int32_t ipu_init_sync_panel(struct ipu_soc *ipu, int disp, uint32_t pixel_clk,
} else if ((pixel_fmt == IPU_PIX_FMT_BT656) || (pixel_fmt == IPU_PIX_FMT_BT1120)) {
pixel_clk = pixel_clk / 10000;
pixel_clk = pixel_clk * 10000;
- if (pixel_clk < 74000000) {
- rounded_pixel_clk = 108000000; /* For PAL and NTSC */
-
- clk_set_rate(di_parent, 540000000);
- clk_set_rate(ipu->di_clk[disp], rounded_pixel_clk);
- clk_set_parent(&ipu->pixel_clk[disp], ipu->di_clk[disp]);
- } else {
+// if (pixel_clk < 74000000) {
+// rounded_pixel_clk = 108000000; /* For PAL and NTSC */
+//
+// clk_set_rate(di_parent, 540000000);
+// clk_set_rate(ipu->di_clk[disp], rounded_pixel_clk);
+// clk_set_parent(&ipu->pixel_clk[disp], ipu->di_clk[disp]);
+// } else {
rounded_pixel_clk = pixel_clk * 2;
rounded_parent_clk = clk_round_rate(di_parent,
rounded_pixel_clk);
@@ -2622,7 +2622,7 @@ int32_t ipu_init_sync_panel(struct ipu_soc *ipu, int disp, uint32_t pixel_clk,
clk_round_rate(ipu->di_clk[disp], pixel_clk);
clk_set_rate(ipu->di_clk[disp], rounded_pixel_clk);
clk_set_parent(&ipu->pixel_clk[disp], ipu->di_clk[disp]);
- }
+// }
} else {
/* try ipu clk first*/
dev_dbg(ipu->dev, "try ipu internal clk\n");
The patch for 720P output test:
/* COUNTER_1: basic clock */
_ipu_di_sync_config(ipu,
disp, /* display */
@@ -3018,7 +3037,7 @@ int32_t ipu_init_sync_panel(struct ipu_s
DI_SYNC_NONE, /* CNT_POLARITY_CLR_SEL */
DI_BT656_SYNC_BASECLK, /* CNT_POLARITY_TRIGGER_SEL */
0, /* COUNT UP */
- 2*80 /* COUNT DOWN */
+ 2 * 80 /* COUNT DOWN */
);
vsync_cnt = DI_BT656_SYNC_IVSYNC;
@@ -3037,7 +3056,7 @@ int32_t ipu_init_sync_panel(struct ipu_s
DI_SYNC_NONE, /* CNT_POLARITY_CLR_SEL */
DI_BT656_SYNC_HSYNC, /* CNT_POLARITY_TRIGGER_SEL */
0, /* COUNT UP */
- 2*10 /* COUNT DOWN */
+ 2 * 10 /* COUNT DOWN */
);
/* COUNTER_5: first active line */
Index: linux-imx/drivers/video/fbdev/mxc/mxc_bt656if.c
===================================================================
--- linux-imx.orig/drivers/video/fbdev/mxc/mxc_bt656if.c
+++ linux-imx/drivers/video/fbdev/mxc/mxc_bt656if.c
@@ -81,6 +81,15 @@ static struct fb_videomode bt656if_moded
FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
FB_VMODE_NONINTERLACED,
FB_MODE_IS_DETAILED,},
+ {
+ /* User Define Progressive output */
+ "BT656-720P", 60, 1280, 720, 20833,
+ 25, 5,
+ 0, 0,
+ 732, 1,
+ 0,
+ FB_VMODE_NONINTERLACED,
+ FB_MODE_IS_DETAILED,},
};
static int bt656if_modedb_sz = ARRAY_SIZE(bt656if_modedb);
Index: linux-imx/arch/arm/mach-imx/clk-imx6q.c
===================================================================
--- linux-imx.orig/arch/arm/mach-imx/clk-imx6q.c
+++ linux-imx/arch/arm/mach-imx/clk-imx6q.c
@@ -796,7 +796,8 @@ static void __init imx6q_clocks_init(str
imx_clk_set_parent(clk[IMX6QDL_CLK_LDB_DI1_SEL], clk[IMX6QDL_CLK_PLL2_PFD0_352M]);
}
/* ipu clock initialization */
- imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); /* For CVBS 27MHz clock */
+ //imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL3_PFD1_540M]); /* For CVBS 27MHz clock */
+ imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
imx_clk_set_parent(clk[IMX6QDL_CLK_IPU1_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI0_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);
imx_clk_set_parent(clk[IMX6QDL_CLK_IPU2_DI1_PRE_SEL], clk[IMX6QDL_CLK_PLL5_VIDEO_DIV]);