summaryrefslogtreecommitdiff
path: root/drivers/media/platform
AgeCommit message (Collapse)AuthorFilesLines
2017-02-28scripts/spelling.txt: add "aligment" pattern and fix typo instancesMasahiro Yamada1-1/+1
Fix typos and add the following to the scripts/spelling.txt: aligment||alignment I did not touch the "N_BYTE_ALIGMENT" macro in drivers/net/wireless/realtek/rtlwifi/wifi.h to avoid unpredictable impact. I fixed "_aligment_handler" in arch/openrisc/kernel/entry.S because it is surrounded by #if 0 ... #endif. It is surely safe and I confirmed "_alignment_handler" is correct. I also fixed the "controler" I found in the same hunk in arch/openrisc/kernel/head.S. Link: http://lkml.kernel.org/r/1481573103-11329-8-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-02-08[media] mtk-vcodec: fix build warnings without DEBUGMinghsiu Tsai3-11/+7
After removing DEBUG from mtk_vcodec_util.h, some build warnings are generated as the following: .../drivers/media/platform/mtk-vcodec/vdec_vpu_if.c: In function 'vcodec_vpu_send_msg': .../drivers/media/platform/mtk-vcodec/vdec_vpu_if.c:73:11: warning: unused variable 'msg_id' [-Wunused-variable] uint32_t msg_id = *(uint32_t *)msg; ^ .../drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c: In function 'vb2ops_vdec_buf_queue': .../drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c:1129:7: warning: unused variable 'log_level' [-Wunused-variable] int log_level = ret ? 0 : 1; ^ .../drivers/media/platform/mtk-vcodec/venc_vpu_if.c: In function 'vpu_enc_send_msg': .../drivers/media/platform/mtk-vcodec/venc_vpu_if.c:82:12: warning: unused variable 'msg_id' [-Wunused-variable] uint32_t msg_id = *(uint32_t *)msg; ^ It is because mtk_vcodec_debug() and mtk_vcodec_err() are defined as empty macros. Without DEBUG definition, the variable for debugging is not used anymore. Fixing build warnings by moving the assignment of the variable to the argument of mtk_vcodec_debug() and mtk_vcodec_err(). Within the patch, build pass with/without DEBUG definition, and functions still work fine. Signed-off-by: Minghsiu Tsai <minghsiu.tsai@mediatek.com> Reviewed-by: Daniel Kurtz <djkurtz@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] media: exynos4-is: add flags to dummy Exynos IS i2c adapterMarek Szyprowski1-1/+8
Add simple 'functionality' member to dummy Exynos IS i2c adapter to make i2c core happy and get rid of NULL pointer dereference during Exynos4 IS probe since v4.10-rc1: Unable to handle kernel NULL pointer dereference at virtual address 00000000 pgd = c0004000 [00000000] *pgd=00000000 Internal error: Oops: 80000005 [#1] PREEMPT SMP ARM Modules linked in: CPU: 1 PID: 100 Comm: kworker/1:2 Not tainted 4.10.0-rc6-next-20170131-00054-g39e6e4233de6 #1921 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) Workqueue: events deferred_probe_work_func task: ef2e0000 task.stack: ef2ec000 PC is at 0x0 LR is at i2c_register_adapter+0x98/0x5cc ... [<c05040bc>] (i2c_register_adapter) from [<c05379d4>] (fimc_is_i2c_probe+0x84/0xe4) [<c05379d4>] (fimc_is_i2c_probe) from [<c041b5c8>] (platform_drv_probe+0x50/0xb0) [<c041b5c8>] (platform_drv_probe) from [<c0419f48>] (driver_probe_device+0x234/0x2dc) [<c0419f48>] (driver_probe_device) from [<c04184e0>] (bus_for_each_drv+0x44/0x8c) [<c04184e0>] (bus_for_each_drv) from [<c0419c8c>] (__device_attach+0x9c/0x100) [<c0419c8c>] (__device_attach) from [<c0419374>] (bus_probe_device+0x84/0x8c) [<c0419374>] (bus_probe_device) from [<c04178d4>] (device_add+0x380/0x528) [<c04178d4>] (device_add) from [<c05aceb4>] (of_platform_device_create_pdata+0x70/0xa4) [<c05aceb4>] (of_platform_device_create_pdata) from [<c05acfd4>] (of_platform_bus_create+0xec/0x320) [<c05acfd4>] (of_platform_bus_create) from [<c05ad264>] (of_platform_populate+0x5c/0xac) [<c05ad264>] (of_platform_populate) from [<c0533420>] (fimc_is_probe+0x1c0/0x4cc) [<c0533420>] (fimc_is_probe) from [<c041b5c8>] (platform_drv_probe+0x50/0xb0) [<c041b5c8>] (platform_drv_probe) from [<c0419f48>] (driver_probe_device+0x234/0x2dc) [<c0419f48>] (driver_probe_device) from [<c04184e0>] (bus_for_each_drv+0x44/0x8c) [<c04184e0>] (bus_for_each_drv) from [<c0419c8c>] (__device_attach+0x9c/0x100) [<c0419c8c>] (__device_attach) from [<c0419374>] (bus_probe_device+0x84/0x8c) [<c0419374>] (bus_probe_device) from [<c04197a8>] (deferred_probe_work_func+0x60/0x8c) [<c04197a8>] (deferred_probe_work_func) from [<c01329a4>] (process_one_work+0x120/0x31c) [<c01329a4>] (process_one_work) from [<c0132bc8>] (process_scheduled_works+0x28/0x38) [<c0132bc8>] (process_scheduled_works) from [<c0132ddc>] (worker_thread+0x204/0x4ac) [<c0132ddc>] (worker_thread) from [<c01381b8>] (kthread+0xfc/0x134) [<c01381b8>] (kthread) from [<c01078b8>] (ret_from_fork+0x14/0x3c) Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] coda/imx-vdoa: constify structsMauro Carvalho Chehab1-2/+2
As warned by checkpatch: WARNING: struct of_device_id should normally be const #318: FILE: drivers/media/platform/coda/imx-vdoa.c:318: +static struct of_device_id vdoa_dt_ids[] = { So, constify structs. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] st-delta: debug: trace stream/frame information & summaryHugues Fruchet4-5/+117
Adds some trace points showing input compressed stream or output decoded frame information. Adds an unconditional trace point when streaming starts showing the compressed stream and the decoded frame information. Adds an unconditional trace point at instance closure summarizing into a single line the decoding process (stream information, decoded and output frames number, potential errors observed). Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] st-delta: add mjpeg supportHugues Fruchet8-1/+885
Adds support of DELTA MJPEG video decoder back-end, implemented by calling JPEG_DECODER_HW0 firmware using RPMSG IPC communication layer. Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] st-delta: EOS (End Of Stream) supportHugues Fruchet2-1/+168
EOS (End Of Stream) support allows user to get all the potential decoded frames remaining in decoder pipeline after having reached the end of video bitstream. To do so, user calls VIDIOC_DECODER_CMD(V4L2_DEC_CMD_STOP) which will drain the decoder and get the drained frames that are then returned to user. User is informed of EOS completion in two ways: - dequeue of an empty frame flagged to V4L2_BUF_FLAG_LAST - reception of a V4L2_EVENT_EOS event. If, unfortunately, no buffer is available on CAPTURE queue to return the empty frame, EOS is delayed till user queue one CAPTURE buffer. Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] st-delta: rpmsg ipc supportHugues Fruchet6-1/+704
IPC (Inter Process Communication) support for communication with DELTA coprocessor firmware using rpmsg kernel framework. Based on 4 services open/set_stream/decode/close and their associated rpmsg messages. The messages structures are duplicated on both host and firmware side and are packed (use only of 32 bits size fields in messages structures to ensure packing). Each service is synchronous; service returns only when firmware acknowledges the associated command message. Due to significant parameters size exchanged from host to copro, parameters are not inserted in rpmsg messages. Instead, parameters are stored in physical memory shared between host and coprocessor. Memory is non-cacheable, so no special operation is required to ensure memory coherency on host and on coprocessor side. Multi-instance support and re-entrance are ensured using host_hdl and copro_hdl in message header exchanged between both host and coprocessor. This avoids to manage tables on both sides to get back the running context of each instance. Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] st-delta: add memory allocator helper functionsHugues Fruchet4-1/+74
Helper functions used by decoder back-ends to allocate physically contiguous memory required by hardware video decoder. Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-08[media] st-delta: STiH4xx multi-format video decoder v4l2 driverHugues Fruchet6-0/+2420
This V4L2 driver enables DELTA multi-format video decoder of STMicroelectronics STiH4xx SoC series. Acked-by: Peter Griffin <peter.griffin@linaro.org> Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] exynos-gsc: Avoid spamming the log on VIDIOC_TRY_FMTJavier Martinez Canillas1-1/+1
There isn't an ioctl to enum the supported field orders, so a user-space application can call VIDIOC_TRY_FMT using different field orders to know if one is supported. For example, GStreamer does this so during playback dozens of the following messages appear in the kernel log buffer: [ 442.143393] Not supported field order(4) Instead of printing this as an error, just keep it as debug information. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] exynos4-is: Add missing 'of_node_put'Christophe JAILLET1-1/+3
It is likely that a "of_node_put(ep)" is missing here. There is one in the previous error handling code, and one a few lines below in the normal case as well. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] coda: add Freescale firmware compatibility locationBaruch Siach2-1/+5
The Freescale provided imx-vpu looks for firmware files under /lib/firmware/vpu by default. Make coda look there for firmware files to ease the update path. Cc: Fabio Estevam <festevam@gmail.com> Signed-off-by: Baruch Siach <baruch@tkos.co.il> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] v4l: rcar_fdp1: use %4.4s to format a 4-byte stringNicolas Iooss1-2/+2
Using %4s to format f->fmt.pix_mp.pixelformat in fdp1_try_fmt() and fdp1_s_fmt() may lead to more characters being printed (when the byte following field pixelformat is not zero). Add ".4" to the format specifier to limit the number of printed characters to four. The resulting format specifier "%4.4s" is also used by other media drivers to print pixelformat value. Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Reviewed-by: Kieran Bingham <kieran@bingham.xyz> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] media: platform: s3c-camif: constify v4l2_subdev_ops structuresBhumika Goyal1-1/+1
Check for v4l2_subdev_ops structures that are only passed as an argument to the function v4l2_subdev_init. This argument is of type const, so v4l2_subdev_ops structures having this property can also be declared const. Done using Coccinelle: @r1 disable optional_qualifier @ identifier i; position p; @@ static struct v4l2_subdev_ops i@p = {...}; @ok1@ identifier r1.i; position p; @@ v4l2_subdev_init(...,&i@p) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct v4l2_subdev_ops i; File size before: text data bss dec hex filename 17171 1912 20 19103 4a9f platform/s3c-camif/camif-capture.o File size after: text data bss dec hex filename 17235 1848 20 19103 4a9f platform/s3c-camif/camif-capture.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] v4l: vsp1: Add VIDIOC_EXPBUF supportLaurent Pinchart1-0/+1
Use the vb2 ioctl handler directly. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] media: platform: xilinx: xilinx-tpg: constify v4l2_subdev_* structuresBhumika Goyal1-4/+4
v4l2_subdev_{core/pad/video}_ops structures are stored in the fields of the v4l2_subdev_ops structure which are of type const. Also, v4l2_subdev_ops structure is passed to a function having its argument of type const. As these structures are never modified, so declare them as const. Done using Coccinelle: (One of the scripts used) @r1 disable optional_qualifier @ identifier i; position p; @@ static struct v4l2_subdev_video_ops i@p = {...}; @ok1@ identifier r1.i; position p; struct v4l2_subdev_ops obj; @@ obj.video=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct v4l2_subdev_video_ops i; File size before: text data bss dec hex filename 6170 2752 144 9066 236a media/platform/xilinx/xilinx-tpg.o File size after: text data bss dec hex filename 6666 2384 8 9058 2362 media/platform/xilinx/xilinx-tpg.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] media: platform: sti: return -ENOMEM on errorsPan Bian1-1/+1
Function bdisp_debugfs_create() returns 0 even on errors. So its caller cannot detect the errors. It may be better to return "-ENOMEM" on the exception paths. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=188801 Signed-off-by: Pan Bian <bianpan2016@163.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] mtk-vcodec: use V4L2_DEC_CMD_STOP to implement flushTiffany Lin3-50/+117
Also remove the code using size-0 OUTPUT buffer to flush. Signed-off-by: Tiffany Lin <tiffany.lin@mediatek.com> Signed-off-by: Wu-Cheng Li <wuchengli@chromium.org> Reviewed-by: Kuang-che Wu <kcwu@chromium.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] media: ti-vpe: vpdma: fix a timeout loopDan Carpenter1-1/+1
The check assumes that we end on zero but actually we end on -1. Change the post-op to a pre-op so that we do end on zero. Techinically now we only loop 499 times instead of 500 but that's fine. Fixes: dc12b124353b ("[media] media: ti-vpe: vpdma: Add abort channel desc and cleanup APIs") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-02-03[media] Staging: media: platform: davinci: - Fix for memory leakShailendra Verma1-0/+2
Fix to avoid possible memory leak if the decoder initialization got failed. Free the allocated memory for file handle object before return in case decoder initialization fails. Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] st-hva: hva_dbg_summary() should be staticMauro Carvalho Chehab1-1/+1
As reported by gcc: drivers/media/platform/sti/hva/hva-v4l2.c:227:6: warning: no previous prototype for 'hva_dbg_summary' [-Wmissing-prototypes] void hva_dbg_summary(struct hva_ctx *ctx) ^~~~~~~~~~~~~~~ This function is used only internally, so make it static. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] st-hva: add debug file systemJean-Christophe Trotin7-3/+594
This patch creates 4 static debugfs entries to dump: - the device-related information ("st-hva/device") - the list of registered encoders ("st-hva/encoders") - the current values of the hva registers ("st-hva/regs") - the information about the last closed instance ("st-hva/last") It also creates dynamically a debugfs entry for each opened instance, ("st-hva/<instance identifier>") to dump: - the information about the frame (format, resolution) - the information about the stream (format, profile, level, resolution) - the control parameters (bitrate mode, framerate, GOP size...) - the potential (system, encoding...) errors - the performance information about the encoding (HW processing duration, average bitrate, average framerate...) Each time a running instance is closed, its context (including the debug information) is saved to feed, on demand, the last closed instance debugfs entry. Signed-off-by: Yannick Fertre <yannick.fertre@st.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] st-hva: encoding summary at instance releaseJean-Christophe Trotin5-11/+62
This patch adds a short summary about the encoding operation at each instance closing, for debug purpose (through dev_dbg()): - information about the frame (format, resolution) - information about the stream (format, profile, level, resolution) - number of encoded frames - potential (system, encoding...) errors Signed-off-by: Yannick Fertre <yannick.fertre@st.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Jean-Christophe Trotin <jean-christophe.trotin@st.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31Revert "[media] coda/imx-vdoa: constify structs"Mauro Carvalho Chehab1-2/+2
Despite checkpatch comments, it seems that ARM doesn't like to use constified structs. As reported by kernel build robot: In file included from drivers/media/platform/coda/imx-vdoa.c:22:0: drivers/media/platform/coda/imx-vdoa.c: In function 'vdoa_driver_init': >> include/linux/device.h:1461:20: warning: passing argument 1 of '__platform_driver_register' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] return __register(&(__driver) , ##__VA_ARGS__); \ ^ include/linux/platform_device.h:198:29: note: in definition of macro 'platform_driver_register' __platform_driver_register(drv, THIS_MODULE) ^~~ include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^~~~~~~~~~~~~ >> drivers/media/platform/coda/imx-vdoa.c:333:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(vdoa_driver); ^~~~~~~~~~~~~~~~~~~~~~ include/linux/platform_device.h:199:12: note: expected 'struct platform_driver *' but argument is of type 'const struct platform_driver *' extern int __platform_driver_register(struct platform_driver *, ^~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/media/platform/coda/imx-vdoa.c:18:0: drivers/media/platform/coda/imx-vdoa.c: In function 'vdoa_driver_exit': >> include/linux/device.h:1466:15: warning: passing argument 1 of 'platform_driver_unregister' discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers] __unregister(&(__driver) , ##__VA_ARGS__); \ ^ include/linux/platform_device.h:228:2: note: in expansion of macro 'module_driver' module_driver(__platform_driver, platform_driver_register, \ ^~~~~~~~~~~~~ >> drivers/media/platform/coda/imx-vdoa.c:333:1: note: in expansion of macro 'module_platform_driver' module_platform_driver(vdoa_driver); ^~~~~~~~~~~~~~~~~~~~~~ In file included from drivers/media/platform/coda/imx-vdoa.c:22:0: include/linux/platform_device.h:201:13: note: expected 'struct platform_driver *' but argument is of type 'const struct platform_driver *' extern void platform_driver_unregister(struct platform_driver *); ^~~~~~~~~~~~~~~~~~~~~~~~~~ So, let's just remove it. This reverts commit 126f52b02e6ec6a25f0b32058a91648304922d4a. Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] v4l: omap3isp: Clean up file handle in open() and release()Shailendra Verma1-0/+2
Both functions initialize the file handle with v4l2_fh_init() and thus need to call clean up with v4l2_fh_exit() as appropriate. Fix it. Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] exynos4-is: constify v4l2_subdev_* structuresBhumika Goyal2-6/+6
v4l2_subdev_{core/pad/video}_ops structures are stored in the fields of the v4l2_subdev_ops structure which are of type const. Also, v4l2_subdev_ops structure is passed to a function having its argument of type const. As these structures are never modified, so declare them as const. Done using Coccinelle:(one of the scripts used) @r1 disable optional_qualifier @ identifier i; position p; @@ static struct v4l2_subdev_ops i@p = {...}; @ok1@ identifier r1.i; position p; expression e1; @@ v4l2_subdev_init(e1,&i@p) @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct v4l2_subdev_ops i; File size before: text data bss dec hex filename 16830 1064 0 17894 45e6 platform/exynos4-is/fimc-capture.o 7787 704 20 8511 213f platform/exynos4-is/mipi-csis.o File size after: text data bss dec hex filename 17022 880 0 17902 45ee platform/exynos4-is/fimc-capture.o 8299 192 20 8511 213f platform/exynos4-is/mipi-csis.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] exynos4-is: fimc-is: Unmap region obtained by of_iomap()Arvind Yadav1-2/+6
Free memory mapping, if fimc_is_probe is not successful. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] exynos-gsc: Fix unbalanced pm_runtime_enable() errorJavier Martinez Canillas1-0/+1
Commit a006c04e6218 ("[media] exynos-gsc: Fixup clock management at ->remove()") changed the driver's .remove function logic to fist do a pm_runtime_get_sync() to make sure the device is powered before attempting to gate the gsc clock. But the commit also removed a pm_runtime_disable() call that leads to an unbalanced pm_runtime_enable() error if the driver is removed and re-probed: exynos-gsc 13e00000.video-scaler: Unbalanced pm_runtime_enable! exynos-gsc 13e10000.video-scaler: Unbalanced pm_runtime_enable! Fixes: a006c04e6218 ("[media] exynos-gsc: Fixup clock management at ->remove()") Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Marek Szyprowski <m.szyprowski@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] exynos-gsc: Clean up file handle in open() error pathShailendra Verma1-1/+1
The file handle is not yet added in the vfd list. So no need to call v4l2_fh_del(&ctx->fh) if it fails to create controls. Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] exynos4-is: Clean up file handle in open() error pathShailendra Verma1-1/+1
The file handle is not yet added in the vfd list. So no need to call v4l2_fh_del(&ctx->fh) if it fails to create controls. Signed-off-by: Shailendra Verma <shailendra.v@samsung.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: support YUYV output if VDOA is usedMichael Tretter2-2/+35
The VDOA is able to transform the NV12 custom macroblock tiled format of the CODA to YUYV format. If and only if the VDOA is available, the driver can also provide YUYV support. While the driver is configured to produce YUYV output, the CODA must be configured to produce NV12 macroblock tiled frames and the VDOA must transform the intermediate result into the final YUYV output. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: use VDOA for un-tiling custom macroblock formatMichael Tretter3-30/+163
If the CODA driver is configured to produce NV12 output and the VDOA is available, the VDOA can be used to transform the custom macroblock tiled format to a raster-ordered format for scanout. In this case, set the output format of the CODA to the custom macroblock tiled format, disable the rotator, and use the VDOA to write to the v4l2 buffer. The VDOA is synchronized with the CODA to always un-tile the frame that the CODA finished in the previous run. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: fix frame index to returned errorMichael Tretter1-1/+1
display_idx refers to the frame that will be returned in the next round. The currently processed frame is ctx->display_idx and errors should be reported for this frame. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: add debug output about tilingPhilipp Zabel1-2/+4
In order to make the VDOA work correctly, the CODA must produce frames in tiled format. Print this information in the debug output. Also print the color format in fourcc instead of the numeric value. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: correctly set capture compose rectanglePhilipp Zabel1-8/+29
Correctly store the rectangle of valid video data in the destination q_data before rounding up to macroblock size. This fixes the output of VIDIOC_G_SELECTION for the capture side compose rectangle. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda/imx-vdoa: constify structsMauro Carvalho Chehab1-2/+2
As warned by checkpatch: WARNING: struct of_device_id should normally be const #318: FILE: drivers/media/platform/coda/imx-vdoa.c:318: +static struct of_device_id vdoa_dt_ids[] = { So, constify structs. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: add i.MX6 VDOA driverPhilipp Zabel4-0/+400
The i.MX6 Video Data Order Adapter's (VDOA) sole purpose is to convert from a custom macroblock tiled format produced by the CODA960 decoder into linear formats that can be used for scanout. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] davinci: VPIF: add basic support for DT initKevin Hilman1-0/+9
Add basic support for initialization via DT Signed-off-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] davinci: vpif_capture: fix start/stop streaming lockingKevin Hilman2-4/+4
Video capture subdevs may be over I2C and may sleep during xfer, so we cannot do IRQ-disabled locking when calling the subdev. The IRQ-disabled locking is meant to protect the DMA queue list throughout the rest of the driver, so update the locking in [start|stop]_streaming to protect just this list, and update the irqlock comment to reflect what it actually protects. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] davinci: vpif_capture: remove hard-coded I2C adapter idKevin Hilman1-1/+4
Remove hard-coded I2C adapter in favor of getting the ID from platform_data. Signed-off-by: Kevin Hilman <khilman@baylibre.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] davinci: VPIF: fix module loading, init errorsKevin Hilman3-1/+23
Fix problems with automatic module loading by adding MODULE_ALIAS. Also fix various load-time errors cause by incorrect or not present platform_data. Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Kevin Hilman <khilman@baylibre.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] vim2m: Clean up file handle in open() error pathSantosh Kumar Singh1-0/+2
Fix to avoid possible memory leak and exit file handle in error paths. Signed-off-by: Santosh Kumar Singh <kumar.san1093@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] mtk-vcodec: use designated initializersKees Cook2-8/+8
Prepare to mark sensitive kernel structures for randomization by making sure they're using designated initializers. These were identified during allyesconfig builds of x86, arm, and arm64, with most initializer fixes extracted from grsecurity. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-30[media] am437x-vpfe: always assign bpp variableNicolas Iooss1-1/+1
In vpfe_s_fmt(), when the sensor format and the requested format were the same, bpp was assigned to vpfe->bpp without being initialized first. Grab the bpp value that is currently used by using __vpfe_get_format() instead of its wrapper, vpfe_try_fmt(). This use of uninitialized variable has been found by compiling the kernel with clang. Fixes: 417d2e507edc ("[media] media: platform: add VPFE capture driver support for AM437X") Cc: stable@vger.kernel.org Signed-off-by: Nicolas Iooss <nicolas.iooss_linux@m4x.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-30[media] vivid: Enable 4k resolution for webcam capture deviceSoren Brinkmann1-1/+4
Add 3840x2160 as valid resolution for the webcam capture input and adjust the webcam intervals accordingly. Signed-off-by: Soren Brinkmann <soren.brinkmann@xilinx.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-30[media] media: platform: soc_camera_platform : constify v4l2_subdev_* structuresBhumika Goyal1-3/+3
v4l2_subdev_{core/video}_ops structures are stored in the fields of the v4l2_subdev_ops structure which are of type const. Also, v4l2_subdev_ops structure is passed to a function having its argument of type const. As these structures are never modified, so declare them as const. Done using Coccinelle:(One of the scripts) @r1 disable optional_qualifier @ identifier i; position p; @@ static struct v4l2_subdev_core_ops i@p = {...}; @ok1@ identifier r1.i; position p; struct v4l2_subdev_ops obj; @@ obj.core=&i@p; @bad@ position p!={r1.p,ok1.p}; identifier r1.i; @@ i@p @depends on !bad disable optional_qualifier@ identifier r1.i; @@ +const struct v4l2_subdev_core_ops i; File size before: text data bss dec hex filename 858 576 0 1434 59a soc_camera/soc_camera_platform.o File size after: text data bss dec hex filename 1234 192 0 1426 592 soc_camera/soc_camera_platform.o Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-30[media] xilinx: Use a local media device pointer insteadSakari Ailus1-1/+1
The function has a local variable that points to the media device; use that instead of finding the media device under the entity. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-30[media] omap3isp: Use a local media device pointer insteadSakari Ailus1-1/+1
The function has a local variable that points to the media device; use that instead of finding the media device under the entity. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-27[media] media: Rename graph and pipeline structs and functionsSakari Ailus10-50/+50
The media_entity_pipeline_start() and media_entity_pipeline_stop() functions are renamed as media_pipeline_start() and media_pipeline_stop(), respectively. The reason is two-fold: the pipeline struct is, rightly, already called media_pipeline (rather than media_entity_pipeline) and what this really is about is a pipeline. A pipeline consists of entities --- and, well, other objects embedded in these entities. As the pipeline object will be in the future moved from entities to pads in order to support multiple pipelines through a single entity, do the renaming now. Similarly, functions operating on struct media_entity_graph as well as the struct itself are renamed by dropping the "entity_" part from the prefix of the function family and the data structure. The graph traversal which is what the functions are about is not specifically about entities only and will operate on pads for the same reason as the media pipeline. The patch has been generated using the following command: git grep -l media_entity |xargs perl -i -pe ' s/media_entity_pipeline/media_pipeline/g; s/media_entity_graph/media_graph/g' And a few manual edits related to line start alignment and line wrapping. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>