summaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)Author
2017-02-01[media] uvcvideo: Add video formats for Intel real sense F200 cameraDaniel Patrick Johnson
This patch adds video format support for Intel real sense F200 camera. Multimedia team requested me to support this. Signed-off-by: Daniel Patrick Johnson <teknotus@teknot.us> [Port from https://github.com/teknotus/depthview/tree/kernelpatchfmt] Signed-off-by: Inki Dae <inki.dae@samsung.com> Change-Id: I48de58feb46fc1a91fcee449213c03bdbbcbb905
2017-01-16Revert "Revert "[media] s4p-mfc: set allow_zero_bytesused flag for ↵Seung-Woo Kim
vb2_queue_init"" This reverts commit d5c117ccdde0b9a25161ea033364dbed479a1d55. Without allow_zero_byteused flag, during decoding the last EOS buffer with zero bytesused from userspace is not properly processed, so stream is stuck without finishing all queued buffer. Change-Id: I5725d3514885c104febb12adb44b13ae9b527817 Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14media: s5p-mfc: use clock gating only on mfc v5 hardwareMarek Szyprowski
Software clock gating causes unpredicted behavior of newer MFC hardware, so use it only when working with v5 module. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I5a636b9c46b5e387da4d1c4f6dbb4adb583085e3
2016-12-14media: s5p-mfc: use printk_ratelimited for reporting ioctl errorsMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: Ieff41f18447d59924b2cad3b27e50dbb8e36539d
2016-12-14media: s5p-mfc: don't keep clocks prepared all the timeMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I2b3a109eb9ac28e282083adf444baaef75431376
2016-12-14media: s5p-mfc: fix close sequenceMarek Szyprowski
Turn power off after disabling clocks. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: Ibd5df109f2664edea7a42fc797945bd31c11f1d2
2016-12-14[media] rc: ir-spi: add support for IR LEDs connected with SPIAndi Shyti
The ir-spi is a simple device driver which supports the connection between an IR LED and the MOSI line of an SPI device. The driver, indeed, uses the SPI framework to stream the raw data provided by userspace through a character device. The chardev is handled by the LIRC framework and its functionality basically provides: - raw write: data to be sent to the SPI and then streamed to the MOSI line; - set frequency: sets the frequency whith which the data should be sent; - set length: sets the data length. This information is optional, if the length is set, then userspace should send raw data only with that length; while if the length is set to '0', then the driver will figure out himself the length of the data based on the length of the data written on the character device. The latter is not recommended, though, as the driver, at any write, allocates and deallocates a buffer where the data from userspace are stored. The driver provides three feedback commands: - get length: reads the length set and (as mentioned), if the length is '0' it will be calculated at any write - get frequency: the driver reports the frequency. If userpace doesn't set the frequency, the driver will use a default value of 38000Hz. The character device is created under /dev/lircX name, where X is and ID assigned by the LIRC framework. Example of usage: int fd, ret; ssize_t n; uint32_t val = 0; fd = open("/dev/lirc0", O_RDWR); if (fd < 0) { fprintf(stderr, "unable to open the device\n"); return -1; } /* ioctl set frequency and length parameters */ val = 6430; ret = ioctl(fd, LIRC_SET_LENGTH, &val); if (ret < 0) fprintf(stderr, "LIRC_SET_LENGTH failed\n"); val = 608000; ret = ioctl(fd, LIRC_SET_FREQUENCY, &val); if (ret < 0) fprintf(stderr, "LIRC_SET_FREQUENCY failed\n"); /* read back length and frequency parameters */ ret = ioctl(fd, LIRC_GET_LENGTH, &val); if (ret < 0) fprintf(stderr, "LIRC_GET_LENGTH failed\n"); else fprintf(stdout, "legnth = %u\n", val); ret = ioctl(fd, LIRC_GET_FREQUENCY, &val); if (ret < 0) fprintf(stderr, "LIRC_GET_FREQUENCY failed\n"); else fprintf(stdout, "frequency = %u\n", val); /* write data to device */ n = write(fd, b, 6430); if (n < 0) { fprintf(stderr, "unable to write to the device\n"); ret = -1; } else if (n != 6430) { fprintf(stderr, "failed to write everything, wrote %ld instead\n", n); ret = -1; } else { fprintf(stdout, "written all the %ld data\n", n); } close(fd); The driver supports multi task access, but all the processes which hold the driver should use the same length and frequency parameters. Change-Id: I323d7dd4a56d6dcf48f2c695293822eb04bdb85f Signed-off-by: Andi Shyti <andi.shyti@samsung.com>
2016-12-14s5p-mfc: don't close instance after free OUTPUT buffersayaka
User-space applications can use the VIDIOC_REQBUFS ioctl to determine if a memory mapped, user pointer or DMABUF based I/O is supported by the driver. So a set of VIDIOC_REQBUFS ioctl calls will be made with count 0 and then the real VIDIOC_REQBUFS call with count == n. But for count 0, the driver not only frees the buffer but also closes the MFC instance and s5p_mfc_ctx state is set to MFCINST_FREE. The VIDIOC_REQBUFS handler for the output device checks if the s5p_mfc_ctx state is set to MFCINST_INIT (which happens on an VIDIOC_S_FMT) and fails otherwise. So after a VIDIOC_REQBUFS(n), future VIDIOC_REQBUFS(n) calls will fails unless a VIDIOC_S_FMT ioctl calls happens before the reqbufs. But applications may first set the format and then attempt to determine the I/O methods supported by the driver (for example Gstramer does it) so the state won't be set to MFCINST_INIT again and VIDIOC_REQBUFS will fail. To avoid this issue, only free the buffers on VIDIOC_REQBUFS(0) but don't close the MFC instance to allow future VIDIOC_REQBUFS(n) calls to succeed. [javier: Rewrote changelog to explain the problem more detailed] Signed-off-by: ayaka <ayaka@soulik.info> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Nicolas Dufresne <nicolas@collabora.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> [backport of mainline commit 9bd5d8696fd50a10d830e2ad7f9d4e67e0bbbae2] Signed-of-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I9bd5d8696fd50a10d830e2ad7f9d4e67e0bbbae2
2016-12-14s5p-mfc: Fix race between s5p_mfc_probe() and s5p_mfc_open()Javier Martinez Canillas
The s5p_mfc_probe() function registers the video devices before all the resources needed by s5p_mfc_open() are correctly initalized. So if s5p_mfc_open() function is called before s5p_mfc_probe() finishes (since the video dev is already registered), a NULL pointer dereference will happen due s5p_mfc_open() accessing uninitialized vars such as the struct s5p_mfc_dev .watchdog_timer and .mfc_ops fields. An example is following BUG caused by add_timer() getting a NULL pointer: [ 45.765374] kernel BUG at kernel/time/timer.c:790! [ 45.765381] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM ... [ 45.766149] [<c016fdf4>] (mod_timer) from [<bf181d18>] (s5p_mfc_open+0x274/0x4d4 [s5p_mfc]) [ 45.766416] [<bf181d18>] (s5p_mfc_open [s5p_mfc]) from [<bf0214a0>] (v4l2_open+0x9c/0x100 [videodev]) [ 45.766547] [<bf0214a0>] (v4l2_open [videodev]) from [<c01e355c>] (chrdev_open+0x9c/0x178) [ 45.766575] [<c01e355c>] (chrdev_open) from [<c01dceb4>] (do_dentry_open+0x1e0/0x300) [ 45.766595] [<c01dceb4>] (do_dentry_open) from [<c01ec2f0>] (path_openat+0x800/0x10d4) [ 45.766610] [<c01ec2f0>] (path_openat) from [<c01ed8b8>] (do_filp_open+0x5c/0xc0) [ 45.766624] [<c01ed8b8>] (do_filp_open) from [<c01de218>] (do_sys_open+0x10c/0x1bc) [ 45.766642] [<c01de218>] (do_sys_open) from [<c01078c0>] (ret_fast_syscall+0x0/0x3c) [ 45.766655] Code: eaffffe3 e3a00001 e28dd008 e8bd81f0 (e7f001f2) Fix it by registering the video devs as the last step in s5p_mfc_probe(). Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Tested-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> [backport of mainline commit 6311f1261f59ce5e51fbe5cc3b5e7737197316ac] Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: I43355e4eeaa913d3b63a41a5621a122f4771982f
2016-12-14media: s5p-mfc: fix build warningMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: Ib621db7813a80d0a775968c5fadef5f25d0a92f5
2016-12-14media: s5p-mfc: exynos5422 doesn't provide sclk clock to MFC blockMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Change-Id: Ibfe361bdff955eb446b472a5edcd0df9800c1221
2016-12-14Revert "[media] s5p-mfc: set allow_zero_bytesused flag for vb2_queue_init"Marek Szyprowski
This reverts commit e6c9dec3e7d68c477768e2955c7f8ed78a09bfd6.
2016-12-14media: s5p-jpeg: Adjust buffer size for Exynos 4412Andrzej Pietrasiewicz
Eliminate iommu fault during encoding by adjusting image size used for buffer size computation and ensuring that the buffer is not overrun. Change-Id: I4837ef4cd518732af8110725b50e8f4e1bd313a9 Signed-off-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com>
2016-12-14media: s5p-jpeg: add RGB565 format to Exynos4 buffer size workaroundMarek Szyprowski
JPEG HW can access buffer beyond the image data for images, which width or height is not properly aligned. This patch adds RGB565 format to workaround code to solve IOMMU page fault issue. The exact needed buffer enlargement workaround need to be determined experimentally. Reported-by: Inha Song <ideal.song@samsung.com> Suggested-by: Andrzej Pietrasiewicz <andrzej.p@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14fimc-is: Rename "is fail" to "failed"Sylwester Nawrocki
Let's correct these phrases before I start believing they are proper grammatical constructs... Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Add proper implementation of fimc_is_ischain_forcedown()Sylwester Nawrocki
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: MCUCTL register definition cleanupSylwester Nawrocki
Lots of (mostly unused) postfix-indexed macro definitions are now replaced with parametric definitions. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Remove unused data structure declarationSylwester Nawrocki
Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Clear all MCUCTL register in the power up sequenceSylwester Nawrocki
When the ISP, CAM{0,1} power domains are always on it is required to clear MCUCTL registers in the ISP power up sequence, otherwise the front camera is not working properly if previously the rear camera pipeline was used. The original code relied on the MCUCTL registers being reset to default values after the ISP power domain switch off/on cycle. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Reconfigure more muxes to oscclk in the power off sequenceSylwester Nawrocki
We don't switch off CAM1, CAM0, ISP power domain so reconfigure more muxes to their default after reset state duriong power off sequence. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Workaround for ACLK_CAM1_552_USER configuration issuesSylwester Nawrocki
For some reason "mout_aclk_cam1_552_user" clock reconfiguration from "oscclk" to "aclk_cam1_552" breaks the front camera operation (often only empty buffer are dequeued). But it is required for the rear camera. Until the root cause is found reconfigure the mux conditionally only for the rear sensor operation. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Fix compiler warningSylwester Nawrocki
n file included from drivers/media/platform/exynos/fimc-is/fimc-is-companion-dt.c:23:0: drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: 'struct fimc_is_core' declared inside parameter list int fimc_is_parse_children_dt(struct device *dev, struct fimc_is_core *core); ^ drivers/media/platform/exynos/fimc-is/fimc-is-dt.h:36:58: warning: its scope is only this definition or declaration, which is probably not what you want Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Add setting of vendorSpecific2[0] metadata structure fieldSylwester Nawrocki
vendorSpecific2[0] value pattern depends on the fimc-is firmware revision. Move setting up of this field to the kernel as there is all information required for this. The driver will update the field accordingly only if user space leaves it cleared. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Workaround for CLK_MOUT_ACLK_CAM1_552_USER clockSylwester Nawrocki
When CLK_MOUT_ACLK_CAM1_552_USER clock is properly defined in clk-exynos5433.c re-parenting commented out in this patch causes that only empty buffers can be dequeued from the scaler for front camera. So re-parenting is disabled for now until we can address this issue in a better way. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14vb2: Fix compilation breakage when !CONFIG_BUGLaurent Pinchart
Commit 77a3c6fd90c9 ("[media] vb2: Don't WARN when v4l2_buffer.bytesused is 0 for multiplanar buffers") uses the __WARN() macro which isn't defined when CONFIG_BUG isn't set. This introduces a compilation breakage. Fix it by using WARN_ON() instead. The commit was also broken in that it merged v1 of the patch while a new v2 version had been submitted, reviewed and acked. Fix it by incorporating the changes from v1 to v2. Fixes: 77a3c6fd90c9 ("[media] vb2: Don't WARN when v4l2_buffer.bytesused is 0 for multiplanar buffers") Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Larry Finger <Larry.Finger@lwfinger.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-12-14v4l2-ioctl: log buffer type 0 correctlyHans Verkuil
If userspace passed the invalid buffer type 0 to the kernel, then the kernel log would show 'type=(null)' since there was no string defined for type 0. Fix this. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2016-12-14fimc-is: Eliminate some BUG_ON() from fimc_is_group_buffer_finish()Sylwester Nawrocki
This prevents kernel panic caused by wrong sequences in user space. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14s5p-mfc: remove volatile attribute from MFC register addressesAndrzej Hajda
MFC register addresses are used only by writel/readl macros which already takes care of proper register accessing. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14s5p-mfc: merge together s5p_mfc_hw_call and s5p_mfc_hw_call_voidAndrzej Hajda
Both macros can be merged into one. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14s5p-mfc: use spinlock to protect MFC contextAndrzej Hajda
MFC driver uses dev->irqlock spinlock to protect queues only, but many context fields requires protection also - they can be accessed concurrently from IOCTLs and IRQ handler. The patch increases protection range of irqlock to those fields also. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14s5p-mfc: remove unnecessary callbacksAndrzej Hajda
Many version specific functions are not called by common code, so there is no need to use callbacks. Additionally some of them are not used at all, so they can be safely removed. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14s5p-mfc: make queue cleanup code commonAndrzej Hajda
Code for queue cleanup has nothing specific to hardware version. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14s5p-mfc: use one implementation of s5p_mfc_get_new_ctxAndrzej Hajda
Both version of MFC driver uses functions with the same body and name. The patch moves them to common location. It also simplifies it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14media: s5p-mfc: remove double declared temporary variableMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14media: fimc-is: fix code issues pointed by CPPTest toolMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14media: fimc-is: fix possible memory leak found by static analysisMarek Szyprowski
This patch fixes all issues pointed by Klocwork static analysis tool. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14media: s5p-mfc: set src_bufs_cnt with requested buffer for DMABUF and USERPTRSeung-Woo Kim
During start_streaming of output, it checks src_bufs_cnt compared with pb_count. But it is only meaningful for MMAP memory. So this patch fixes to set src_bufs_cnt with requested buffer for non MMAP memory. Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14s5p-mfc: use MFC_BUF_FLAG_EOS to identify last buffers in decoder capture queueAndrzej Hajda
MFC driver never delivered EOS event to apps feeding constantly its capture buffer with fresh buffers. The patch fixes it by marking last buffers returned by MFC with MFC_BUF_FLAG_EOS flag and firing EOS event on de-queuing such buffers. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14v4l2-compat-ioctl32: fix alignment for ARM64Andrzej Hajda
Alignment/padding rules on AMD64 and ARM64 differs. To allow properly match compatible ioctls on ARM64 kernels without breaking AMD64 some fields should be aligned using compat_s64 type and in one case struct should be unpacked. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14fimc-is: 6d1: add sentinel element to id tableSeung-Woo Kim
This patch adds sentinel element to id table to fix following out of bounds access: ================================================================== BUG: KASan: out of bounds access in i2c_device_match+0xcc/0xf0 at addr ffffffc00120ee80 Read of size 1 by task swapper/0/1 page:ffffffbdc0848380 count:1 mapcount:0 mapping: (null) index:0x0 flags: 0x400(reserved) page dumped because: kasan: bad access detected Address belongs to variable sensor_6d1_idt+0x20/0x40 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.0-00839-gb91c2a6-dirty #3 Hardware name: Samsung TM2 board (DT) Call trace: [<ffffffc00008bc58>] dump_backtrace+0x0/0x1d8 [<ffffffc00008be40>] show_stack+0x10/0x20 [<ffffffc000eee3a4>] dump_stack+0x80/0xd4 [<ffffffc00021e4f0>] kasan_report_error+0x3e0/0x408 [<ffffffc00021e9ec>] kasan_report+0x44/0x50 [<ffffffc00021d8f0>] __asan_load1+0x78/0x80 [<ffffffc000916b78>] i2c_device_match+0xc8/0xf0 [<ffffffc0006d9d54>] __driver_attach+0x3c/0xd0 [<ffffffc0006d6fac>] bus_for_each_dev+0xd4/0x138 [<ffffffc0006d932c>] driver_attach+0x2c/0x40 [<ffffffc0006d8dfc>] bus_add_driver+0x214/0x2e8 [<ffffffc0006dab40>] driver_register+0xb0/0x1c0 [<ffffffc000917fc0>] i2c_register_driver+0x48/0xc8 [<ffffffc001795344>] sensor_6d1_load+0x18/0x24 [<ffffffc000082ae4>] do_one_initcall+0xec/0x240 [<ffffffc001755e50>] kernel_init_freeable+0x288/0x330 [<ffffffc000eeab1c>] kernel_init+0xc/0xf0 Memory state around the buggy address: ffffffc00120ed80: 00 00 00 00 00 00 00 00 00 00 00 00 00 04 fa fa ffffffc00120ee00: fa fa fa fa 00 00 06 fa fa fa fa fa 00 00 00 00 >ffffffc00120ee80: fa fa fa fa 00 00 00 00 00 00 00 00 00 00 00 00 ^ ffffffc00120ef00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffffc00120ef80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14fimc-is: fix wrong index access for dt child nodesSeung-Woo Kim
This patch fixes wrong index access for dt child nodes. This fixes following use after free: ================================================================== BUG: KASan: use after free in fimc_is_parse_children_dt+0x6c/0xe8 at addr ffffffc08d27ffa8 Write of size 8 by task swapper/0/1 page:ffffffbdc2b49fc0 count:0 mapcount:0 mapping: (null) index:0x0 flags: 0x0() page dumped because: kasan: bad access detected CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.1.0-00839-gb91c2a6-dirty #3 Hardware name: Samsung TM2 board (DT) Call trace: [<ffffffc00008bc58>] dump_backtrace+0x0/0x1d8 [<ffffffc00008be40>] show_stack+0x10/0x20 [<ffffffc000eee3a4>] dump_stack+0x80/0xd4 [<ffffffc00021e510>] kasan_report_error+0x400/0x408 [<ffffffc00021e9ec>] kasan_report+0x44/0x50 [<ffffffc00021d38c>] __asan_store8+0x94/0xb0 [<ffffffc000991900>] fimc_is_parse_children_dt+0x68/0xe8 [<ffffffc000959368>] fimc_is_probe+0xc0/0xed8 [<ffffffc0006dc724>] platform_drv_probe+0x64/0xf8 [<ffffffc0006d9ae8>] driver_probe_device+0x1f0/0x3a8 [<ffffffc0006d9de0>] __driver_attach+0xc8/0xd0 [<ffffffc0006d6fac>] bus_for_each_dev+0xd4/0x138 [<ffffffc0006d932c>] driver_attach+0x2c/0x40 [<ffffffc0006d8dfc>] bus_add_driver+0x214/0x2e8 [<ffffffc0006dab40>] driver_register+0xb0/0x1c0 [<ffffffc0006dc618>] __platform_driver_register+0xa8/0xb8 [<ffffffc0017952c0>] fimc_is_driver_init+0x18/0x24 [<ffffffc000082ae4>] do_one_initcall+0xec/0x240 [<ffffffc001755e50>] kernel_init_freeable+0x288/0x330 [<ffffffc000eeab1c>] kernel_init+0xc/0xf0 Memory state around the buggy address: ffffffc08d27fe80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ffffffc08d27ff00: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >ffffffc08d27ff80: ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ^ ffffffc08d280000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ffffffc08d280080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ================================================================== Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14v4l2-compat-ioctl32: fix struct v4l2_event32 alignmentAndrzej Hajda
Union v4l2_event::u is aligned to 8 bytes on arm32. On arm64 v4l2_event32::u is aligned to 4 bytes. As a result structures v4l2_event and v4l2_event32 have different sizes and VIDOC_DQEVENT ioctl does not work from arm32 apps running on arm64 kernel. The patch fixes it. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14media: s5p-mfc: fix mfc context buffer sizeIngi Kim
When video file was decoded by H/W MFCv8. It occured IOMMU page fault because of accessing abnormal memory of mfc ctx buf So this patch supports buffer size of mfc context more. Relevant page fault error is below. [ 3524.617147] PAGE FAULT occurred at 0x10108000 by 11200000.sysmmu(Page table base: 0x6d86c000) [ 3524.624192] Lv1 entry: 0x6c27d001 [ 3524.627567] Lv2 entry: 0x0 [ 3524.630482] ------------[ cut here ]------------ [ 3524.635020] kernel BUG at drivers/iommu/exynos-iommu.c:358! [ 3524.640567] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM [ 3524.646373] Modules linked in: [ 3524.649410] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.0.0-00001-g0ff9b87-dirty #18 [ 3524.657117] Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) [ 3524.663184] task: c0e4aff0 ti: c0e3c000 task.ti: c0e3c000 [ 3524.668566] PC is at exynos_sysmmu_irq+0x1b8/0x2c4 [ 3524.673330] LR is at vprintk_emit+0x2b8/0x58c [ 3524.677657] pc : [<c037cc78>] lr : [<c00704a4>] psr: 600d0193 [ 3524.677657] sp : c0e3dd90 ip : 00000000 fp : c0e3ddcc [ 3524.689092] r10: ee29a110 r9 : 00000000 r8 : ee29a128 [ 3524.694292] r7 : ed812810 r6 : 10108000 r5 : ed86c000 r4 : 00000000 [ 3524.700791] r3 : c0ec9bd8 r2 : 00000000 r1 : 00000000 r0 : ed82ff00 [ 3524.707292] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment kernel [ 3524.714656] Control: 10c5387d Table: 6b08c06a DAC: 00000015 [ 3524.720375] Process swapper/0 (pid: 0, stack limit = 0xc0e3c210) [ 3524.726354] Stack: (0xc0e3dd90 to 0xc0e3e000) [ 3524.730689] dd80: c0e3dd9c c0069d68 ee58c338 6d86c000 [ 3524.738836] dda0: ee58c338 ee298c40 ee2915a0 0000003b c0e64ef4 c0e3c000 00000000 00000000 [ 3524.746981] ddc0: c0e3de14 c0e3ddd0 c0071ef4 c037cacc ffffffff a00d0193 c0e3ddf4 ee291540 [ 3524.755126] dde0: c0ec793c c0ec7928 7fffffff ee291540 ee2915a0 ee298c40 c0e64ef4 ee004660 [ 3524.763272] de00: ee010800 c0e3df00 c0e3de34 c0e3de18 c0072138 c0071e9c 00020000 ee291540 [ 3524.771418] de20: ee2915a0 00000016 c0e3de4c c0e3de38 c0075130 c00720f8 0000003b ee028300 [ 3524.779563] de40: c0e3de64 c0e3de50 c0071450 c0075068 00000100 00000012 c0e3de8c c0e3de68 [ 3524.787708] de60: c030d240 c0071420 c030d19c 00000016 00000000 00000016 00000000 00000001 [ 3524.795854] de80: c0e3dea4 c0e3de90 c0071450 c030d1a8 00000092 c0e37a1c c0e3ded4 c0e3dea8 [ 3524.804000] dea0: c0071790 c0071420 c0e3df00 f000200c 00000016 c0e440a8 c0e3df00 f0002000 [ 3524.812145] dec0: c095bc8c 00000001 c0e3defc c0e3ded8 c0008730 c0071710 c0010d88 c0010d8c [ 3524.820290] dee0: 600d0013 ffffffff c0e3df34 c0ec7eb4 c0e3df54 c0e3df00 c0014780 c00086fc [ 3524.828436] df00: 00000001 00000000 00000000 c0020780 c0e3c000 c0e43530 00000000 00000000 [ 3524.836581] df20: c0ec7eb4 c095bc8c 00000001 c0e3df54 c0e3df58 c0e3df48 c0010d88 c0010d8c [ 3524.844727] df40: 600d0013 ffffffff c0e3df94 c0e3df58 c0062690 c0010d50 c0ec75f0 00000001 [ 3524.852872] df60: c0e3df84 c0e4353c c0e39580 c0e43e84 c0e3c000 00000002 c0e3df58 c0e38b88 [ 3524.861018] df80: c0952b9c ffffffff c0e3dfac c0e3df98 c094d1b8 c00622d4 c0e3c000 c0e43e10 [ 3524.869163] dfa0: c0e3dff4 c0e3dfb0 c0d86d30 c094d130 ffffffff ffffffff c0d866f0 00000000 [ 3524.877309] dfc0: 00000000 c0df06d8 00000000 c0ee3f14 c0e434c0 c0df06d4 c0e4c20c 4000406a [ 3524.885454] dfe0: 410fc073 00000000 00000000 c0e3dff8 40008074 c0d86970 00000000 00000000 [ 3524.893610] [<c037cc78>] (exynos_sysmmu_irq) from [<c0071ef4>] (handle_irq_event_percpu+0x64/0x25c) [ 3524.902615] [<c0071ef4>] (handle_irq_event_percpu) from [<c0072138>] (handle_irq_event+0x4c/0x6c) [ 3524.911454] [<c0072138>] (handle_irq_event) from [<c0075130>] (handle_level_irq+0xd4/0x14c) [ 3524.919773] [<c0075130>] (handle_level_irq) from [<c0071450>] (generic_handle_irq+0x3c/0x4c) [ 3524.928180] [<c0071450>] (generic_handle_irq) from [<c030d240>] (combiner_handle_cascade_irq+0xa4/0x110) [ 3524.937624] [<c030d240>] (combiner_handle_cascade_irq) from [<c0071450>] (generic_handle_irq+0x3c/0x4c) [ 3524.946981] [<c0071450>] (generic_handle_irq) from [<c0071790>] (__handle_domain_irq+0x8c/0xfc) [ 3524.955646] [<c0071790>] (__handle_domain_irq) from [<c0008730>] (gic_handle_irq+0x40/0x78) [ 3524.963966] [<c0008730>] (gic_handle_irq) from [<c0014780>] (__irq_svc+0x40/0x74) [ 3524.971412] Exception stack(0xc0e3df00 to 0xc0e3df48) [ 3524.976441] df00: 00000001 00000000 00000000 c0020780 c0e3c000 c0e43530 00000000 00000000 [ 3524.984586] df20: c0ec7eb4 c095bc8c 00000001 c0e3df54 c0e3df58 c0e3df48 c0010d88 c0010d8c [ 3524.992729] df40: 600d0013 ffffffff [ 3524.996205] [<c0014780>] (__irq_svc) from [<c0010d8c>] (arch_cpu_idle+0x48/0x4c) [ 3525.003567] [<c0010d8c>] (arch_cpu_idle) from [<c0062690>] (cpu_startup_entry+0x3c8/0x4a4) [ 3525.011805] [<c0062690>] (cpu_startup_entry) from [<c094d1b8>] (rest_init+0x94/0x98) [ 3525.019516] [<c094d1b8>] (rest_init) from [<c0d86d30>] (start_kernel+0x3cc/0x3d8) [ 3525.026963] Code: e34c30ec e5932004 e3520000 ca000018 (e7f001f2) [ 3525.033028] ---[ end trace 71ed544f653b4d46 ]--- Signed-off-by: Ingi Kim <ingi2.kim@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14media: s5p-mfc: skip incomeplete frameDonghwa Lee
Currently, when incomplete frame is recieved in the middle of decoding, driver have treated it to error, so src/dst queue and clock are cleaned. Although it is obviously error case, it is need to maintain video decoding in case of necessity. This patch supports skip incomplete frame to next. Signed-off-by: Donghwa Lee <dh09.lee@samsung.com> Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
2016-12-14s5p-mfc: end-of-stream handling for newer encodersAndrzej Hajda
MFC encoder supports end-of-stream handling for encoder in version 5 of hardware. This patch adds it also for newer version. It was successfully tested on MFC-v8. Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
2016-12-14fimc-is: fixup for v4.1 rebaseMarek Szyprowski
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14fimc-is: get rid of struct v4l2_subdev_core_ops::init usageSylwester Nawrocki
init is too limited to be used in this driver, it is deprecated and usage of this callback should be removed anyway. There is no device nodes for subdevs so ioctl is no exposed to user space. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: Fix/add vidioc_querycap for several video nodesSylwester Nawrocki
This allows us to get rid of a warning from v4l2-core. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com>
2016-12-14fimc-is: fail device open when called from udevMarek Szyprowski
This workaround avoids driver state change on system boot when udev checks all video nodes. Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
2016-12-14fimc-is: Workaround to ensure proper video open sequenceSylwester Nawrocki
This a workaround to prevent system crash when video nodes are opened in random sequence during system booting. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> fimc-is: hack video node open to require companion to be opened Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>