aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2018-12-07media: vivid: Improve timestampingGabriel Francisco Mandaji3-18/+40
Simulate a more precise timestamp by calculating it based on the current framerate. Signed-off-by: Gabriel Francisco Mandaji <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [[email protected]: replaced division by 2 with bit shift] Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: rcar-vin: add R8A77980 supportSergei Shtylyov2-0/+33
Add the R8A77980 SoC support to the R-Car VIN driver. Signed-off-by: Sergei Shtylyov <[email protected]> Acked-by: Niklas Söderlund <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: rcar-csi2: add R8A77980 supportSergei Shtylyov2-0/+12
Add the R-Car V3H (AKA R8A77980) SoC support to the R-Car CSI2 driver. Signed-off-by: Sergei Shtylyov <[email protected]> Acked-by: Rob Herring <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: Use of_node_name_eq for node name comparisonsRob Herring4-13/+11
Convert string compares of DT node names to use of_node_name_eq helper instead. This removes direct access to the node name pointer. Cc: Kyungmin Park <[email protected]> Cc: Kukjin Kim <[email protected]> Cc: Krzysztof Kozlowski <[email protected]> Cc: Hyun Kwon <[email protected]> Cc: Michal Simek <[email protected]> Cc: [email protected] Cc: [email protected] Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Benoit Parrot <[email protected]> Signed-off-by: Rob Herring <[email protected]> Reviewed-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: venus: core: Set dma maximum segment sizeVivek Gautam1-0/+8
Turning on CONFIG_DMA_API_DEBUG_SG results in the following error: [ 460.308650] ------------[ cut here ]------------ [ 460.313490] qcom-venus aa00000.video-codec: DMA-API: mapping sg segment longer than device claims to support [len=4194304] [max=65536] [ 460.326017] WARNING: CPU: 3 PID: 3555 at src/kernel/dma/debug.c:1301 debug_dma_map_sg+0x174/0x254 [ 460.338888] Modules linked in: venus_dec venus_enc videobuf2_dma_sg videobuf2_memops hci_uart btqca bluetooth venus_core v4l2_mem2mem videobuf2_v4l2 videobuf2_common ath10k_snoc ath10k_core ath lzo lzo_compress zramjoydev [ 460.375811] CPU: 3 PID: 3555 Comm: V4L2DecoderThre Tainted: G W 4.19.1 #82 [ 460.384223] Hardware name: Google Cheza (rev1) (DT) [ 460.389251] pstate: 60400009 (nZCv daif +PAN -UAO) [ 460.394191] pc : debug_dma_map_sg+0x174/0x254 [ 460.398680] lr : debug_dma_map_sg+0x174/0x254 [ 460.403162] sp : ffffff80200c37d0 [ 460.406583] x29: ffffff80200c3830 x28: 0000000000010000 [ 460.412056] x27: 00000000ffffffff x26: ffffffc0f785ea80 [ 460.417532] x25: 0000000000000000 x24: ffffffc0f4ea1290 [ 460.423001] x23: ffffffc09e700300 x22: ffffffc0f4ea1290 [ 460.428470] x21: ffffff8009037000 x20: 0000000000000001 [ 460.433936] x19: ffffff80091b0000 x18: 0000000000000000 [ 460.439411] x17: 0000000000000000 x16: 000000000000f251 [ 460.444885] x15: 0000000000000006 x14: 0720072007200720 [ 460.450354] x13: ffffff800af536e0 x12: 0000000000000000 [ 460.455822] x11: 0000000000000000 x10: 0000000000000000 [ 460.461288] x9 : 537944d9c6c48d00 x8 : 537944d9c6c48d00 [ 460.466758] x7 : 0000000000000000 x6 : ffffffc0f8d98f80 [ 460.472230] x5 : 0000000000000000 x4 : 0000000000000000 [ 460.477703] x3 : 000000000000008a x2 : ffffffc0fdb13948 [ 460.483170] x1 : ffffffc0fdb0b0b0 x0 : 000000000000007a [ 460.488640] Call trace: [ 460.491165] debug_dma_map_sg+0x174/0x254 [ 460.495307] vb2_dma_sg_alloc+0x260/0x2dc [videobuf2_dma_sg] [ 460.501150] __vb2_queue_alloc+0x164/0x374 [videobuf2_common] [ 460.507076] vb2_core_reqbufs+0xfc/0x23c [videobuf2_common] [ 460.512815] vb2_reqbufs+0x44/0x5c [videobuf2_v4l2] [ 460.517853] v4l2_m2m_reqbufs+0x44/0x78 [v4l2_mem2mem] [ 460.523144] v4l2_m2m_ioctl_reqbufs+0x1c/0x28 [v4l2_mem2mem] [ 460.528976] v4l_reqbufs+0x30/0x40 [ 460.532480] __video_do_ioctl+0x36c/0x454 [ 460.536610] video_usercopy+0x25c/0x51c [ 460.540572] video_ioctl2+0x38/0x48 [ 460.544176] v4l2_ioctl+0x60/0x74 [ 460.547602] do_video_ioctl+0x948/0x3520 [ 460.551648] v4l2_compat_ioctl32+0x60/0x98 [ 460.555872] __arm64_compat_sys_ioctl+0x134/0x20c [ 460.560718] el0_svc_common+0x9c/0xe4 [ 460.564498] el0_svc_compat_handler+0x2c/0x38 [ 460.568982] el0_svc_compat+0x8/0x18 [ 460.572672] ---[ end trace ce209b87b2f3af88 ]--- >From above warning one would deduce that the sg segment will overflow the device's capacity. In reality, the hardware can accommodate larger sg segments. So, initialize the max segment size properly to weed out this warning. Based on a similar patch sent by Sean Paul for mdss: https://patchwork.kernel.org/patch/10671457/ Signed-off-by: Vivek Gautam <[email protected]> Acked-by: Stanimir Varbanov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: venus: Support V4L2 QP parameters in Venus encoderKelvin Lawson1-0/+19
Support V4L2 QP parameters in Venus encoder: * V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP * V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP * V4L2_CID_MPEG_VIDEO_H264_MIN_QP * V4L2_CID_MPEG_VIDEO_H264_MAX_QP Signed-off-by: Kelvin Lawson <[email protected]> Acked-by: Stanimir Varbanov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: v4l2-ioctl: Zero v4l2_plane_pix_format reserved fieldsEzequiel Garcia1-0/+10
Make the core set the reserved fields to zero in vv4l2_pix_format_mplane.4l2_plane_pix_format, for _MPLANE queue types. Moving this to the core avoids having to do so in each and every driver. Suggested-by: Tomasz Figa <[email protected]> Signed-off-by: Ezequiel Garcia <[email protected]> Acked-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: marvell-ccic: trivial fix to the datasheet URLLubomir Rintel1-1/+1
Update URL. Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: MAINTAINERS: Change Todor Tomov's email addressTodor Tomov1-1/+1
My Linaro email address with be inactive very soon so switch it to my Gmail address. Signed-off-by: Todor Tomov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: cedrus: Remove global IRQ spin lock from the driverPaul Kocialkowski5-29/+1
We initially introduced a spin lock to ensure that the VPU registers are not accessed concurrently between our setup function and IRQ handler. The V4L2 M2M API ensures that only one decoding job runs at a time, so the interrupt signaling the end of decoding will not occur while the next picture is being configured. Spurious interrupts are taken care of in the handler, by checking that we have a valid M2M context and a decoding status available before marking the buffers as done. In addition, holding a spin lock could be problematic if non-atomic operations are required in the setup process for future codec support. As a result, remove the global IRQ spin lock. Signed-off-by: Paul Kocialkowski <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: sun6i: fix spelling mistake "droped" -> "dropped"Colin Ian King1-2/+2
There are spelling mistakes in dev_dbg messages, fix them. Signed-off-by: Colin Ian King <[email protected]> Acked-by: Maxime Ripard <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: pvrusb2: fix spelling mistake "statuss" -> "status"Colin Ian King1-1/+1
There is a spelling mistake in a pvr2_trace trace message, fix it. Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: coda: fix H.264 deblocking filter controlsPhilipp Zabel4-22/+20
Add support for the third loop filter mode V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY, and fix V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA and V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA controls. The filter offset controls are signed values in the -6 to 6 range and are stored into the slice header fields slice_alpha_c0_offset_div2 and slice_beta_offset_div2. The actual filter offsets FilterOffsetA/B are double their value, in range of -12 to 12. Rename variables to more closely match the nomenclature in the H.264 specification. Signed-off-by: Philipp Zabel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: v4l2: clarify H.264 loop filter offset controlsPhilipp Zabel1-0/+6
The venus and s5p-mfc drivers add the loop filter alpha/beta offset controls V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA/BETA with a range of -6 to +6, inclusive. This is exactly the range specified for the slice header fields slice_alpha_c0_offset_div2 and slice_beta_offset_div2, which store half the actual filter offsets FilterOffsetA/B. Clarify that this control contains the halved offsets. Signed-off-by: Philipp Zabel <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: staging: tegra-vde: Replace debug messages with trace pointsDmitry Osipenko2-95/+220
Trace points are much more efficient than debug messages for intensive tracing and could be conveniently enabled / disabled dynamically, hence let's replace debug messages with the trace points. This also makes code a bit cleaner. Signed-off-by: Dmitry Osipenko <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: venus: add support for key frameMalathi Gottam1-1/+18
When client requests for a keyframe, set the property to hardware to generate the sync frame. Signed-off-by: Malathi Gottam <[email protected]> Acked-by: Tomasz Figa <[email protected]> Acked-by: Stanimir Varbanov <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: lmedm04: Move interrupt buffer to priv buffer.Malcolm Priestley1-19/+9
Interrupt is always present throughout life time of driver and there is no dma element move this buffer to private area of driver. Signed-off-by: Malcolm Priestley <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-07media: lmedm04: Add missing usb_free_urb to free interrupt urb.Malcolm Priestley1-0/+1
The interrupt urb is killed but never freed add the function Signed-off-by: Malcolm Priestley <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: stkwebcam: Bugfix for wrong return valuesAndreas Pape1-1/+5
usb_control_msg returns in case of a successfully sent message the number of sent bytes as a positive number. Don't use this value as a return value for stk_camera_read_reg, as a non-zero return value is used as an error condition in some cases when stk_camera_read_reg is called. Signed-off-by: Andreas Pape <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: stkwebcam: Support for ASUS A6VM notebook added.Andreas Pape1-0/+7
The ASUS A6VM notebook has a built in stk11xx webcam which is mounted in a way that the video is vertically and horizontally flipped. Therefore this notebook is added to the special handling in the driver to automatically flip the video into the correct orientation. Signed-off-by: Andreas Pape <[email protected]> Reviewed-by: Kieran Bingham <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: rockchip/vpu: fix a few alignmentsMauro Carvalho Chehab2-4/+4
As reported by checkpatch.pl, some function calls have a wrong alignment. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: add Rockchip VPU JPEG encoder driverEzequiel Garcia19-0/+3454
Add a mem2mem driver for the VPU available on Rockchip SoCs. Currently only JPEG encoding is supported, for RK3399 and RK3288 platforms. Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> [[email protected]: fix checkpatch.pl alignment warning] Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: dt-bindings: Document the Rockchip VPU bindingsEzequiel Garcia1-0/+29
Add devicetree binding documentation for Rockchip Video Processing Unit IP. Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Ezequiel Garcia <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05Merge commit '0072a0c14d5b7cb72c611d396f143f5dcd73ebe2' into patchworkMauro Carvalho Chehab1088-6591/+12783
Merge from Upstream after the latest media fixes branch, because we need one patch that it is there. * commit '0072a0c14d5b7cb72c611d396f143f5dcd73ebe2': (1108 commits) ide: Change to use DEFINE_SHOW_ATTRIBUTE macro ide: pmac: add of_node_put() drivers/tty: add missing of_node_put() drivers/sbus/char: add of_node_put() sbus: char: add of_node_put() Linux 4.20-rc5 PCI: Fix incorrect value returned from pcie_get_speed_cap() MAINTAINERS: Update linux-mips mailing list address ocfs2: fix potential use after free mm/khugepaged: fix the xas_create_range() error path mm/khugepaged: collapse_shmem() do not crash on Compound mm/khugepaged: collapse_shmem() without freezing new_page mm/khugepaged: minor reorderings in collapse_shmem() mm/khugepaged: collapse_shmem() remember to clear holes mm/khugepaged: fix crashes due to misaccounted holes mm/khugepaged: collapse_shmem() stop if punched or truncated mm/huge_memory: fix lockdep complaint on 32-bit i_size_read() mm/huge_memory: splitting set mapping+index before unfreeze mm/huge_memory: rename freeze_page() to unmap_page() initramfs: clean old path before creating a hardlink ...
2018-12-05media: pixfmt-meta-d4xx.rst: Add a license to itMauro Carvalho Chehab1-1/+8
This file is a recent addition to media docs, and it is now the only one without any license. While the best is to dual-license with GFDL and GPL, it is, at least, compatible with GFDL, as this is a requirement to be part of the media uAPI docs. So, add such license to it. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: docs: brainless mass add SPDX headers to all media filesMauro Carvalho Chehab117-0/+234
All Documentation files outside the uAPI are all licensed with, at least, GPL 2.0. So, mark them as such. The ondes at media/uapi are at least GFDL 1.1+. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: svg files: dual-licence some files with GPL and GFDLMauro Carvalho Chehab6-42/+144
Along the time, several image files got replaced by me by new ones with similar contents. As those were not simple conversions, dual-license them. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: add SPDX header to media uAPI filesMauro Carvalho Chehab413-11/+3732
All those files are under GFDL 1.1 or later, with no invariant sections. Tag them as such. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: remove text encoding from rst filesMauro Carvalho Chehab393-783/+0
This is not needed there. Also, the same UTF-8 encoding should be used on all documents. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: Documentation/media: uapi: Explicitly say there are no Invariant SectionsBen Hutchings1-3/+3
The GNU Free Documentation License allows for a work to specify Invariant Sections that are not allowed to be modified. (Debian considers that this makes such works non-free.) The Linux Media Infrastructure userspace API documentation does not specify any such sections, but it also doesn't say there are none (as is recommended by the license text). Make it explicit that there are none. Signed-off-by: Aaro Koskinen <[email protected]> Signed-off-by: Ben Hutchings <[email protected]> Signed-off-by: Gerd Hoffmann <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Johannes Stezenbach <[email protected]> Signed-off-by: Laurent Pinchart <[email protected]> Signed-off-by: Marcus Metzler <[email protected]> Signed-off-by: Michael Ira Krufky <[email protected]> Signed-off-by: Ralph Metzler <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Sean Young <[email protected]> Signed-off-by: Sylwester Nawrocki <[email protected]> Cc: Thomas Gleixner <[email protected]> Cc: Kate Stewart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: vicodec: Change variable namesDafna Hirschfeld1-46/+48
Change variables names in vicodec-core.c to *_src *_dst to improve readability Signed-off-by: Dafna Hirschfeld <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: v4l2: async: remove locking when initializing async notifierNiklas Söderlund1-4/+0
There is no need to hold the list_lock when initializing the local asd_list of a notifier. Remove the lock handling to simplify the code and remove a potential LOCKDEP warning. Signed-off-by: Niklas Söderlund <[email protected]> Reported-by: Jacopo Mondi <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Remove duplicate auto-exposure setupMaxime Ripard1-1/+1
The autoexposure setup in the 1080p init array is redundant with the default value of the sensor. Remove it. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Add 60 fps supportMaxime Ripard1-4/+16
Now that we have everything in place to compute the clock rate at runtime, we can enable the 60fps framerate for the mode we tested it with. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Make the FPS clamping / rounding more extendableMaxime Ripard1-12/+15
The current code uses an algorithm to clamp the FPS values and round them to the closest supported one that isn't really allows to be extended to more than two values. Rework it a bit to make it much easier to extend the amount of FPS options we support. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Make the return rate type more explicitMaxime Ripard1-4/+4
In the ov5640_try_frame_interval function, the ret variable actually holds the frame rate index to use, which is represented by the enum ov5640_frame_rate in the driver. Make it more obvious. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Enhance FPS handlingMaxime Ripard1-255/+51
Now that we have moved the clock generation logic out of the bytes array, these arrays are identical between the 15fps and 30fps variants. Remove the duplicate entries, and convert the code accordingly. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Remove pixel clock ratesMaxime Ripard1-20/+1
The pixel clock rates were introduced to report the initially static clock rate. Since this is now handled dynamically, we can remove them entirely. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Compute the clock rate at runtimeMaxime Ripard1-1/+2
The clock rate, while hardcoded until now, is actually a function of the resolution, framerate and bytes per pixel. Now that we have an algorithm to adjust our clock rate, we can select it dynamically when we change the mode. This changes a bit the clock rate being used, with the following effect: +------+------+------+------+-----+-----------------+----------------+-----------+ | Hact | Vact | Htot | Vtot | FPS | Hardcoded clock | Computed clock | Deviation | +------+------+------+------+-----+-----------------+----------------+-----------+ | 640 | 480 | 1896 | 1080 | 15 | 56000000 | 61430400 | 8.84 % | | 640 | 480 | 1896 | 1080 | 30 | 112000000 | 122860800 | 8.84 % | | 1024 | 768 | 1896 | 1080 | 15 | 56000000 | 61430400 | 8.84 % | | 1024 | 768 | 1896 | 1080 | 30 | 112000000 | 122860800 | 8.84 % | | 320 | 240 | 1896 | 984 | 15 | 56000000 | 55969920 | 0.05 % | | 320 | 240 | 1896 | 984 | 30 | 112000000 | 111939840 | 0.05 % | | 176 | 144 | 1896 | 984 | 15 | 56000000 | 55969920 | 0.05 % | | 176 | 144 | 1896 | 984 | 30 | 112000000 | 111939840 | 0.05 % | | 720 | 480 | 1896 | 984 | 15 | 56000000 | 55969920 | 0.05 % | | 720 | 480 | 1896 | 984 | 30 | 112000000 | 111939840 | 0.05 % | | 720 | 576 | 1896 | 984 | 15 | 56000000 | 55969920 | 0.05 % | | 720 | 576 | 1896 | 984 | 30 | 112000000 | 111939840 | 0.05 % | | 1280 | 720 | 1892 | 740 | 15 | 42000000 | 42002400 | 0.01 % | | 1280 | 720 | 1892 | 740 | 30 | 84000000 | 84004800 | 0.01 % | | 1920 | 1080 | 2500 | 1120 | 15 | 84000000 | 84000000 | 0.00 % | | 1920 | 1080 | 2500 | 1120 | 30 | 168000000 | 168000000 | 0.00 % | | 2592 | 1944 | 2844 | 1944 | 15 | 84000000 | 165862080 | 49.36 % | +------+------+------+------+-----+-----------------+----------------+-----------+ Only the 640x480, 1024x768 and 2592x1944 modes are significantly affected by the new formula. In this case, 640x480 and 1024x768 are actually fixed by this change. Indeed, the sensor was sending data at, for example, 27.33fps instead of 30fps. This is -9%, which is roughly what we're seeing in the array. Testing these modes with the new clock setup actually fix that error, and data are now sent at around 30fps. 2592x1944, on the other hand, is probably due to the fact that this mode can only be used using MIPI-CSI2, in a two lane mode, and never really tested with a DVP bus. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Remove redundant register setupMaxime Ripard1-10/+0
The MIPI divider is also cleared as part of the clock setup sequence, so we can remove that code. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Remove redundant definesMaxime Ripard1-5/+2
The OV5640_SCLK2X_ROOT_DIVIDER_DEFAULT and OV5640_SCLK_ROOT_DIVIDER_DEFAULT defines represent exactly the same setup, and are at the same value, than the more consistent with the rest of the driver OV5640_SCLK2X_ROOT_DIV and OV5640_SCLK_ROOT_DIV. Remove them. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Remove the clocks registers initializationMaxime Ripard1-24/+22
Part of the hardcoded initialization sequence is to set up the proper clock dividers. However, this is now done dynamically through proper code and as such, the static one is now redundant. Let's remove it. Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Adjust the clock based on the expected rateMaxime Ripard1-1/+364
The clock structure for the PCLK is quite obscure in the documentation, and was hardcoded through the bytes array of each and every mode. This is troublesome, since we cannot adjust it at runtime based on other parameters (such as the number of bytes per pixel), and we can't support either framerates that have not been used by the various vendors, since we don't have the needed initialization sequence. We can however understand how the clock tree works, and then implement some functions to derive the various parameters from a given rate. And now that those parameters are calculated at runtime, we can remove them from the initialization sequence. The modes also gained a new parameter which is the clock that they are running at, from the register writes they were doing, so for now the switch to the new algorithm should be transparent. Co-Developed-by: Jacopo Mondi <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6dq Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: ov5640: Fix set format regressionJacopo Mondi1-9/+8
The set_fmt operations updates the sensor format only when the image format is changed. When only the image sizes gets changed, the format do not get updated causing the sensor to always report the one that was previously in use. Without this patch, updating frame size only fails: [fmt:UYVY8_2X8/640x480@1/30 field:none colorspace:srgb xfer:srgb ...] With this patch applied: [fmt:UYVY8_2X8/1024x768@1/30 field:none colorspace:srgb xfer:srgb ...] Fixes: 6949d864776e ("media: ov5640: do not change mode if format or frame interval is unchanged") Signed-off-by: Jacopo Mondi <[email protected]> Signed-off-by: Maxime Ripard <[email protected]> Tested-by: Adam Ford <[email protected]> #imx6 w/ CSI2 interface on 4.19.6 and 4.20-RC5 Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: mt9m111: allow to setup pixclk polarityEnrico Scholz2-1/+44
The chip can be configured to output data transitions on the rising or falling edge of PIXCLK (Datasheet R58:1[9]), default is on the falling edge. Parsing the fw-node is made in a subfunction to bundle all (future) dt-parsing / fw-parsing stuff. [[email protected]: Fix inverting clock. INV_PIX_CLOCK bit is set per default. Set bit to 0 (enable mask bit without value) to enable falling edge sampling.] [[email protected]: use fwnode helpers] [[email protected]: mv fw parsing into own function] [[email protected]: adapt commit msg] [[email protected]: V4L2 API usage changes to compile on media tree master] Signed-off-by: Enrico Scholz <[email protected]> Signed-off-by: Michael Grzeschik <[email protected]> Signed-off-by: Marco Felsch <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: dt-bindings: media: mt9m111: add pclk-sample propertyMarco Felsch1-0/+5
Add the pclk-sample property to the list of optional properties for the mt9m111 camera sensor. Signed-off-by: Marco Felsch <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: dt-bindings: media: mt9m111: adapt documentation to be more clearMarco Felsch1-4/+4
Replace the vague binding by a more verbose. Remove the remote property from the example since the driver don't support such a property. Also remove the bus-width property from the endpoint since the driver don't take care of it. Signed-off-by: Marco Felsch <[email protected]> Reviewed-by: Rob Herring <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: mt9m111: add support to select formats and fps for {Q,SXGA}Michael Grzeschik1-0/+165
This patch implements the framerate selection using the skipping and readout power-modi features. The power-modi cut the framerate by half and each context has an independent selection bit. The same applies to the 2x skipping feature. Signed-off-by: Michael Grzeschik <[email protected]> Signed-off-by: Marco Felsch <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: mt9m111: add streaming check to set_fmtMichael Grzeschik1-0/+3
Currently set_fmt don't care about the streaming status, so the format can be changed during streaming. This can lead into wrong behaviours. Check if the device is already streaming and return -EBUSY to avoid wrong behaviours. Signed-off-by: Michael Grzeschik <[email protected]> Signed-off-by: Marco Felsch <[email protected]> Reviewed-by: Philipp Zabel <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2018-12-05media: mt9m111: add s_stream callbackMarco Felsch1-0/+10
Add callback to check if we are already streaming. Now other callbacks can check the state and return -EBUSY if we already streaming. Signed-off-by: Marco Felsch <[email protected]> Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>