This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

DM8168 VPSS v4l2 Capture Problem

Other Parts Discussed in Thread: TVP7002, TVP5150, TVP5147

Hello,

We have our board set-up with a FPGA feeding 16bit YUV422P Discrete Sync to VIP0. Using OMX I was able to set-up the capture component for VIP0 and capture the signal with success:

I am now trying to change to the v4l2/vpss driver so I can capture using gstreamer (omx_camera did not work, it kept locking up syslink and kernel). I have configured the hdvpss_capture_sdev_info[] in ti81xx_vpss.c as below:

.name	= TVP7002_INST0,
		.board_info = {
			/* TODO Find the correct address
				of the TVP7002 connected */
			//I2C_BOARD_INFO("tvp7002", 0x5d),
			//.platform_data = &tvp7002_pdata,
		},
		.vip_port_cfg = {
			.ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_7_0,
			.ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
			.pixClkEdgePol =  VPS_VIP_PIX_CLK_EDGE_POL_FALLING,
			.invertFidPol = 0,
			.embConfig = {
				.errCorrEnable = 0,
				.srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE,
				.isMaxChan3Bits = 0,
			},
			.disConfig = {
				.fidSkewPostCnt = 0,
				.fidSkewPreCnt = 0,
				.lineCaptureStyle =
					VPS_VIP_LINE_CAPTURE_STYLE_ACTVID,
				.fidDetectMode =
					VPS_VIP_FID_DETECT_MODE_PIN,
				.actvidPol = VPS_VIP_POLARITY_HIGH,
				.vsyncPol =  VPS_VIP_POLARITY_LOW,
				.hsyncPol = VPS_VIP_POLARITY_LOW,
			}
		},
		.video_capture_mode =
		   VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_ACTVID_VSYNC,
		.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_16BIT,
		.input_data_format = FVID2_DF_YUV422P,

I can capture using saLoopBack example and v4l2src through gstreamer succesfully, but the video signal is not correct. There is some kind of sync issue that I can not figure out (see attached):

I dumped the VIP0 registers using the OMX model and the v4l2 model to compare and they are different but I have no way of interpreting them as the VPSS register documentation is NDA. Maybe someone from TI could read these for me and tell me what the differences mean (see attached files)? 

root@gatdvr3:~#  ./devmem_test.o -v -r -l 1024 0x48105500
Request to memread 0x400 bytes from address 0x48105500
        using 1 byte accesses
Attempting to map 0x1000 bytes at address 0x48105000
open(/dev/mem) ok
mmap() ok
OK? y
48105500:  01 00 00 00 04 a5 40 00 00 00 00 00 00 00 00 00
48105510:  00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00
48105520:  fc ff ff ff fc ff ff ff ff ff ff ff ff ff ff ff
48105530:  38 04 80 07 00 00 00 00 00 00 00 00 00 00 00 00
48105540:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105550:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105560:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105570:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105580:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105590:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055d0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105600:  01 00 00 00 04 a5 40 00 00 00 00 00 00 00 00 00
48105610:  00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00
48105620:  fc ff ff ff fc ff ff ff ff ff ff ff ff ff ff ff
48105630:  38 04 80 07 00 00 00 00 00 00 00 00 00 00 00 00
48105640:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105650:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105660:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105670:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105680:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105690:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056d0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105700:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105710:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105720:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105730:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105740:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105750:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105760:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105770:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105780:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105790:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057d0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105800:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105810:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105820:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105830:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105840:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
48105850:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
48105860:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105870:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105880:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105890:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
481058d0:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
481058e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
root@gatdvr41:~# ./devmem_test.o -v -r -l 1024 0x48105500
Request to memread 0x400 bytes from address 0x48105500
        using 1 byte accesses
Attempting to map 0x1000 bytes at address 0x48105000
open(/dev/mem) ok
mmap() ok
OK? y
48105500:  01 00 00 00 14 a1 40 00 00 00 00 00 00 00 00 00
48105510:  00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00
48105520:  fc ff ff ff fc ff ff ff ff ff ff ff ff ff ff ff
48105530:  38 04 80 07 00 00 00 00 00 00 00 00 00 00 00 00
48105540:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105550:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105560:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105570:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105580:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105590:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055d0:  00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
481055e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481055f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105600:  01 00 00 00 14 a1 40 00 00 00 00 00 00 00 00 00
48105610:  00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00
48105620:  fc ff ff ff fc ff ff ff ff ff ff ff ff ff ff ff
48105630:  38 04 80 07 00 00 00 00 00 00 00 00 00 00 00 00
48105640:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105650:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105660:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105670:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105680:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105690:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056d0:  00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
481056e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481056f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105700:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105710:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105720:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105730:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105740:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105750:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105760:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105770:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105780:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105790:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057d0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481057f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105800:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105810:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105820:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105830:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105840:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
48105850:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
48105860:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105870:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105880:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
48105890:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058a0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058b0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058c0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
481058d0:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
481058e0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
481058f0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

Here is a side by side of the v4l2 (left, not working) versus the OMX (right, working) dump:

I have tried using VPS_VIP_LINE_CAPTURE_STYLE_HSYNC as the lineCaptureStyle for the VPSS but this causes frames to never be dequeued. Same if I try changing video_capture_mode to VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VSYNC.

Anyone out there have ideas?

Thanks-

  • Bump-

    As a test, I was ably to write to the registers using devmem once the capture was started and it corrected the video signal issue (at least for that capture). Once I close the device and open it back up, the register settings are reset. This is a great test, but not a work-around as every signal would have its own register settings. Can someone at TI take a look at these register settings and let me know what is set to make the capture work versus what is not working?

    This is what I am doing to set the registers after the capture has started (saLoopBack or v4l2src through gst-launch):

    devmem 0x48105500 64 0x0040A11400000001

    Thanks-

     

  • Hi,

     

    Can you try changing pixel clock polarity to rising edge? I think in V4L2, you are trying to set it to falling edge and the only difference between two register dump is pixel clock edge polarity. could you please try changing it?

     

    Regards,

    brijesh

  • Hi Troy,

    Which pipeline are you using with omx_camera?

    I have used omx_camera just with embedded sync signals using a pipeline like:

    gst-launch -e omx_camera num-buffers=1 ! video/x-raw-yuv, format=\(fourcc\)NV12, width=1920, height=1080, framerate=\(fraction\)30/1, buffer-count-requested=10 ! queue ! ffmpegcolorspace ! jpegenc ! jifmux ! filesink location=snapshot.jpeg

    However, if you already have an omx capturing your video signal properly you can set the same configuration to the VFCC in the files gstomx_camera.c and gstomx_camera.h. Line 81 on function src_setcaps. If you share the changes that you did in one omx demo I can help you with the changes on omx_camera, however I don't have a board where to test them.

    Please notice that if you are not using the EVM you don't need to put the omx_tvp plugin in the pipeline.

  • Brijesh,

    Changing the pixel clock polarity to the rising edge did the trick- many thanks for that.

    Now that I have VIP0 VPSS working with the FPGA and dummy TVP7002, I'm working on getting the TVP5150 on VIP1(7..0) working. I've set-up everything in ti81xxvin_main.c/ti81xx_vpss.c and have some logic to check if the chosen subdevice is the TVP5150 and to pass the v4l2_subdev calls (otherwise they are skipped for the dummy TVP7002).

    I modified saLoopBack to remove VIDIOC_QUERY_DV_PRESET and added in VIDIOC_G_STD/VIDIOC_S_STD.

    I had added VIDIOC_QUERYSTD but it kept failing with EINVAL so I removed it as I believe that means the subdevice is saying it is not supported.

    I seems like everything is getting set-up and the VIP is opened but no frames are dequeued so something is wrong in the VPSS setup. Here are my settings for this subdevice:

    .name	= TVP5150_INST0, 
    		.board_info = {
    			I2C_BOARD_INFO("tvp5150", 0x5c),
    			.platform_data = &tvp5150_pdata,
    		},
    		.force_sd_video = 1,
    		.vip_port_cfg = {
    			.ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_7_0,
    			.ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
    			.pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_RISING,
    			.invertFidPol = 0,
    			.embConfig = {
    				.errCorrEnable = 1,
    				.srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE,
    				.isMaxChan3Bits = 0,
    			},
    			.disConfig = {
    				.fidSkewPostCnt = 0,
    				.fidSkewPreCnt = 0,
    				.lineCaptureStyle =
    					VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE,
    				.fidDetectMode =
    					VPS_VIP_FID_DETECT_MODE_DONT_CARE,
    				.actvidPol = VPS_VIP_POLARITY_DONT_CARE,
    				.vsyncPol =  VPS_VIP_POLARITY_DONT_CARE,
    				.hsyncPol = VPS_VIP_POLARITY_DONT_CARE,
    			}
    		},
    		.video_capture_mode =
    		   VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC,
    		.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_8BIT,
    		.input_data_format = FVID2_DF_YUV420P,

    Here is the VIP1 dump with the VPSS/v4l2 driver: 

    root@gatdvr41:~# ./devmem_test.o -v -r -l 1024 0x48105A00
    Request to memread 0x400 bytes from address 0x48105a00
            using 1 byte accesses
    Attempting to map 0x1000 bytes at address 0x48105000
    open(/dev/mem) ok
    mmap() ok
    OK? y
    48105a00:  01 00 00 00 14 a1 40 80 00 00 00 00 00 00 00 00
    48105a10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a20:  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    48105a30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105aa0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ab0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ac0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ad0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ae0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105af0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b00:  01 00 00 00 14 a1 40 80 00 00 00 00 00 00 00 00
    48105b10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b20:  ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff
    48105b30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ba0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bb0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bc0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bd0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105be0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bf0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c00:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c20:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ca0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cb0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cc0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cd0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ce0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cf0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d00:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d20:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
    48105d50:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
    48105d60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d80:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105da0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105db0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105dc0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
    48105dd0:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
    48105de0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105df0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    Here is the VIP1 dump with the OMX driver model (this works): 

    root@gatdvr41:~# ./devmem_test.o -v -r -l 1024 0x48105A00
    Request to memread 0x400 bytes from address 0x48105a00
            using 1 byte accesses
    Attempting to map 0x1000 bytes at address 0x48105000
    open(/dev/mem) ok
    mmap() ok
    OK? y
    48105a00:  02 00 00 00 00 a1 00 00 00 00 00 00 00 00 00 00
    48105a10:  00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00
    48105a20:  fe ff ff ff fc ff ff ff ff ff ff ff ff ff ff ff
    48105a30:  f4 00 d0 02 00 00 00 00 00 00 00 00 00 00 00 00
    48105a40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105a90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105aa0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ab0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ac0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ad0:  00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
    48105ae0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105af0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b00:  02 00 00 00 00 a1 00 00 00 00 00 00 00 00 00 00
    48105b10:  00 00 00 00 00 00 00 00 00 00 00 00 00 44 00 00
    48105b20:  fe ff ff ff fc ff ff ff ff ff ff ff ff ff ff ff
    48105b30:  f4 00 d0 02 00 00 00 00 00 00 00 00 00 00 00 00
    48105b40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105b90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ba0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bb0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bc0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bd0:  00 00 00 00 00 00 00 00 ff ff ff ff ff ff ff ff
    48105be0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105bf0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c00:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c20:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c50:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c80:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105c90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ca0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cb0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cc0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cd0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105ce0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105cf0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d00:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d10:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d20:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d30:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d40:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
    48105d50:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
    48105d60:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d70:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d80:  00 40 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105d90:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105da0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105db0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105dc0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 fc
    48105dd0:  00 08 84 0c 10 00 10 00 90 01 04 00 00 00 00 00
    48105de0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
    48105df0:  00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00

    I also dumped the i2c registers of the tvp5150 during each capture, here are those:

    VPSS/v4l2: 

    root@gatdvr41:~# i2cdump -y 2 0x5c b
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 00 15 00 09 dc 00 10 60 00 80 80 00 80 47 00 08    .?.??.?`.??.?G.?
    10: 00 00 00 00 00 01 80 80 00 00 0c 14 00 00 00 00    .....???..??....
    20: 00 00 00 00 00 00 00 00 00 00 00 00 79 56 0f 01    ............yV??
    30: 00 00 00 00 ff 00 00 00 00 98 01 93 01 01 01 01    .........???????
    40: 01 01 01 01 01 02 02 00 00 00 00 00 00 00 00 00    ???????.........
    50: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    60: 00 00 00 00 00 00 00 00 00 00 03 03 03 01 01 01    ..........??????
    70: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01    ????????????????
    80: 51 50 04 00 00 02 80 00 90 10 19 00 81 01 0a 01    QP?..??.???.????
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    b0: d8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ?...............
    c0: 40 00 04 02 10 00 40 00 80 00 00 4e 00 01 00 00    @.???.@.?..N.?..
    d0: 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    f0: ff ff ff ff ff ff ff ff ff ff ff ff 7f 00 00 00    ............?...

    OMX: 

    root@gatdvr41:~# i2cdump -y 2 0x5c b
         0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f    0123456789abcdef
    00: 00 15 00 09 dc 00 10 60 00 80 80 00 80 47 00 08    .?.??.?`.??.?G.?
    10: 00 00 00 00 00 01 80 80 00 00 0c 14 00 00 00 00    .....???..??....
    20: 00 00 00 00 00 00 00 00 0a 00 00 00 79 56 0f 01    ........?...yV??
    30: 00 00 00 00 ff 00 00 00 00 98 01 93 00 00 00 00    .........???....
    40: 00 00 03 03 01 01 01 01 01 01 01 01 01 01 01 01    ..??????????????
    50: 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01 01    ????????????????
    60: 01 02 02 00 00 00 00 00 00 00 00 00 00 00 00 00    ???.............
    70: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    80: 51 50 04 00 00 02 80 00 90 10 19 00 81 01 0a 01    QP?..??.???.????
    90: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    a0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ................
    b0: d8 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00    ?...............
    c0: 40 00 04 06 10 00 40 00 80 00 00 4e 00 01 00 00    @.???.@.?..N.?..
    d0: 00 ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    e0: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff    ................
    f0: ff ff ff ff ff ff ff ff ff ff ff ff 7f 00 00 00    ............?...

    Can you take a look at these and let me know what I'm doing wrong with the VPSS/v4l2 driver?

    Also, here are the source files for your review if needed:

    /*
     *
     * Framebuffer device registration for TI TI816x platforms
     *
     * Copyright (C) 2009 Texas Instruments Inc.
     * Author: Yihe Hu <yihehu@ti.com>
     *
     * Some code and ideas taken from TI OMAP2 Platforms
     * by Tomi Valkeinen.
     *
     * This program is free software; you can redistribute it and/or modify it
     * under the terms of the GNU General Public License as published by the
     * Free Software Foundation; either version 2 of the License, or (at your
     * option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but
     * WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     * General Public License for more details.
     *
     * You should have received a copy of the GNU General Public License along
     * with this program; if not, write to the Free Software Foundation, Inc.,
     * 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
     */
    #include <linux/module.h>
    #include <linux/kernel.h>
    #include <linux/mm.h>
    #include <linux/init.h>
    #include <linux/platform_device.h>
    #include <linux/bootmem.h>
    #include <linux/io.h>
    #include <linux/vps_capture.h>
    #include <linux/ti81xxfb.h>
    #include <linux/ti81xx.h>
    #include <mach/hardware.h>
    #include <mach/board-ti814x.h>
    #include <mach/board-ti816x.h>
    #include <asm/mach/map.h>
    
    
    #if defined(CONFIG_TI81XX_VPSS) || defined(CONFIG_TI81XX_VPSS_MODULE)
    
    static u64 ti81xx_dma_mask = ~(u32)0;
    static struct platform_device vpss_device = {
    	.name = "vpss",
    	.id = -1,
    	.dev = {
    		.platform_data = NULL,
    	},
    };
    static struct vps_platform_data vps_pdata;
    
    
    static int __init ti81xx_vpss_init(void)
    {
    	/*FIXME add platform data here*/
    	int r;
    	if (cpu_is_ti816x() || cpu_is_dm385()) {
    		if (cpu_is_dm385())
    			vps_pdata.cpu = CPU_DM813X;
    		else
    			vps_pdata.cpu = CPU_DM816X;
    		vps_pdata.numvencs = 4;
    		vps_pdata.vencmask = (1 << VPS_DC_MAX_VENC) - 1;
    	} else if (cpu_is_ti814x()) {
    		vps_pdata.cpu = CPU_DM814X;
    		vps_pdata.numvencs = 3;
    		vps_pdata.vencmask = (1 << VPS_DC_MAX_VENC) - 1 \
    					- VPS_DC_VENC_HDCOMP;
    	}
    
    	vpss_device.dev.platform_data = &vps_pdata;
    	r = platform_device_register(&vpss_device);
    	if (r)
    		printk(KERN_ERR "unable to register ti81xx_vpss device\n");
    	else
    		printk(KERN_INFO "registered ti81xx_vpss device\n");
    	return r;
    }
    
    #if defined(CONFIG_TI81XX_HDMI_MODULE) || defined(CONFIG_TI81XX_HDMI)
    
    static struct platform_device ti81xx_hdmi_plat_device = {
    	.name = "TI81XX_HDMI",
    	.id = -1,
    	.num_resources = 0,
    	.dev = {
    		/*.release = ti81xx_hdmi_platform_release,*/
    		.platform_data = NULL,
    	}
    };
    
    static int __init ti81xx_hdmi_init(void)
    {
    	int r;
    	/*FIXME add platform data here*/
    	r = platform_device_register(&ti81xx_hdmi_plat_device);
    	if (r)
    		printk(KERN_ERR "Unable to register ti81xx onchip-HDMI device\n");
    	else
    		printk(KERN_INFO "registered ti81xx on-chip HDMI device\n");
    	return r;
    }
    #else
    static int __init ti81xx_hdmi_init(void)
    {
    	return 0;
    }
    #endif
    
    #if defined(CONFIG_VIDEO_TI81XX_VIDIN_MODULE) || \
    		defined(CONFIG_VIDEO_TI81XX_VIDIN)
    
    #define HDVPSS_CAPTURE_INST0_BASE	0x48105500
    #define HDVPSS_CAPTURE_INST0_SIZE	1024u
    
    #define HDVPSS_CAPTURE_INST2_BASE	0x48105A00
    #define HDVPSS_CAPTURE_INST2_SIZE	1024u
    
    #define TVP5150_INST0 "tvp5150"
    u8 ti81xx_card_name[] = "TI81xx_catalogue";
    struct ti81xxvin_interface tvp7002_pdata = {
    	.clk_polarity = 0,
    	.hs_polarity = 0,
    	.vs_polarity = 1,
    	.fid_polarity = 0,
    	.sog_polarity = 0,
    
    };
    struct ti81xxvin_interface tvp5150_pdata = {
    	.clk_polarity = 0,
    	.hs_polarity = 1,
    	.vs_polarity = 1,
    	.fid_polarity = 0,
    	.sog_polarity = 0,
    
    };
    static struct ti81xxvin_subdev_info hdvpss_capture_sdev_info[] = {
    	{
    		.name	= TVP7002_INST0,
    		.board_info = {
    			/* TODO Find the correct address
    				of the TVP7002 connected */
    			//I2C_BOARD_INFO("tvp7002", 0x5d),
    			//.platform_data = &tvp7002_pdata,
    		},
    		.force_sd_video = 0,
    		.vip_port_cfg = {
    			.ctrlChanSel = VPS_VIP_CTRL_CHAN_DONT_CARE,
    			.ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
    			.pixClkEdgePol =  VPS_VIP_PIX_CLK_EDGE_POL_RISING,
    			.invertFidPol = 0,
    			.embConfig = {
    				.errCorrEnable = 1,
    				.srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE,
    				.isMaxChan3Bits = 0,
    			},
    			.disConfig = {
    				.fidSkewPostCnt = 0,
    				.fidSkewPreCnt = 0,
    				.lineCaptureStyle =
    					VPS_VIP_LINE_CAPTURE_STYLE_ACTVID,//VPS_VIP_LINE_CAPTURE_STYLE_HSYNC,//
    				.fidDetectMode =
    					VPS_VIP_FID_DETECT_MODE_PIN,
    				.actvidPol = VPS_VIP_POLARITY_HIGH,
    				.vsyncPol =  VPS_VIP_POLARITY_LOW,
    				.hsyncPol = VPS_VIP_POLARITY_LOW,
    			}
    		},
    		.video_capture_mode =
    		   VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_ACTVID_VSYNC,//VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_DISCRETE_SYNC_HSYNC_VSYNC,//
    		.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_16BIT,
    		.input_data_format = FVID2_DF_YUV422P,
    	},
    	{
    		.name	= TVP5150_INST0, 
    		.board_info = {
    			I2C_BOARD_INFO("tvp5150", 0x5c),
    			.platform_data = &tvp5150_pdata,
    		},
    		.force_sd_video = 1,
    		.vip_port_cfg = {
    			.ctrlChanSel = VPS_VIP_CTRL_CHAN_SEL_7_0,
    			.ancChSel8b = VPS_VIP_ANC_CH_SEL_DONT_CARE,
    			.pixClkEdgePol = VPS_VIP_PIX_CLK_EDGE_POL_RISING,
    			.invertFidPol = 0,
    			.embConfig = {
    				.errCorrEnable = 1,
    				.srcNumPos = VPS_VIP_SRC_NUM_POS_DONT_CARE,
    				.isMaxChan3Bits = 0,
    			},
    			.disConfig = {
    				.fidSkewPostCnt = 0,
    				.fidSkewPreCnt = 0,
    				.lineCaptureStyle =
    					VPS_VIP_LINE_CAPTURE_STYLE_DONT_CARE,
    				.fidDetectMode =
    					VPS_VIP_FID_DETECT_MODE_DONT_CARE,
    				.actvidPol = VPS_VIP_POLARITY_DONT_CARE,
    				.vsyncPol =  VPS_VIP_POLARITY_DONT_CARE,
    				.hsyncPol = VPS_VIP_POLARITY_DONT_CARE,
    			}
    		},
    		.video_capture_mode =
    		   VPS_CAPT_VIDEO_CAPTURE_MODE_SINGLE_CH_NON_MUX_EMBEDDED_SYNC,
    		.video_if_mode = VPS_CAPT_VIDEO_IF_MODE_8BIT,
    		.input_data_format = FVID2_DF_YUV420P,
    	},
    };
    
    static const struct v4l2_dv_preset hdvpss_inst0_inp0_presets[] = {
    	{
    		.preset = V4L2_DV_720P60,
    	},
    	{
    		.preset = V4L2_DV_1080I60,
    	},
    	{
    		.preset = V4L2_DV_1080P60,
    	},
    	{
    		.preset = V4L2_DV_1080P30,
    	},
    };
    
    static const struct v4l2_dv_preset hdvpss_inst2_inp0_presets[] = {
    	{
    		.preset = V4L2_DV_720P60,
    	},
    	{
    		.preset = V4L2_DV_1080I60,
    	},
    	{
    		.preset = V4L2_DV_1080P60,
    	},
    	{
    		.preset = V4L2_DV_1080P30,
    	},
    };
    
    static const struct ti81xxvin_input hdvpss_inst0_inputs[] = {
    	{
    		.input = {
    			.index		= 0,
    			.name		= "DVI_VGA",
    			.type		= V4L2_INPUT_TYPE_CAMERA,
    			.std		= V4L2_STD_UNKNOWN,
    			.capabilities	= V4L2_OUT_CAP_PRESETS,
    		},
    		.subdev_name	= TVP7002_INST0,
    		.dv_presets	= hdvpss_inst0_inp0_presets,
    		.num_dv_presets	= ARRAY_SIZE(hdvpss_inst0_inp0_presets),
    	},
    };
    
    static const struct ti81xxvin_input hdvpss_inst1_inputs[] = {
    	{
    		.input = {
    			.index		= 0,
    			.name		= "Composite",
    			.type		= V4L2_INPUT_TYPE_CAMERA,
    			.std		= V4L2_STD_525_60,
    			.capabilities	= 0,
    		},
    		.subdev_name	= TVP5150_INST0,
    		.dv_presets	= NULL,
    		.num_dv_presets	= 0,
    	},
    };
    
    /* 16 bit decoders are present on the Port A of VIP0 and VIP1 instances. Which
    represents the VIP0 and VIP2 instances in software. While Port B of VIP0 and
    VIP1 are represented by VIP1 and VIP3 instances. On these two instances no
    decoders are present.
    */
    static struct ti81xxvin_config ti81xx_hsvpss_capture_cfg = {
    	.subdev_info = hdvpss_capture_sdev_info,
    	.subdev_count = ARRAY_SIZE(hdvpss_capture_sdev_info),
    	.card_name = ti81xx_card_name,
    	.inst_config[0] = {
    		.inputs = hdvpss_inst0_inputs,
    		.input_count = ARRAY_SIZE(hdvpss_inst0_inputs),
    	},
    	.inst_config[1] = {
    		.inputs = hdvpss_inst0_inputs,
    		.input_count = 0,
    	},
    	.inst_config[2] = {
    		.inputs = hdvpss_inst1_inputs,
    		.input_count = ARRAY_SIZE(hdvpss_inst1_inputs),
    	},
    	.inst_config[3] = {
    		.inputs = hdvpss_inst1_inputs,
    		.input_count = 0,
    	},
    
    };
    
    static struct resource ti81xx_hdvpss_capture_resource[] = {
    	[0] = {
    		.start = HDVPSS_CAPTURE_INST0_BASE,
    		.end   = (HDVPSS_CAPTURE_INST0_BASE +
    				HDVPSS_CAPTURE_INST0_SIZE - 1),
    		.flags = IORESOURCE_MEM,
    	},
    	[1] = {
    		.start = HDVPSS_CAPTURE_INST2_BASE,
    		.end   = (HDVPSS_CAPTURE_INST2_BASE +
    				HDVPSS_CAPTURE_INST2_SIZE - 1),
    		.flags = IORESOURCE_MEM,
    	},
    };
    
    static struct platform_device hdvpss_capture_dev = {
    	.name		= "ti81xxvin",
    	.id		= -1,
    	.dev		= {
    			.dma_mask		= &ti81xx_dma_mask,
    			.coherent_dma_mask	= ~(u32)0,
    	},
    	.num_resources = 2,
    	.resource = ti81xx_hdvpss_capture_resource,
    };
    
    static int __init ti81xx_vin_init(void)
    {
    	int r;
    	hdvpss_capture_dev.dev.platform_data = &ti81xx_hsvpss_capture_cfg;
    	if (cpu_is_ti814x()) {
    		hdvpss_capture_sdev_info[0].ti81xxvin_select_decoder =
    			vps_ti814x_select_video_decoder;
    		hdvpss_capture_sdev_info[0].ti81xxvin_set_mode =
    			vps_ti814x_set_tvp7002_filter;
    		hdvpss_capture_sdev_info[0].decoder_id = 0;
    		hdvpss_capture_sdev_info[1].ti81xxvin_select_decoder =
    			NULL;
    		hdvpss_capture_sdev_info[1].ti81xxvin_set_mode =
    			NULL;
    		hdvpss_capture_sdev_info[1].decoder_id = 0;
    	} else {
    		hdvpss_capture_sdev_info[0].ti81xxvin_select_decoder =
    			NULL;
    		hdvpss_capture_sdev_info[0].ti81xxvin_set_mode =
    			NULL;
    		hdvpss_capture_sdev_info[0].decoder_id = 0;
    		hdvpss_capture_sdev_info[1].ti81xxvin_select_decoder =
    			NULL;
    		hdvpss_capture_sdev_info[1].ti81xxvin_set_mode =
    			NULL;
    		hdvpss_capture_sdev_info[1].decoder_id = 1;
    	}
    	r = platform_device_register(&hdvpss_capture_dev);
    	if (r)
    		printk(KERN_ERR "unable to register ti81xx_vin device\n");
    	else
    		printk(KERN_INFO "registered ti81xx_vin device\n");
    	return r;
    
    }
    #else
    static int __init ti81xx_vin_init(void)
    {
    	return 0;
    }
    
    #endif
    
    #if defined(CONFIG_FB_TI81XX_MODULE) || defined(CONFIG_FB_TI81XX)
    static struct ti81xxfb_platform_data ti81xxfb_config;
    
    static struct platform_device ti81xx_fb_device = {
    	.name		= "ti81xxfb",
    	.id		= -1,
    	.dev = {
    		.dma_mask		= &ti81xx_dma_mask,
    		.coherent_dma_mask	= ~(u32)0,
    		.platform_data		= &ti81xxfb_config,
    	},
    	.num_resources = 0,
    };
    
    
    void ti81xxfb_set_platform_data(struct ti81xxfb_platform_data *data)
    {
    	ti81xxfb_config = *data;
    }
    
    static int __init ti81xx_fb_init(void)
    {
    	int r;
    	r = platform_device_register(&ti81xx_fb_device);
    	if (r)
    		printk(KERN_ERR "unable to register ti81xx_fb device\n");
    	else
    		printk(KERN_INFO "registered ti81xx_fb device\n");
    	return r;
    
    }
    #else
    static int __init ti81xx_fb_init(void)
    {
    	return 0;
    }
    void ti81xxfb_set_platform_data(struct ti81xxfb_platform_data *data)
    {
    }
    #endif
    
    #if defined(CONFIG_VIDEO_TI81XX_VIDOUT_MODULE) || \
    		defined(CONFIG_VIDEO_TI81XX_VIDOUT)
    static struct resource ti81xx_vidout_resource[VPS_DISPLAY_INST_MAX] = {
    };
    
    static struct platform_device ti81xx_vidout_device = {
    	.name		= "t81xx_vidout",
    	.num_resources  = ARRAY_SIZE(ti81xx_vidout_resource),
    	.resource       = &ti81xx_vidout_resource[0],
    	.id             = -1,
    };
    
    static int __init ti81xx_init_vout(void)
    {
    	int r;
    
    	r = platform_device_register(&ti81xx_vidout_device);
    	if (r)
    		printk(KERN_ERR "Unable to register ti81xx_vidout device\n");
    	else
    		printk(KERN_INFO "registered ti81xx_vidout device\n");
    	return r;
    }
    #else
    static int __init ti81xx_init_vout(void)
    {
    	return 0;
    }
    #endif
    
    
    static int __init ti81xx_init_vpss(void)
    {
    	int retval = 0;
    	/*if vpss failed to register, none of the below could works*/
    	if (ti81xx_vpss_init())
    		return -1;
    	retval = ti81xx_init_vout();
    	retval += ti81xx_hdmi_init();
    	retval += ti81xx_fb_init();
    	retval += ti81xx_vin_init();
    	return retval;
    }
    
    arch_initcall(ti81xx_init_vpss);
    
    #endif
    

    5047.ti81xxvin_main.c

    /*
     * saLoopBack.c
     *
     * Copyright (C) 2011 TI
     * Author: Hardik Shah <hardik.shah@ti.com>
     *
     * This is a sample for loopback application. This application captures through
     * V4L2 capture driver on TVP7002 input and displays the captured content
     * on the V4L2 display driver. Application uses userpointer mechanism for
     * both capture and display drivers. Buffers for the userpointer are taken from
     * framebuffer driver (fbdev).
     *
     * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
     *
     *
     *  Redistribution and use in source and binary forms, with or without
     *  modification, are permitted provided that the following conditions
     *  are met:
     *
     *    Redistributions of source code must retain the above copyright
     *    notice, this list of conditions and the following disclaimer.
     *
     *    Redistributions in binary form must reproduce the above copyright
     *    notice, this list of conditions and the following disclaimer in the
     *    documentation and/or other materials provided with the
     *    distribution.
     *
     *    Neither the name of Texas Instruments Incorporated nor the names of
     *    its contributors may be used to endorse or promote products derived
     *    from this software without specific prior written permission.
     *
     *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
     *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
     *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
     *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
     *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     *
    */
    
    /*
     * Header File Inclusion
     */
    #include <stdio.h>
    #include <unistd.h>
    #include <fcntl.h>
    #include <stdlib.h>
    #include <sys/ioctl.h>
    #include <sys/mman.h>
    #include <errno.h>
    #include <string.h>
    #include <linux/videodev2.h>
    #include <linux/fb.h>
    #include <linux/ti81xxfb.h>
    #include <linux/ti81xxhdmi.h>
    #include <linux/ti81xxvin.h>
    
    /* Number of buffers required for application. Less that this may cause
     * considerable frame drops
     */
    #define MAX_BUFFER			8
    
    
    /* device node to be used for capture */
    #define CAPTURE_DEVICE		"/dev/video5"
    #define CAPTURE_NAME		"Capture"
    /* device node to be used for display */
    #define DISPLAY_DEVICE		"/dev/video1"
    #define DISPLAY_NAME		"Display"
    /* number of frames to be captured and displayed
     * Increase this for long runs
     */
    #define MAXLOOPCOUNT		500
    
    /* Pixel format for capture and display. Capture supports
     * V4L2_PIX_FMT_NV12, V4L2_PIX_FMT_NV16, V4L2_PIX_FMT_RGB24 but display
     * supports only V4L2_PIX_FMT_YUYV. So this has to be V4L2_PIX_FMT_YUYV
     */
    #define DEF_PIX_FMT		V4L2_PIX_FMT_YUYV
    
    /* Application name */
    #define APP_NAME		"saLoopBack"
    
    /* Define below #def for debug information enable */
    #undef SALOOPBACK_DEBUG
    
    
    /* Structure for storing buffer information */
    struct buf_info {
    	int index;
    	unsigned int length;
    	char *start;
    };
    
    /* Structure for storing application data like file pointers, format etc. */
    struct app_obj {
    	int fd;
    	struct v4l2_capability cap;
    	struct v4l2_format fmt;
    	struct v4l2_dv_preset dv_preset;
    	struct v4l2_input input;
    	struct v4l2_requestbuffers reqbuf;
    	int numbuffers;
    	struct v4l2_buffer buf;
    	struct ti81xxvin_overflow_status over_flow;
    };
    
    /* Globals for capture and display application objects */
    struct app_obj disp, capt;
    
    /* File pointer for fbdev. fbdev is only used to get buffers
     */
    static int fbdev_fd;
    
    /* Pointers for storing buffer addresses */
    unsigned char *buffer_addr[MAX_BUFFER];
    
    /* Utility function for printing format */
    static void printFormat(char *string, struct v4l2_format *fmt)
    {
    	printf("=============================================================\n");
    	printf("%s Format:\n", string);
    	printf("=============================================================\n");
    	printf("fmt.type\t\t = %d\n", fmt->type);
    	printf("fmt.width\t\t = %d\n", fmt->fmt.pix.width);
    	printf("fmt.height\t\t = %d\n", fmt->fmt.pix.height);
    	printf("fmt.pixelformat\t = %d\n", fmt->fmt.pix.pixelformat);
    	printf("fmt.bytesperline\t = %d\n", fmt->fmt.pix.bytesperline);
    	printf("fmt.sizeimage\t = %d\n", fmt->fmt.pix.sizeimage);
    	printf("=============================================================\n");
    }
    /* Open and query dv preset for capture driver*/
    static int initCapture(void)
    {
    	int mode = O_RDWR;
    	int ret = 0;
    	int index;
    	int i = 0;
    
    	/* Open capture driver */
    	capt.fd = open((const char *)CAPTURE_DEVICE, mode);
    	if (capt.fd == -1) {
    		printf("failed to open capture device\n");
    		return -1;
    	}
    
    #if 1 /* Add for TVP5150 Testing */
    	/* Get any active input */
    	if (ioctl(capt.fd, VIDIOC_G_INPUT, &index) < 0) {
    		perror("VIDIOC_G_INPUT");
    		return -1;
    	}
    
    	/* Enumerate input to get the name of the input detected */
    	memset(&capt.input, 0, sizeof(capt.input));
    	capt.input.index = index;
    	if (ioctl(capt.fd, VIDIOC_ENUMINPUT, &capt.input) < 0) {
    		perror("VIDIOC_ENUMINPUT");
    		return -1;
    	}
    
    	printf("%s: Current Input: %s\n", CAPTURE_NAME, capt.input.name);
    #if 0
    	v4l2_std_id std;
    	struct v4l2_standard standard;
    	/* Detect the standard in the input detected */
    	if (ioctl(capt.fd, VIDIOC_QUERYSTD, &std) < 0) {
    		perror("VIDIOC_QUERYSTD");
    		return -1;
    	}
    
    	while (1) 
    	{
    		standard.index = i;
    		ret = ioctl(capt.fd, VIDIOC_ENUMSTD, &standard);
    		if(ret < 0)
    			break;
    
    		if (standard.id & std) 
    		{
    		    printf("%s: Standard Detected = %s\n",
    			   CAPTURE_NAME, standard.name);
    		    break;
    		}
    		i++;
    	}
    #endif
    	v4l2_std_id current_std;
    	if (ioctl(capt.fd, VIDIOC_G_STD, &current_std) < 0) {
    		perror("VIDIOC_G_STD");
    		//return -1;
    	}
    
    	const v4l2_std_id std = V4L2_STD_NTSC;
    	/* Detect the standard in the input detected */
    	if (ioctl(capt.fd, VIDIOC_S_STD, &std) < 0) {
    		perror("VIDIOC_S_STD");
    		//return -1;
    	}
    
    	if (ioctl(capt.fd, VIDIOC_G_STD, &current_std) < 0) {
    		perror("VIDIOC_G_STD");
    		//return -1;
    	}
    
    	if(current_std != V4L2_STD_NTSC)
    		printf("NTSC Standard was not set!\n");
    #endif
    	/* Query for capabilities */
    	memset(&capt.cap, 0, sizeof(capt.cap));
    	if (ioctl(capt.fd, VIDIOC_QUERYCAP, &capt.cap)) {
    		printf("Query capability failed\n");
    		exit(2);
    	} else 	{
    		printf("Driver Name: %s\n", capt.cap.driver);
    		printf("Driver bus info: %s\n", capt.cap.bus_info);
    		if (capt.cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)
    			printf("Driver is capable of doing capture\n");
    		if (capt.cap.capabilities & V4L2_CAP_VIDEO_OVERLAY)
    			printf("Driver is capabled of scaling and cropping\n");
    
    	}
    
    	system("echo 0 > /sys/devices/platform/vpss/display0/enabled");
    	/* Query the preset. Set it to invalid and query for it */
    	memset(&capt.dv_preset, 0, sizeof(capt.dv_preset));
    	capt.dv_preset.preset = 0x0;
    #if 0 /* Remove for TVP5150 Testing */
    	if (ioctl(capt.fd, VIDIOC_QUERY_DV_PRESET, &capt.dv_preset)) {
    		printf("Querying DV Preset failed\n");
    		exit(2);
    	}
    
    	switch (capt.dv_preset.preset) {
    	case V4L2_DV_720P60:
    		printf("%s:\n Mode set is 720P60\n", APP_NAME);
    		system ("echo 720p-60 > /sys/devices/platform/vpss/display0/mode");
    		break;
    	case V4L2_DV_1080I60:
    		printf("%s:\n Mode set is 1080I60\n", APP_NAME);
    		system ("echo 1080i-60 > /sys/devices/platform/vpss/display0/mode");
    		break;
    	case V4L2_DV_1080P60:
    		printf("%s:\n Mode set is 1080P60\n", APP_NAME);
    		system ("echo 1080p-60 > /sys/devices/platform/vpss/display0/mode");
    		break;
    	case V4L2_DV_1080P30:
    		printf("%s:\n Mode set is 1080P30\n", APP_NAME);
    		system ("echo 1080p-30 > /sys/devices/platform/vpss/display0/mode");
    		break;
    	case V4L2_DV_INVALID:
    		printf("%s:\n Mode set is not a DV Preset, Setting to SXGA\n", APP_NAME);
    		system ("echo 1280x1024@60 > /sys/devices/platform/vpss/display0/mode");
    		break;
    	default:
    		printf("%s:\n Mode set is %d\n", APP_NAME, capt.dv_preset.preset);
    	}
    	if (ioctl(capt.fd, VIDIOC_S_DV_PRESET, &capt.dv_preset)) {
    		printf("Setting DV Preset failed\n");
    		exit(2);
    	}
    #endif
    
    #if 1 /* Add for TVP5150 Testing */
    	//set the HDMI output...
    	capt.dv_preset.preset = V4L2_DV_1080P60;
    	system ("echo 1080p-60 > /sys/devices/platform/vpss/display0/mode");
    #endif
    	system("echo 1 > /sys/devices/platform/vpss/display0/enabled");
    
    	return 0;
    }
    /* Open display driver and set format according to resolution on capture */
    static int initDisplay(void)
    {
    	int mode = O_RDWR;
    
    	/* Open display driver */
    	disp.fd = open((const char *)DISPLAY_DEVICE, mode);
    	if (disp.fd == -1) {
    		printf("failed to open display device\n");
    		return -1;
    	}
    	/* Query driver capability */
    	memset(&disp.cap, 0, sizeof(disp.cap));
    	if (ioctl(disp.fd, VIDIOC_QUERYCAP, &disp.cap)) {
    		printf("Query capability failed for display\n");
    		exit(2);
    	}  else {
    		printf("Driver Name: %s\n", disp.cap.driver);
    		printf("Driver bus info: %s\n", disp.cap.bus_info);
    		if (disp.cap.capabilities & V4L2_CAP_VIDEO_OUTPUT)
    			printf("Driver is capable of doing capture\n");
    		if (disp.cap.capabilities & V4L2_CAP_VIDEO_OVERLAY)
    			printf("Driver is capabled of scaling and cropping\n");
    
    	}
    	return 0;
    }
    /* Setup capture driver */
    int setupCapture(void)
    {
    	int ret = 0;
    
    	/* Get current format */
    	memset(&capt.fmt, 0, sizeof(capt.fmt));
    	capt.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    
    	ret = ioctl(capt.fd, VIDIOC_G_FMT, &capt.fmt);
    	if (ret < 0) {
    		printf("Get Format failed\n");
    		return -1;
    	}
    
    #if 0 /* Remove for TVP5150 Testing */
    	/* Set format according to mode detected */
    	if (capt.dv_preset.preset == V4L2_DV_720P60) {
    		capt.fmt.fmt.pix.width = 1280;
    		capt.fmt.fmt.pix.height = 720;
    	} else if (capt.dv_preset.preset == V4L2_DV_1080P60) {
    		capt.fmt.fmt.pix.width = 1920;
    		capt.fmt.fmt.pix.height = 1080;
    	}  else {
    		capt.fmt.fmt.pix.width = 1920;
    		capt.fmt.fmt.pix.height = 1080;
    	}
    
    	capt.fmt.fmt.pix.bytesperline = capt.fmt.fmt.pix.width * 2;
    	capt.fmt.fmt.pix.sizeimage = capt.fmt.fmt.pix.bytesperline *
    		capt.fmt.fmt.pix.height;
    #endif
    
    #if 1 /* Add for TVP5150 Testing */
    	capt.fmt.fmt.pix.pixelformat = DEF_PIX_FMT;
    	ret = ioctl(capt.fd, VIDIOC_S_FMT, &capt.fmt);
    	if (ret < 0) {
    		perror("VIDIOC_S_FMT");
    		return -1;
    	}
    
    	ret = ioctl(capt.fd, VIDIOC_G_FMT, &capt.fmt);
    	if (ret < 0) {
    		perror("VIDIOC_G_FMT");
    		return -1;
    	}
    
    	if (capt.fmt.fmt.pix.pixelformat != DEF_PIX_FMT) {
    		printf("%s: Requested pixel format not supported\n",
    		       CAPTURE_NAME);
    		return -1;
    	}
    
    	printf("%s: Right after G_FMT Call width = %d\n", APP_NAME, capt.fmt.fmt.pix.width);
    	printf("%s: Right after G_FMT Call height = %d\n", APP_NAME, capt.fmt.fmt.pix.height);
    	printf("%s: Right after G_FMT Call bytesperline = %d\n", APP_NAME, capt.fmt.fmt.pix.bytesperline);
    	printf("%s: Right after G_FMT Call sizeimage = %d\n", APP_NAME, capt.fmt.fmt.pix.sizeimage);
    
    	capt.fmt.fmt.pix.width = 720;
    	capt.fmt.fmt.pix.height = 480;
    	capt.fmt.fmt.pix.bytesperline = capt.fmt.fmt.pix.width * 2;
    	capt.fmt.fmt.pix.sizeimage = capt.fmt.fmt.pix.bytesperline *
    		capt.fmt.fmt.pix.height;
    
    	printf("%s: width = %d\n", APP_NAME, capt.fmt.fmt.pix.width);
    	printf("%s: height = %d\n", APP_NAME, capt.fmt.fmt.pix.height);
    	printf("%s: bytesperline = %d\n", APP_NAME, capt.fmt.fmt.pix.bytesperline);
    	printf("%s: sizeimage = %d\n", APP_NAME, capt.fmt.fmt.pix.sizeimage);
    	
    	/* Set format according to mode detected */
    	if(capt.fmt.fmt.pix.pixelformat == V4L2_PIX_FMT_RGB24)
    		printf("%s: pixelformat = V4L2_PIX_FMT_RGB24\n", APP_NAME);
    	else if(capt.fmt.fmt.pix.pixelformat == V4L2_PIX_FMT_YUYV)
    		printf("%s: pixelformat = V4L2_PIX_FMT_YUYV\n", APP_NAME);
    	else
    		printf("%s: pixelformat = Others\n", APP_NAME);
    #endif
    
    	ret = ioctl(capt.fd, VIDIOC_S_FMT, &capt.fmt);
    	if (ret < 0) {
    		printf("Set Format failed!!\n");
    		return -1;
    	}
    	/* Get format again and print it on console */
    	capt.fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    	ret = ioctl(capt.fd, VIDIOC_G_FMT, &capt.fmt);
    	if (ret < 0) {
    		printf("Set Format failed\n");
    		return -1;
    	}
    	printFormat("Capture", &capt.fmt);
    
    	/* Request buffers. We are operating in userPtr mode */
    	memset(&capt.reqbuf, 0, sizeof(capt.reqbuf));
    	capt.reqbuf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    	capt.reqbuf.count = MAX_BUFFER;
    	capt.reqbuf.memory = V4L2_MEMORY_USERPTR;
    	ret = ioctl(capt.fd, VIDIOC_REQBUFS, &capt.reqbuf);
    	if (ret < 0) {
    		printf("Could not allocate the buffers\n");
    		return -1;
    	}
    	return 0;
    }
    
    /* Setup display driver */
    int setupDisplay(void)
    {
    	int ret;
    
    	/* Get format */
    	memset(&disp.fmt, 0, sizeof(disp.fmt));
    	disp.fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
    	ret = ioctl(disp.fd, VIDIOC_G_FMT, &disp.fmt);
    	if (ret < 0) {
    		printf("Get Format failed\n");
    		return -1;
    	}
    #if 0 /* Remove for TVP5150 Testing */
    	/* Set format according to display mode */
    	if (capt.dv_preset.preset == V4L2_DV_720P60) {
    		disp.fmt.fmt.pix.width = 1280;
    		disp.fmt.fmt.pix.height = 720;
    	} else if (capt.dv_preset.preset == V4L2_DV_1080P60) {
    		disp.fmt.fmt.pix.width = 1920;
    		disp.fmt.fmt.pix.height = 1080;
    	}  else {
    		disp.fmt.fmt.pix.width = 1920;
    		disp.fmt.fmt.pix.height = 1080;
    	}
    #endif
    
    #if 1 /* Added for TVP5150 Testing */
    	disp.fmt.fmt.pix.width = 720;
    	disp.fmt.fmt.pix.height = 480;
    #endif
    
    	disp.fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV;
    	disp.fmt.fmt.pix.bytesperline = disp.fmt.fmt.pix.width * 2;
    	disp.fmt.fmt.pix.sizeimage = disp.fmt.fmt.pix.bytesperline *
    		disp.fmt.fmt.pix.height;
    	ret = ioctl(disp.fd, VIDIOC_S_FMT, &disp.fmt);
    	if (ret < 0) {
    		printf("Set Format failed\n");
    		return -1;
    	}
    	/* Get format again and display it on console */
    	disp.fmt.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
    	ret = ioctl(disp.fd, VIDIOC_G_FMT, &disp.fmt);
    	if (ret < 0) {
    		printf("Get Format failed for display\n");
    		return -1;
    	}
    	printFormat("Display", &disp.fmt);
    	/* Requests buffers, we are operating in userPtr mode */
    	memset(&disp.reqbuf, 0, sizeof(disp.reqbuf));
    	disp.reqbuf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
    	disp.reqbuf.count = MAX_BUFFER;
    	disp.reqbuf.memory = V4L2_MEMORY_USERPTR;
    	ret = ioctl(disp.fd, VIDIOC_REQBUFS, &disp.reqbuf);
    	if (ret < 0) {
    		perror("Could not allocate the buffers\n");
    		return -1;
    	}
    	return 0;
    }
    /* Stop capture */
    static int stopCapture(void)
    {
    
    	/* Stop capture */
    	int a = V4L2_BUF_TYPE_VIDEO_CAPTURE, ret;
    	ret = ioctl(capt.fd, VIDIOC_STREAMOFF, &a);
    	if (ret < 0) {
    		perror("VIDIOC_STREAMOFF\n");
    		return -1;
    	}
    	return 0;
    }
    /* Stop display */
    static int stopDisplay(void)
    {
    	int a = V4L2_BUF_TYPE_VIDEO_OUTPUT, ret;
    	ret = ioctl(disp.fd, VIDIOC_STREAMOFF, &a);
    	if (ret < 0) {
    		perror("VIDIOC_STREAMOFF\n");
    		return -1;
    	}
    	return 0;
    }
    /* Start display */
    static int startDisplay(void)
    {
    	int a = V4L2_BUF_TYPE_VIDEO_OUTPUT, ret;
    	ret = ioctl(disp.fd, VIDIOC_STREAMON, &a);
    	if (ret < 0) {
    		perror("VIDIOC_STREAMON\n");
    		return -1;
    	}
    	return 0;
    }
    /* Start capture */
    static int startCapture(void)
    {
    	int a = V4L2_BUF_TYPE_VIDEO_CAPTURE, ret;
    	ret = ioctl(capt.fd, VIDIOC_STREAMON, &a);
    	if (ret < 0) {
    		perror("VIDIOC_STREAMON\n");
    		return -1;
    	}
    	return 0;
    }
    /* Start display */
    static int deInitCapture(void)
    {
    	if (close(capt.fd))
    		return -1;
    	return 0;
    }
    
    /* Close display */
    static int deInitDisplay(void)
    {
    	if (close(disp.fd))
    		return -1;
    	return 0;
    }
    
    /* Get fix screeninfo on fbdev */
    static int get_fixinfo(struct fb_fix_screeninfo *fixinfo)
    {
    	int ret;
    	ret = ioctl(fbdev_fd, FBIOGET_FSCREENINFO, fixinfo);
    	if (ret < 0) {
    		perror("Error reading fixed information.\n");
    		return ret;
    	}
    #ifdef SALOOPBACK_DEBUG
    	printf("\nFix Screen Info:\n");
    	printf("----------------\n");
    	printf("Line Length - %d\n", fixinfo->line_length);
    	printf("Physical Address = %lx\n", fixinfo->smem_start);
    	printf("Buffer Length = %d\n", fixinfo->smem_len);
    #endif
    	return 0;
    }
    /* Get variable screeninfo on FBDEV */
    static int get_varinfo(struct fb_var_screeninfo *varinfo)
    {
    	int ret;
    
    	ret = ioctl(fbdev_fd, FBIOGET_VSCREENINFO, varinfo);
    	if (ret < 0) {
    		perror("Error reading variable information.\n");
    		return ret;
    	}
    #ifdef SALOOPBACK_DEBUG
    	printf("\nVar Screen Info:\n");
    	printf("----------------\n");
    	printf("Xres - %d\n", varinfo->xres);
    	printf("Yres - %d\n", varinfo->yres);
    	printf("Xres Virtual - %d\n", varinfo->xres_virtual);
    	printf("Yres Virtual - %d\n", varinfo->yres_virtual);
    	printf("nonstd       - %d\n", varinfo->nonstd);
    	printf("Bits Per Pixel - %d\n", varinfo->bits_per_pixel);
    	printf("blue lenth %d msb %d offset %d\n",
    			varinfo->blue.length,
    			varinfo->blue.msb_right,
    			varinfo->blue.offset);
    	printf("red lenth %d msb %d offset %d\n",
    			varinfo->red.length,
    			varinfo->red.msb_right,
    			varinfo->red.offset);
    	printf("green lenth %d msb %d offset %d\n",
    			varinfo->green.length,
    			varinfo->green.msb_right,
    			varinfo->green.offset);
    	printf("trans lenth %d msb %d offset %d\n",
    			varinfo->transp.length,
    			varinfo->transp.msb_right,
    			varinfo->transp.offset);
    #endif
    	return 0;
    
    }
    /* We derive buffers from fbdev for userpointer operation.
     * We have to setupBuffers
     * fbdev to get enough number of buffers and with enough size
     *
     */
    static int setupBuffers(void)
    {
    	struct fb_fix_screeninfo fixinfo;
    	struct fb_var_screeninfo varinfo, org_varinfo;
    	int ret;
    	int buffersize;
    	int i;
    
    	/*Open FB device*/
    	fbdev_fd = open("/dev/fb0", O_RDWR);
    	if (fbdev_fd <= 0) {
    		perror("Could not open fb device\n");
    		return -1;
    	}
    	/* Get fix screen information. Fix screen information gives
    	 * fix information like panning step for horizontal and vertical
    	 * direction, line length, memory mapped start address and length etc.
    	 */
    	if (get_fixinfo(&fixinfo)) {
    		perror("Could not get fixed screen info\n");
    		return -1;
    	}
    	/* Get variable screen information. Variable screen information
    	 * gives informtion like size of the image, bites per pixel,
    	 * virtual size of the image etc. */
    	if (get_varinfo(&varinfo)) {
    		perror("getting variable screen info failed\n");
    		return -1;
    	}
    	/*store the original information*/
    	memcpy(&org_varinfo, &varinfo, sizeof(varinfo));
    
    	/*
    	 * Set the resolution which read before again to prove the
    	 * FBIOPUT_VSCREENINFO ioctl, except virtual part which is required for
    	 * panning.
    	 */
    	varinfo.xres = disp.fmt.fmt.pix.width;
    	varinfo.yres = disp.fmt.fmt.pix.height;
    	varinfo.xres_virtual = varinfo.xres;
    	varinfo.yres_virtual = varinfo.yres * MAX_BUFFER;
    	varinfo.bits_per_pixel = 16;
    	varinfo.transp.offset = 0;
    	varinfo.transp.length = 0;
    	varinfo.transp.msb_right = 0;
    	varinfo.red.offset = 16;
    	varinfo.red.length = 5;
    	varinfo.blue.offset = 0;
    	varinfo.blue.length = 5;
    	varinfo.green.offset = 8;
    	varinfo.green.length = 6;
    
    	ret = ioctl(fbdev_fd, FBIOPUT_VSCREENINFO, &varinfo);
    	if (ret < 0) {
    		perror("Error writing variable information.\n");
    		return -1;
    	}
    	if (get_varinfo(&varinfo)) {
    		perror("Error getting variable screen information\n");
    		return -1;
    	}
    	/* It is better to get fix screen information again. its because
    	 * changing variable screen info may also change fix screen info. */
    	ret = ioctl(fbdev_fd, FBIOGET_FSCREENINFO, &fixinfo);
    	if (ret < 0) {
    		perror("Error reading fixed information.\n");
    		return -1;
    	}
    
    	/* Get fix screen information. Fix screen information gives
    	 * fix information like panning step for horizontal and vertical
    	 * direction, line length, memory mapped start address and length etc.
    	 */
    	if (get_fixinfo(&fixinfo)) {
    		perror("Getting fixed screen info failed\n");
    		return -1;
    	}
    	/* Mmap the driver buffers in application space so that application
    	 * can write on to them. Driver allocates contiguous memory for
    	 * three buffers. These buffers can be displayed one by one. */
    	buffersize = fixinfo.line_length * varinfo.yres;
    	buffer_addr[0] = (unsigned char *)mmap(0,
    			buffersize *  MAX_BUFFER,
    			(PROT_READ | PROT_WRITE),
    			MAP_SHARED, fbdev_fd, 0);
    	for (i = 1; i < MAX_BUFFER; i++)
    		buffer_addr[i] = buffer_addr[i-1] + buffersize;
    
    	memset(buffer_addr[0], 0xFF, buffersize * MAX_BUFFER);
    	return 0;
    }
    /* Prime capture buffers */
    static int queueCaptureBuffers(void)
    {
    	int ret, i;
    	for (i = 0; i < (MAX_BUFFER / 2); i++) {
    		capt.buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
    		capt.buf.memory = V4L2_MEMORY_USERPTR;
    		capt.buf.index = i;
    		capt.buf.m.userptr = (unsigned long)buffer_addr[capt.buf.index];
    		capt.buf.length = capt.fmt.fmt.pix.sizeimage;
    		ret = ioctl(capt.fd, VIDIOC_QBUF, &capt.buf);
    		if (ret < 0) {
    			perror("VIDIOC_QBUF\n");
    			return -1;
    		}
    	}
    	return ret;
    }
    /* Prime display buffers */
    static int queueDisplayBuffers(void)
    {
    	int ret, i;
    	for (i = (MAX_BUFFER / 2); i < MAX_BUFFER; i++) {
    		disp.buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
    		disp.buf.memory = V4L2_MEMORY_USERPTR;
    		disp.buf.index = i - (MAX_BUFFER / 2);
    		disp.buf.m.userptr = (unsigned long)buffer_addr[i];
    		disp.buf.length = capt.fmt.fmt.pix.sizeimage;
    		ret = ioctl(disp.fd, VIDIOC_QBUF, &disp.buf);
    		if (ret < 0) {
    			perror("VIDIOC_QBUF\n");
    			return -1;
    		}
    	}
    	return 0;
    }
    /* This is a utility function to calculate time  between start and stop. This
     * is used to calculate FPS
     */
    static int calc_result_time(struct timeval *result, struct timeval *after,
    		struct timeval *before)
    {
    	/* Perform the carry for the later subtraction by updating "before" */
    	if (after->tv_usec < before->tv_usec) {
    		int nsec = (before->tv_usec - after->tv_usec) / 1000000 + 1;
    		before->tv_usec -= 1000000 * nsec;
    		before->tv_sec += nsec;
    	}
    	if (after->tv_usec - before->tv_usec > 1000000) {
    		int nsec = (after->tv_usec - before->tv_usec) / 1000000;
    
    		before->tv_usec += 1000000 * nsec;
    		before->tv_sec -= nsec;
    	}
    	/* Compute the time remaining to wait, tv_usec is certainly positive.
    	 * */
    	result->tv_sec = after->tv_sec - before->tv_sec;
    	result->tv_usec = after->tv_usec - before->tv_usec;
    	/* Return 1 if result is negative. */
    	return after->tv_sec < before->tv_sec;
    }
    /* Main function */
    int main(int argc, char *argv[])
    {
    	int i = 0, ret = 0;
    	struct v4l2_buffer temp_buf;
    	struct timeval before, after, result;
    
    	/* Divert fbdev to dvo2 so that it does  not do blending with display*/
    	system ("echo 1:dvo2 > /sys/devices/platform/vpss/graphics0/nodes");
    	/* Open the capture driver. Query the resolution from the capture driver
    	 */
    	ret = initCapture();
    	if (ret < 0) {
    		printf("Error in opening capture device for channel 0\n");
    		return ret;
    	}
    	/* Open the Display driver. */
    	ret = initDisplay();
    	if (ret < 0) {
    		printf("Error in opening display device for channel 0\n");
    		return ret;
    	}
    restart:
    	/* Setup the capture driver Step includes
    	 * Set the format according to the resolution queried.
    	 * request for buffer descriptors for userpointer buffers
    	 */
    	ret = setupCapture();
    	if (ret < 0) {
    		printf("Error in setting up of capture\n");
    		return ret;
    	}
    	printf("Capture has been setup\n");
    	/* Setup the display driver Step includes
    	 * Set the format according to the resolution queried by capture.
    	 * request for buffer descriptors for userpointer buffers
    	 */
    	ret = setupDisplay();
    	if (ret < 0) {
    		printf("Error in setting up of Display\n");
    		return ret;
    	}
    	printf("Display has been setup\n");
    	/* As application works on userPointer, Buffers for both capture and
    	 * display driver are allocated using the fbdev, buffers. Below functionality
    	 * setups the fbdev to mmap the buffers and later capture and display
    	 * will use those buffers
    	 */
    	ret = setupBuffers();
    	if (ret < 0) {
    		printf("Error in setting up of Buffers\n");
    		return ret;
    	}
    	printf("Buffers have been setup\n");
    	/* Total 8 buffers are allocated using fbdev, 4 buffers are primed to
    	 * capture driver.
    	 */
    	ret = queueCaptureBuffers();
    	if (ret < 0) {
    		printf("Error in queuing capture buffers\n");
    		return ret;
    	}
    	printf("Capture buffers have been queued\n");
    	/* Total 8 buffers are allocated using fbdev, 4 buffers are primed to
    	 * display driver.
    	 */
    	ret = queueDisplayBuffers();
    	if (ret < 0) {
    		printf("Error in queuing display buffers\n");
    		return ret;
    	}
    	printf("Display buffers have been queued\n");
    	/* Start display driver always first. This is because display driver
    	 * takes 2 frames to come out of start. If capture is started first
    	 * frame drops will be seen, since capture will already complete two
    	 * frame by time display starts
    	 */
    	ret = startDisplay();
    	if (ret < 0) {
    		printf("Error starring capture \n");
    		return ret;
    	}
    	printf("Display has been started...\n");
    	/* Start capture driver after display driver */
    	ret = startCapture();
    	if (ret < 0) {
    		printf("Error starring capture \n");
    		return ret;
    	}
    	printf("Capture has been started...\n");
    	/* Get time of day to calculate FPS */
    	gettimeofday(&before, NULL);
    	/* Start the steady state loop. Following steps are followed
    	 * 1 dequeue buffer from capture
    	 * 2 dequeue buffer from display
    	 * 3 exchange capture and display buffer pointers
    	 * 4 queue dislay buffer pointer to capture
    	 * 5 queue capture buffer pointer to display
    	 */
    	for (i = 0; i < MAXLOOPCOUNT; i++) {
    		//printf("In the loop...\n");
    		/* Dq capture buffer */
    		ret = ioctl(capt.fd, VIDIOC_DQBUF, &capt.buf);
    		//printf("Capture VIDIOC_DQBUF Called...\n");
    		if (ret < 0) {
    			perror("VIDIOC_DQBUF\n");
    			return -1;
    		}
    		/* Because of IP bugs, capture hardware gets locked up once in
    		 * a while. In that case DQbuf will return  V4L2_BUF_FLAG_ERROR
    		 * in flags.
    		 */
    		if (capt.buf.flags & V4L2_BUF_FLAG_ERROR) {
    			/* If DQbuf returned error check for the hardware lockup
    			 */
    			ret = ioctl(capt.fd, TICAPT_CHECK_OVERFLOW, &capt.over_flow);
    			//printf("TICAPT_CHECK_OVERFLOW Called, Returned %d...\n", ret);
    			if (ret < 0) {
    				perror("TICAPT_CHECK_OVERFLOW\n");
    				return -1;
    			} else {
    				/* If hardware locked up, restart display and
    				 * capture driver
    				 */
    				if (capt.over_flow.porta_overflow) {
    					printf("Port a overflowed\n\n\n\n\n\n\n");
    					stopCapture();
    					stopDisplay();
    					goto restart;
    
    				}
    				if (capt.over_flow.portb_overflow) {
    					printf("Port b overflowed\n\n\n\n\n\n\n");
    					stopCapture();
    					stopDisplay();
    					goto restart;
    				}
    			}
    		}
    		/* DQ display buffer */
    		ret = ioctl(disp.fd, VIDIOC_DQBUF, &disp.buf);
    		//printf("Display VIDIOC_DQBUF Called...\n");
    		if (ret < 0) {
    			perror("VIDIOC_DQBUF Display\n");
    			return -1;
    		}
    		/* Exchange display and capture buffer pointers */
    		temp_buf.m.userptr = capt.buf.m.userptr;
    		capt.buf.m.userptr = disp.buf.m.userptr;
    		disp.buf.m.userptr = temp_buf.m.userptr;
    		/* Queue the capture buffer with updated address */
    		ret = ioctl(capt.fd, VIDIOC_QBUF, &capt.buf);
    		//printf("Capture VIDIOC_QBUF Called...\n");
    		if (ret < 0) {
    			perror("VIDIOC_QBUF\n");
    			return -1;
    		}
    		disp.buf.type = V4L2_BUF_TYPE_VIDEO_OUTPUT;
    		disp.buf.memory = V4L2_MEMORY_USERPTR;
    		disp.buf.length = capt.fmt.fmt.pix.sizeimage;
    		/* Queue the display buffer back with updated address */
    		ret = ioctl(disp.fd, VIDIOC_QBUF, &disp.buf);
    		//printf("Display VIDIOC_QBUF Called...\n");
    		if (ret < 0) {
    			perror("VIDIOC_QBUF Display\n");
    			return -1;
    		}
    		if ((i % 1000) == 0)
    			printf("Count=%d\n", i);
    	}
    	/* Get end time to calculate FPS */
    	gettimeofday(&after, NULL);
    	/* Calculate FPS */
    	calc_result_time(&result, &after, &before);
    	printf("Frame rate = %lu\n", MAXLOOPCOUNT/result.tv_sec);
    	/* Stop capture driver */
    	ret = stopCapture();
    	if (ret < 0) {
    		printf("Error in stopping capture\n");
    		return ret;
    	}
    	/* Stop display driver */
    	ret = stopDisplay();
    	if (ret < 0) {
    		printf("Error in stopping display\n");
    		return ret;
    	}
    	/* Deinit capture driver */
    	ret = deInitCapture();
    	if (ret < 0) {
    		printf("Error in capture deInit\n");
    		return ret;
    	}
    	/* Deinit display driver */
    	ret = deInitDisplay();
    	if (ret < 0) {
    		printf("Error in display deInit\n");
    		return ret;
    	}
    	close(fbdev_fd);
    	system("echo 0 > /sys/devices/platform/vpss/display0/enabled");
    	system ("echo 1080p-60 > /sys/devices/platform/vpss/display0/mode");
    	system("echo 0 > /sys/devices/platform/vpss/graphics0/enabled");
    	system("echo 1 > /sys/devices/platform/vpss/display0/enabled");
    	system("echo 1:hdmi > /sys/devices/platform/vpss/graphics0/nodes");
    	return 0;
    }
    

    David,

    I had tried the omx_camera hoping that would be the fix but it never worked even modifying the gstomx_camera source. I think it may have something to do with the fact we are using the z3 DM816 module but we have our own custom carrier board. I may go back and try this again, but I could never get it to work with the TVP5150 (I did get it to work with the FPGA on VIP0 but everything had to be hard-coded and ruled out the TVP on VIP1). Once I complete the v4l2 driver I'll give it another shot-

    Thanks-

     

  • As a side note, changing the vip_port_cfg for the TVP5150 in ti81xx_vpss.c is not changing the results of the VIP dump. Most notable, the 5th byte or "14" in the 0x48105A00 register is the one that makes the difference.

    My register is currently:

    48105a00:  01 00 00 00 14 a1 40 80 00 00 00 00 00 00 00 00

    If I run (during capture with dequeue stuck):

    devmem 0x48105A00 64 0x8040A10000000001

    Then capture starts dequeueing and my register reads:

    48105a00:  01 00 00 00 00 a1 40 80 00 00 00 00 00 00 00 00

    The color is not correct, but that seems to be the first byte in the register (02 is what works correctly) and I can deal with that next.

    Sooooo, what is that register setting? And why are the register settings not changing with the vip_port_cfg?

    Thanks-

  • Once the capture starts, can you try below settings?

     

    48105a00:  02 00 00 00 00 a1 40 80 00 00 00 00 00 00 00 00

     

    In your setting, it looks like VIP is getting configured for the 16bit interface (first byte is set to 0x01) and if i remember correctly, TVP5150 support 8bit embedded sync interface. I am also assuming here that you have connected TVP5150 to VIP_porta and you are starting porta. If it is portB, you will have to use difference instance of the V4L2 driver.

     

     

    Regards,

    Brijesh

  • Brijesh,

    Yes, I am capturing from VIP1 Port A 8bit (7..0)

    I set the register as you said and it works correctly, but the strange thing is the subdevice settings in ti81xx_vpss.c do not seem to change how the VIP is getting configured. As a test I changed the sync mode to discrete, the IF mode to 24bit and the Input DF to RGB24_888 and then recompiled. 

    When I ran the test and dumped the registers, there was no change from previous tests with different settings. How is that possible? It seems to me like it is setting up VIP1 Port A with the settings from the FPGA Subdevice and not the TVP5150 Subdevice.

    I've added some debug output to the ti81xxvin_probe() function to print the subdev settings data so I can make sure it is getting set at the probe level correctly, I'll let you know if I find any problems there. Ultimately though where should I be looking to make sure the VIP is getting the correct data at the time the capture device (/dev/video5) is opened?

    Thanks-

  • OK, looks like the problem is I was not calling VIDIOC_S_INPUT in the saLoopBack program and this is where the ti81xxvin driver configures the VIP for the selected input. Since my defaults are set-up for the VIP0 to capture from the FPGA (and query_dv_preset takes care of this for the VIP0) it used those settings instead of what I defined for the VIP1 subdevice.

    Now that this is working, I think I can just add an "input" variable to v4l2src to get that working. Let me know if you see any pitfalls doing it this way or if I should modify the driver to use the VIDIOC_QUERYSTD call instead.

    Thanks for all your help-

  • Brijesh (et. al.),

    I poked around the ti81xxvin driver some more and found the correct way to do this would be to have the correct subdevice defaults set in the ti81xxvin_open() function.

    Here is what I did (for others that may be looking for an answer):

    static int ti81xxvin_open(struct file *filep)
    {
    	struct ti81xxvin_config *config = ti81xxvin_dev->platform_data;
    	struct ti81xxvin_inst_config *inst_cfg;
    	struct video_device *vdev = video_devdata(filep);
    	struct ti81xxvin_buffer_obj *buf_obj;
    	struct ti81xxvin_obj *vid_inst;
    	struct ti81xxvin_instance_obj *inst;
    	struct ti81xxvin_fh *fh;
    	struct ti81xxvin_subdev_info *subdev_info;
    	int sd_index = 0;
    	int i, ret = 0;
    
    	ti81xxvin_dbg(2, debug, "ti81xxvin_open\n");
    
    	inst = video_get_drvdata(vdev);
    	setup_timer(&inst->overflow_timer, ti81xxvin_overflow_handler,
    		(unsigned long)inst);
    
    
    	vid_inst = &inst->video;
    	buf_obj = &inst->buf_obj;
    
    	if (mutex_lock_interruptible(&buf_obj->buf_lock))
    		return -ERESTARTSYS;
    
    	if (NULL == inst->curr_subdev_info) {
    #if 0 /* Removed as this always defaults setup to first subdevice */
    		/**
    		 * searinst through the sub device to see a registered
    		 * sub device and make it as current sub device
    		 */
    		for (i = 0; i < config->subdev_count; i++) {
    			if (ti81xxvin_obj.sd[i]) {
    				/* the sub device is registered */
    				inst->curr_subdev_info =
    					&config->subdev_info[i];
    				/* make first input as the current input */
    				vid_inst->input_idx = 0;
    				break;
    			}
    		}
    		if (i == config->subdev_count) {
    			ti81xxvin_err("No sub device registered\n");
    			ret = -ENOENT;
    			goto exit;
    		}
    #endif
    #if 1 /* Added to set-up default subdevice per the current VIP port */
    		int index = 0;
    		inst_cfg = &config->inst_config[inst->instance_id];
    		subdev_info = hdvpss_map_sub_device_to_input(inst, config, index,
    			&sd_index);
    
    		vid_inst->input_idx = index;
    		inst->curr_subdev_info = subdev_info;
    		inst->curr_sd_index = sd_index;
    
    		/* update tvnorms from the sub device input info */
    		inst->video_dev->tvnorms = inst_cfg->inputs[index].input.std;
    		inst->captctrl->isinputset = 1;
    #endif
    	}
    
    	/* Allocate memory for the file handle object */
    	fh = kmalloc(sizeof(struct ti81xxvin_fh), GFP_KERNEL);
    	if (NULL == fh) {
    		ti81xxvin_err("unable to allocate memory for file"
    			"handle object\n");
    		ret = -ENOMEM;
    		goto exit;
    	}
    
    	/* store pointer to fh in private_data member of filep */
    	filep->private_data = fh;
    	fh->instance = inst;
    	fh->initialized = 0;
    	/* If decoder is not initialized. initialize it */
    	if (!inst->initialized) {
    		fh->initialized = 1;
    		inst->initialized = 1;
    		/*memset(&(inst->hdvpssparams),
    			0, sizeof(struct hdvpss_params));*/
    	}
    	/* Increment instance usrs counter */
    	inst->usrs++;
    	/* Set io_allowed member to false */
    	fh->io_allowed = 0;
    	/* Initialize priority of this instance to default priority */
    	fh->prio = V4L2_PRIORITY_UNSET;
    	v4l2_prio_open(&inst->prio, &fh->prio);
    exit:
    	mutex_unlock(&buf_obj->buf_lock);
    	return ret;
    }

    Now the correct subdevice and input are set to the VIP at the time you open the device (through saLoopBack or v4l2src). This works perfect, I'm not sure why this was not already part of the driver in the EZSDK.

    Thanks again for all your help in getting this thing running!

  • Hi,

     

    Glad to head it started working.

    In any case, please follow sample application to make sure required ioctl in the correct sequence are getting called.

     

    Regards,

    Brijesh

  • Hi Troy Wood,

    I am facing the same issue on VIP1_PORTA  v4l2 driver for 8-bit embedded sync TVP5147 decoder output.

    If you don't mind can you share your code with me?

    It would be very helpful to get rid of this problem.

    Thanks & Regards

    Srikanta

  • Hi Troy and Srikanta,

    The configuration really depends on how your device is connected to the VIP port. if you connect in one way and configure in other way, it is not going to capture. If it is connected to discrete sync mode, still you will need to say that what all pins are connected. is it vsync+hsync mode or vsync+actvid pins that are connected? VIP will capture based on this configured signals.

    Regards,
    Brijesh
  • Hi Brijesh,

    DM8168 have for 4 video input ports namely VIP0_PORTA, VIP0_PORTB, VIP1_PORTA and VIP1_PORTB.
    In my board VIP0_PORTA(16-bit with embedded sync) and VIP1_PORTA(8-bit with embedded sync) are connected with FPGA and TVP5147 respectively. For FPGA there is no configuration by I2C and for TVP5147 we are configuring it separately by I2c.

    So please tell me how to modify the following files for v4l2 driver of above mentioned devices
    1. board-ti8168evm.c
    2. ti81xx_vpss.c
    3. ti81xxvin_main.c
    4. saLoopBack.c

    Your response is highly appreciable to get rid of this problem.

    Thanks & Regards

    Srikanta

  • Please refer to the user guide and an app note explaining how to add new sensor.
    It will exactly explain you field need to be configured.

    Rgds,
    Brijesh
  • Hi Brijesh,

    In the current EZSDK of dm8168 is working only with TVP7002 (connected with VIP0_PORTA). In our custom board 16-bit VIP0_PORTA connected with a FPGA but there is no I2C for configuration.

    You have referred me to go through user guide but that is not enough to modify the v4l2 driver. So, please give me some idea so that I can modified the current v4l2 driver for my custom board. 

    Thanks & Regards

    Srikanta