summaryrefslogtreecommitdiff
path: root/drivers/media/video
AgeCommit message (Collapse)Author
2013-08-08ENGR00274493 mx6sl: csi/v4l: Fix capture incorrect data with format UYVYrel_imx_3.0.35_4.1.0_rc2Robby Cai
There's an interim buffer which should only be used when PxP CSC is used. Otherwise the video buffer gets incorrect data by copying the content of interim buffer. The patch fixes this by moving the memcpy to the right place. Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit 8e0b8ff485dd7cdeabc653f1e27c271ac923710e)
2013-07-18ENGR00271053-3 mx6sl: csi/v4l2: remove PAGE_ALIGN for image size calculationRobby Cai
The driver should inform the upper-lever application the exact size of the image. PAGE_ALIGN macro should be removed. Signed-off-by: Robby Cai <R63905@freescale.com>
2013-07-18ENGR00271053-2 mx6sl: csi/v4l2: add strict check for crop settingRobby Cai
add the strict check for crop setting in S_CROP ioctl Signed-off-by: Robby Cai <R63905@freescale.com>
2013-07-18ENGR00271053-1 mx6sl: csi/v4l2: add cropcap ioctl supportRobby Cai
- add the CROPCAP ioctrl support Signed-off-by: Robby Cai <R63905@freescale.com>
2013-07-17ENGR00271344L Fix for ENGR00267024 introduced compilation warningJay Monkman
Fixed code so condition causing the warning never occurs. Signed-off-by: Jay Monkman <jay.monkman@freescale.com>
2013-07-12ENGR00269619 mxc vout:improve vb handling for 3 field deinterlacingLiu Ying
We need 2 video buffers to get a deinterlaced frame in VDI low motion mode or medium motion mode. When there is no enough video buffer in the active list, no one triggers the video buffer timer, then users may be blocked at dqueue buffer ioctrl if they are in blocking mode. In order to fix this issue, we may peek the first available video buffer in the queue list so that the buffer may be taken as a reference video buffer to do deinterlacing. If there is no video buffer in the queue list, we should make users be able to trigger the timer again when they queue buffers to the driver. Signed-off-by: Liu Ying <Ying.Liu@freescale.com> (cherry picked from commit 52d0e3f01afbf49d8d16225dede18cc71daa0570)
2013-07-10ENGR00261293-2 mx6sl: csi/v4l2: add hflip/vflip/rotation supportRobby Cai
Use ePxP to do the horizontal/vertical flip and rotation support Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit d0b9c741601b766213af1332329963f4267cd0c6)
2013-07-10ENGR00261293-1 mx6sl: csi/v4l2: resize function not work for v4l2 captureRobby Cai
- the root cause is pxp input/output buffer for csi post-processing is same one, some part of content is overridded. - use S_CROP ioctl to control crop, S_FMT to control output size. Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit 9f3685ea1cd4e56b5d89bfbaf48920ba862edb49)
2013-07-10ENGR00255920-2 mxc vout:wait for 2 vsyncs when streamoffLiu Ying
Some expiring video buffers may have been rendered to display triple buffers for display. The relevant triple buffers are set to be ready and depend on the display hardware engine to switch them to be active on screen in turn automatically. So, we need to wait for at least 2 vsyncs to make sure all of the expiring video buffers be shown on display already. Signed-off-by: Liu Ying <Ying.Liu@freescale.com> (cherry picked from commit f7479db43eb2fa9bdb03c1ce99239a3136345105)
2013-07-10ENGR00255920-1 mxc vout:Remove cancel_work_sync() when streamoffLiu Ying
We hope the queued works can be done before streamoff, since the works will render expiring video buffers to display. But, the function cancel_work_sync() cannot guarantee this. Instead, it may cancel some queued works before they starts to work. This patch removes the function call cancel_work_sync() when streamoff. We rely on the function flush_workqueue() right after it to make sure queued works be done before streamoff. Signed-off-by: Liu Ying <Ying.Liu@freescale.com> (cherry picked from commit d88f6f7eaf3b78e667de46aa355cf366a1142e47)
2013-06-24ENGR00268385 v4l2 fg overlay:disable fb ywrap when enable overlayLiu Ying
This patch disables framebuffer ywrap flag when we enable overlay, because the display double buffers are not ywrapped. This may avoid wrong preview pictures on platforms which use NV12 pixel format for overlay framebuffer. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-06-14ENGR00267024 mx6q: Stop DMA memory fragmentationJay Monkman
Applied patch from customer to prevent DMA memory fragmentation. Customer reported system crashes due to running out of DMA-able memory while playing videos. Reported in CT42391649. Signed-off-by: Jay Monkman <jay.monkman@freescale.com>
2013-06-14ENGR00266881 mxc vout:Flush workqueue when change is needed for streamingLiu Ying
We currently call cancel_work_sync() to have all left work be done. But, this is not safe to make sure all left work being done successfully. Instead, chances are that some work may be cancelled before starting to be done, which may cause frame lost and make us hang at upcoming wait_event_interruptible() in videobuf_waiton() called from video buffer core v1 framework's dqbuf API. This patch replaces the function call cancel_work_sync() with flush_workqueue() to fix the issue. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-06-14ENGR00266873 mxc vout:Release or invalidate previous buffers correctlyLiu Ying
Users may call VIDIOC_S_CTRL ioctrl to do rotation, such as 90 degree rotation, when a video is streaming in IC bypass mode. The runtime rotation setting may make the vout driver lose the track for a previous video buffer and finally cause the streaming hang. This patch releases that video buffer in this case and invalidates previous video buffers when necessary. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-05-15ENGR00262701 mxc v4l2 capture:Correct v4l2 internal master device nameLiu Ying
There could be two v4l2 internal master devices with the same name in the system if the name is in 'mxc_v4l2_cap<csi>' fashion, since there are two IPUs embedded in i.MX6Q and each IPU has two CSI ports. This patch changes the name to be in 'mxc_v4l2_cap<pdev->id>' fashion to fix the naming issue. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-05-08ENGR00261255 mxc vout:Replace classical timer with hrtimerLiu Ying
This patch replaces the old classical timer(low resolution timer) with high resolution timer. This change improves the accuracy of time point we put/activate buffers on display flow. For example, we intend to show several frames in a framerate of 30fps(constant interval bewteen 2 adjacent frames should be 33.33ms), the classical timer would introduce a 10ms error in the interval which may downgrade the video quality(jitter can be seen). Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-05-02ENGR00259949 mxc vout:fix screen tearing issue in ic bypass caseLiu Ying
In ic bypass case, we put video buffers at a framebuffer display channel directly. The display channel works at triple buffer mode. To make sure a video buffer(buf N) has been shown on display device, we at least need to wait for the second video buffer(buf N+2) after the current buffer(buf N) is put on the display channel. Then, the current buffer(buf N) can be added to the dequeue list, otherwise, the user may get the buffer too early so that the buffer being shown can be overwritten - screen tearing issue happens. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-04-24ENGR00260231 mxc vout:fill black correctly for more planar formatsLiu Ying
In ic bypass mode, the display framebuffer pixel format will be changed to the pixel format of the buffer queued by user. It could be all the planar pixel formats. We will fall back to the wrong black filling logic for UYVY and RGB pixel formats if the planar pixel format is not NV12. This patch corrects the black filling logic for the following planar pixel formats: IPU_PIX_FMT_YUV420P2 IPU_PIX_FMT_YUV420P IPU_PIX_FMT_YVU420P IPU_PIX_FMT_YUV422P IPU_PIX_FMT_YVU422P IPU_PIX_FMT_YUV444P Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-04-24ENGR00259754 V4L2 output: Fix HDMI display green bar after video playbackWayne Zou
After doing video playback with Bypass IC mode on HDMI display, there is a green bar at the bottom of the display, it is caused by resetting miscalculated display buffer size. Signed-off-by: Wayne Zou <b36644@freescale.com>
2013-04-17ENGR00239959 V4L2 output: Fix video playback bug if pulling window out of screenWayne Zou
Add strict input parameters check for v4l2 output drivers. The part of window inside the display boundary is shown if pulling window out of screen. About this issue: video playback error if pulling window out of screen Using totem to play a video and using the mouse to pull the video window out of the screen, it will print the follow errors: imx-ipuv3 imx-ipuv3.0: ERR:[0xbad85200]-no:0x15c0 "wait_for_comp_timeo ut" ret:0,line:2768 imx-ipuv3 imx-ipuv3.0: ERR: [0xbad85200] no-0x15c0, timeout:1000ms! imx-ipuv3 imx-ipuv3.0: ERR: no-0x15c0,ipu_queue_task err:-110 mxc_v4l2_output mxc_v4l2_output.0: display work fail ret = -110 imx-ipuv3 imx-ipuv3.0: warning: disable ipu dma channel 21 during its busy state Signed-off-by: Wayne Zou <b36644@freescale.com>
2013-04-01ENGR00255371 v4l2 fg overlay:workaround ipu warningLiu Ying
There is annoying ipu warning when doing preview by using v4l2 fg overlay component: /unit_tests/mxc_v4l2_overlay.out -iw 320 -ih 240 -ow 1280 -oh 720 -r 0 -fg -t 5 imx-ipuv3 imx-ipuv3.0: IDMAC12's EBA0 is not 8-byte aligned This warning can be seen only when preview size is bigger than 1024*1024(ipu device driver split mode is enabled). After debug, it appears that the unaligned buffer address is caused by input cropping for left strip, and this cropping is triggered by the split mode algrithm. The algrithm is complex, so currently this patch only changes the input pixel format of the ipu task from UYVY to NV12 to workaround this warning. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-03-29ENGR00256629 V4L2 output: Fix color bar issue on 1080p HDMI displayWayne Zou
When doing video playback on video16, which is also the first framebuffer and used for fb console as well, there is a color bar on top of 1080p screen. We need to make sure the correct vmode when doing pan display. Signed-off-by: Wayne Zou <b36644@freescale.com>
2013-03-29ENGR00253652 ov5640 dvp:Align iq setting with mipi cameraLiu Ying
According to the OV FAE, the image quality(iq) setting is from 0x5000 register to 0x3a1f register in the camera's initialization setting. This patch aligns image quality setting of ov5640 dvp camera to ov5640 mipi camera. The registers whose values are changed are 0x5001, 0x5189, 0x518b, 0x518d, 0x518e, 0x518f, 0x5199, 0x519c and 0x519d. This change may improve the image quality of 5M/1M/VGA/QVGA taken pictures in Android according to test team observation. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-03-22ENGR00255491 ov5640: Fix build break by make modulesRobby Cai
Fix the kernel modules building error for mx6q/mx6dl as follows: LD [M] drivers/usb/gadget/g_serial.o Building modules, stage 2. MODPOST 48 modules ERROR: "csi_enable_mclk" [drivers/media/video/mxc/capture/ov5640_camera.ko] undefined! make[1]: *** [__modpost] Error 1 make: *** [modules] Error 2 Signed-off-by: Robby Cai <R63905@freescale.com>
2013-03-21ENGR00252064-3 camera: ov5640: fix missed setting for light_frequencyRobby Cai
Confirmed from OV, the missed setting for light_frequency need to be added. Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit 3c4d081940ec00fecd87a55721e14116dc01e481)
2013-03-21ENGR00252064-2 mx6sl: ov5640: need enable MCLK before read sensor IDRobby Cai
After the patch of auto-detection for sensor pushed, there's a need to read sensor ID in probe function. But on MX6SL, MCLK is not enabled at that time. So need to enable it before read sensor ID. Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit 78ad8b6f9d18cf5595cb532b7e08804aff158815)
2013-03-21ENGR00252064-1 csi/v4l: need power on sensor for its initializationRobby Cai
Need power on the sensor for its initialization, otherwise the sensor can not work properly. Signed-off-by: Sheng Nan <b38800@freescale.com> Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit 24ef6f52c717b9f2288d1c66ec6efd284935e23e)
2013-03-13ENGR00243315-6 ADV7180:Remove unnecessary header filesLiu Ying
This patch removes unnesessary header files in the driver. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-03-13ENGR00243315-5 ADV7180:Power management adjustmentLiu Ying
ADV7180 power down/on can be controlled by a gpio pin or i2c register setting. The PDBP bit in 0x0f register chooses the control source, and the PWRDWN bit in 0x0f register chooses to power down the chip or power on the chip if control source is i2c. This patch removes all gpio pin power down/on code after probe function and uses i2c to do power down/on operation, as some boards may choose to not connect ADV7180 power down pin with AP, however, AP's i2c bus has to be connect with the ADV7180 chip. Moveover, this patch also adds a 400ms sleep after the chip is powered on, which is a workaround for preview scrolling issue(we suspect that the chip needs some time to in a stable status, so that it may sends correct data to AP). Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-03-13ENGR00243315-4 MXC V4L2 Capture:Improve debug info for s_stdLiu Ying
commit f8e1a3bb62eecf93a31a51c4dbe08a0214fa1d57 introduced an annoying kernel log by changing a pure debug info to error level. This patch reverts that change. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-03-13ENGR00243315-3 MXC V4L2 Capture:Remove unnecessary mclk settingLiu Ying
commit f8e1a3bb62eecf93a31a51c4dbe08a0214fa1d57 added a hard coding for csi_parma.mclk setting to 27MHz. The comment added by that commit is totally wrong by telling that csi_param.mclk would be a kind of 'pixel clock' set in 'csi_data_dest' register. This patch removes the unnecessary mclk setting for csi_param.mclk variable, since it is only valid for CSI test mode. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-03-06ENGR00252782 mxc v4l2 capture:Support csi number attributionLiu Ying
This patch adds device attribution for video device to show csi number to userspace. The pattern is in "ipux_csix" fashion, which tells which ipu and csi is relevant to a specific video device. In this way, userspace may figure out different cameras even if they have the same type, especially, android may use this to know back/front cameras. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
2013-03-04ENGR00252559: mxc_v4l2_capture: ov5640: incorrect warning for XGA@15fpsSheng Nan
The following warning information should be displayed only when the format is XGA and frame rate is 30fps: pr_warning("ov5640: actual frame rate of XGA is 22.5fps\n"); Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-03-04ENGR00252411: mxc_v4l2_capture: ov5642/ov5640 cannot both be set as build-in.Sheng Nan
ov5642 and ov5640 are inside choice "prompt "Select Camera/TV Decoder"" It prevents some modules are set as build-in at the same time. All the cameras inside the choice are parallel cameras. There is no need to include all of them inside a choice. Know issues: ADV7180 (out of the choice) and mipi ov camera (inside the choice) can not be both selected for ARM2 board: CSI0_MCLK pad is conflicted between adv7180 and mipi camera ext port. Developers should know this. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-03-01ENGR00252381: mxc_v4l2_capture: ov5640: incorrect return value of ov5640_probeSheng Nan
ov5640_probe always return -1 when error happens. Actually we should use the correct return value. For example, -ENODEV when no ov5640 is found. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-03-01ENGR00252071-2: mxc_v4l2_capture: ov5640_mipi: update probe print informationSheng Nan
Because ov5642 and ov5640 changes the probe information due to auto detect, ov5640_mipi should keep the same. - Add found information to tell user ov5640_mipi is found. - Use the same "not found" information as ov5642/ov5640. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-03-01ENGR00252071-1: mxc_v4l2_capture: auto detection parallel ov5642 and ov5640Sheng Nan
Both ov5642 and ov5640 need to be supported for parallel port of validation board and no code change is needed when change from one sensor to another. - Add additional common i2c id for ov5640 and ov5642 for auto dectection - Since two sensors will be checked because of auto detection, so use warning instead of error if sensor id don't match. - Add found information to tell user which camera is found. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-03-01ENGR00252162: mxc_v4l2_capture: ov5640: some formats have quality issueSheng Nan
The following formats have quality issue: - 30fps: 720p - 15 fps: 1080p,qsxga Quality issue happens on high resolutions. So, increase the drive capability of ov5640 can fix this problem. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-02-21ENGR00250756-4 V4L2 output: fix coding format and review commit warningWayne Zou
Fix the review commit warning such as "line over 80 characters", "no space before tabs". Signed-off-by: Wayne Zou <b36644@freescale.com>
2013-02-04ENGR00242327 V4L2 output: Support field format changes on frame by frame baseWayne Zou
Support interlace field format or progressive format changes on the frame by frame base for V4L2 output Signed-off-by: Wayne Zou <b36644@freescale.com>
2013-01-23ENGR00240972-3 V4L2: VDI double frame rate for interlace streamWayne Zou
Each VPU decoded frame is de-interlaced twice inside v4l2 output driver, and show twice also to achieve IPU/VDI double frame rate output. This feature is disable by default. Signed-off-by: Wayne Zou <b36644@freescale.com>
2013-01-09ENGR00237682-3: mxc_v4l2_capture: ov5640: support scaling modesSheng Nan
The method for change between scaling and subsampling mode is different from ov5640_mipi. (image bigger than 1280*960 is scaling mode, smaller is subsampling). According to OV5640 Auto Focus Camera Module Application Notes (with DVP Interface) R2.14.pdf, change back from QSXGA to VGA, don't need to do exposure calculation. According to the test result, if we do exposure calculation when change back from scaling to subsampling mode, the image would be dark. So the method is: Change to scaling mode, go through exposure calcuation. Change to or back to subsampling mode, change mode directly. Supported mode: - QSXGA@7.5fps - 1080P@7.5fps Can't make 1080P works at 15fps. Here is a reply from ov fae: because of scaling down, max frame for 1080P is the same as 5M, both are 15fps. so if 5M can runs up to 7.5fps on your demo, then 1080P is the same 7.5fps max. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-01-09ENGR00237682-2: mxc_v4l2_capture: ov5640: support all subsampling modesSheng Nan
Supported the following modes, verified image quality and frame rate - VGA 30/15fps - QVGA 30/15fps - NTSC 30/15fps - PAL 30/15fps - 720P 30/15fps Note: use the same setting as app note of ov5640 dvp - QCIF 30/15fps - XGA 22.5/15fps Note: cannot make XGA work on 30fps. Just a reference of ov5640 datasheet: 1280*960 YUV422 maximum at 22.5fps. 1280*720 YUV422 maximum at 30fps. Need to confirm later. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-01-09ENGR00237706: mxc_v4l2_capture: ov5640: correct the behavior of ENUM_FMTSheng Nan
ov5640 ioctl_enum_fmt_cap only returns value of index = 0; before support other formats, correct the behavior of this ioctl. - ENUM_FMT returns all the supported format. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-01-09ENGR00237682-1: mxc_v4l2_capture: ov5640: use global initializationSheng Nan
The current code struct of parallel ov5640 set mode directly. The newest settings need to go through global initialization. New settings are provided by ov company So this patch does: - Make parallel ov5640 mode settings go through global initialization. - Only VGA (640 * 480) are provided as a validation of the new setting. - Other modes will be provided in the later patches. Signed-off-by: Sheng Nan <b38800@freescale.com>
2013-01-06ENGR00238237-2 mx6sl: csi/v4l: Initialize the variable cam_fmtRobby Cai
This patch fixed the cam_fmt uninitialization issue. Signed-off-by: LiGang <b41990@freescale.com> Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit 48a48ea30c6e55e44c9eacaad316b5caa04a3dda)
2013-01-06ENGR00238237-1 mx6sl: csi/v4l: fix camera picture flickering issueRobby Cai
Flickering issue happens when there's no buffer to be processed(e.g., the pace of QBUF is much slower than DQBUF). The cause is the hardware is using double buffering, while the driver has no good protection at above case and thus the CSI will fill the buffer not in the right order. The way to fix is refining the output of the working_q buffer list, that is, if there's no buffer to be processed then output to a dummy buffer. Another important change is to only do DMA reflash operation when SOF is detected in streamon. Remove this operation is CSI interrupt handler because it violates to the SPEC (only do DMA reflash before DMA is enabled but NOT at the time or after DMA's enabled). Signed-off-by: LiGang <b41990@freescale.com> Signed-off-by: Robby Cai <R63905@freescale.com> (cherry picked from commit 0c4584763fa44b01a2f48198fa27c9206a116164)
2012-12-26ENGR00238201-2 V4L2:ADV7180:driver kconfig changeguoyin.chen
Move ADV7180 out of choice to make it be enabled with other camera config simultaneously Signed-off-by: guoyin.chen <guoyin.chen@freescale.com> (cherry picked from commit a6becd9a87da4fe0bdcc0e96d690377078c856b9)
2012-12-26ENGR00238201-1 V4L2:ADV7180:Support ioctrl_enum_framesizesguoyin.chen
Add ioctl_enum_framesizes function to align the requirement of Camera HAL in Android Signed-off-by: guoyin.chen <guoyin.chen@freescale.com> (cherry picked from commit fd0a1be3e55c3ca5b16f5bf89a24c62b1f3f3abe)
2012-12-26ENGR00236141 csi:Add stride alignment setting from userspaceguoyin.chen
In android, IPU fills the I420 buffer. And GPU shows the buffer to display. mx6's GPU has 32 Y-stride alignment for I420. The stride alignment will be passed through by bytesperline. This update is only for csi->smfc->mem channel. Signed-off-by: guoyin.chen <guoyin.chen@freescale.com> (cherry picked from commit 4708dc1999ed4857799100434e4f46f68f4e7c13)