summaryrefslogtreecommitdiff
path: root/drivers/media
AgeCommit message (Collapse)Author
2018-12-24ov5640_mipi: Revert the hackBhuvanchandra DV
Revert the hack for reset GPIO request failure. (Remove the used pins from /usr/bin/gpio-export.sh) Signed-off-by: Bhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit d826eb44e78b5103c96c3e1c28ede8ec224e5371)
2018-12-24media: Add support for ADV7280 decoder driverSanchayan Maity
Add support for ADV7280 decoder found on Toradex Analogue Camera Adapter V2.0A Signed-off-by: Sanchayan Maity <sanchayan.maity@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 481bf320816c56c726197d6155341c2f94aeb6be) (cherry picked from commit 7df8a0f4065f1085ec1765ddfc65b0106ba3faad)
2018-12-24mxc_v4l2_capture: Change error message to print on debugSanchayan Maity
Change the "unsupported ioctrl" message to print only on debug. This otherwise results in an error message ERROR: v4l2 capture: unsupported ioctrl! which does not seem to effect the gstreamer pipeline or rendering of video. >From debugging, root@apalis-imx6:~# gst-launch-1.0 imxv4l2videosrc ! imxeglvivsink Setting pipeline to PAUSED ... [ 385.174543] ERROR: v4l2 capture: unsupported ioctrl 9a091b! Pipeline is live and does not need PREROLL ... Setting pipeline to PLAYING ... New clock: GstSystemClock >From v4l2-controls.h V4L2_CTRL_CLASS_CAMERA 0x009a0000 V4L2_CID_CAMERA_CLASS_BASE V4L2_CTRL_CLASS_CAMERA | 0x900 V4L2_CID_3A_LOCK V4L2_CID_CAMERA_CLASS_BASE + 27 So the ioctrl requested seems to be V4L2_CID_3A_LOCK. "The V4L2_CID_3A_LOCK bitmask control allows applications to pause or resume the automatic exposure, focus and wite balance adjustments. It can be used, for example, to lock the 3A adjustments right before a still image is captured, for pre-focus, etc. The applications can control each of the algorithms independently, through a corresponding control bit, if driver allows that." https://patchwork.linuxtv.org/patch/10719/ Since we have no such feature available we can safely disable the error message. Signed-off-by: Sanchayan Maity <sanchayan.maity@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit f1b52e225091711d60704717af34c2f321c032b3) (cherry picked from commit 358a46afbf83035dc02d7b017088d5644ef9a74e)
2018-12-24mxc_v4l2_capture: Allow clock setting for de-interlaced video inputSanchayan Maity
Make provision for a decoder driver to specify clock mode for progressive in case the decoder provides deinterlaced output. This is required for ADV7280 decoder where we can use the hardware deinterlace capabity of ADV7280. Without setting the clock mode to progressive but having hardware deinterlace on for ADV7280 results in a non working setup. Signed-off-by: Sanchayan Maity <sanchayan.maity@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 0368155fc985c8e2bf6334fc5b56ff2ac6082908) (cherry picked from commit 80aae0b2253258df3bd056a719de3b1b1c5b223a)
2018-12-24mxc_v4l2_capture.c: make error messages uniqueMax Krummenacher
"ERROR: v4l2 capture: slave not found!" is used for many ioctl. Add the ioctl to the string to ease debugging. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit f7d5437e1c378ca8356528a3f7e5a6706463f5f7) (cherry picked from commit b28f212e0ae2f4a503cf57849417c2991ea21e9a)
2018-12-24max9526.c: move pinctrl after i2c detectMax Krummenacher
This removes a bunch of error messages during probe because both the adv7180 and the max9526 use try to reserve the same pins. While at it convert debug output to dev_dbg Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit a21e19829c50d9889a83faf00fc93be174314cdb) (cherry picked from commit 4e1e8d23e0ba899fceb3880b640c99496242af18)
2018-12-24adv7180.c: convert debug output to dev_dbgMax Krummenacher
Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 27d029fd2bf6426dd0a3cd5d62d85d4e1f6762d4) (cherry picked from commit 638f43ca3f22ab0fbad74d0f4701f499dff764cb)
2018-12-24mxc_v4l2_capture: match ipu/csi/mipi instead of only ipu/csiTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit f3ce4f51a39f0eb6727166cbdba3e92b37f237e8) (cherry picked from commit eeb0006cbf35552afa1f228040e405406cfcc384) Conflicts: drivers/media/platform/mxc/capture/mxc_v4l2_capture.c (cherry picked from commit 1ce23b64394371d77068d079452481cbb6e7480c)
2018-12-24max9526: add initial MXC camera sensor codeMax Krummenacher
Add initial support for Maxim Integrated MAX9526 video decoder for use with an Freescale i.MX 6. PAL works, NTSC does not lock on VSYNC. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 6763d5ab9496099ec2b74d3a7c2034e87a7cb70e) (cherry picked from commit b89b64b4757f5154548d5cb9706fcc08fbc43274) Conflicts: drivers/media/platform/mxc/capture/Makefile Conflicts with 3.14 headers: Change different location for include v4l2-int-device.h While at it remove unused auto variables which causes compile time warnings. (cherry picked from commit c5954c2c4fab0d4464d27711c0f60b3252a46315)
2018-12-24adv7180.c: initial working adv7180 settingsMax Krummenacher
The input channel is currently fixed to A_IN2_3 on the ACM's connector X5. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 568747f8c0984b027ca9feb1a3326fd96c4e4373) (cherry picked from commit 5715785fb37fbc289050e7ea8cb2a3b6875f6f96) (cherry picked from commit df76b16944b280e40e72b500fcff4455fae6560f)
2018-12-24mxc_v4l2_capture: let the camera driver set mipi/parallelMax Krummenacher
The camera driver knows if it uses mipi or parallel, and in case a camera can do both it makes sense that this is in the device tree node for the camera and not the generic mxc_v4l2_capture. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit 09d5f1a3ad615b96d9f01bca0622d41f20c3011b) (cherry picked from commit c8444583c7eb6a8d5124959a30ad452fb4914dae) (cherry picked from commit 518d4eeb0a0b2fadc32c9688aba220993a22b7c8)
2018-12-24MXC_CSI_CAMERA: select VIDEOBUF2_DMA_CONTIGMax Krummenacher
MXC_CSI_CAMERA links to the following functions provided by VIDEOBUF2_DMA_CONTIG, so select it explicitely to prevent link errors: ERROR: "vb2_dma_contig_cleanup_ctx" [drivers/media/platform/mxc/subdev/mx6s_capture.ko] undefined! ERROR: "vb2_dma_contig_memops" [drivers/media/platform/mxc/subdev/mx6s_capture.ko] undefined! ERROR: "vb2_dma_contig_init_ctx" [drivers/media/platform/mxc/subdev/mx6s_capture.ko] undefined! Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com> (cherry picked from commit a3ff407abf1fc9ad2072a94ab301850c837a17ce) (cherry picked from commit 502376a5735998dfceb09ba8d2889df5dcfa5b58)
2018-12-24OmniVision ov5640 MIPI-CSI2 camera supportWojciech Bieganski
gst-inspect mfw_v4lsrc gst-launch mfw_v4lsrc capture-mode=5 device=/dev/video2 ! mfw_v4lsink Signed-off-by: Wojciech Bieganski <wbieganski@antmicro.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 4f4528cf031a4c6585bfcefd66607780de064de8) (cherry picked from commit b34325c7f99d3f323214e8b0f121711330769646)
2018-12-24tc358743_h2c: add devicetree supportTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit fdbda9fe7aef9054c24d2a1f69b9c8426aadd938) (cherry picked from commit d2aa5b3e67cf6bf0a8feb75b3f04a1b1acba402e)
2018-12-24TC358743 Kconfig dependency updateTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 8cd242dee0325df15450a9eee0007d8ad9364cbb) (cherry picked from commit 97662d8d52b3decdbac836ad7e0fcd21ff74eeed)
2018-12-24tc358743_h2c: fill in sample edid data from Asus monitorTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit d01caf489143aaaedecee90330d4e8ac97bf6442) (cherry picked from commit e966a0b148c0194d729ba9b641bf920b894dda67)
2018-12-24tc358743_h2c: fix compiler warningsTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit d61dc8298834df8c65615a649f47e40a711521af) (cherry picked from commit fa98ab80ed95c4578d6723bb1db1af65843bebbe)
2018-12-24tc358743_h2c: cleanup spacingTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit c8486f98aebfc5c3b86d4a460ab957a39ef03da5) (cherry picked from commit 1ae41bef3c253a9f1c1f3fbab8d01ab3359e8b74)
2018-12-24add tc358743_h2c driverTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 832cf98e8925634793f98709843b1e9f390cbbb0) (cherry picked from commit cb8232eefc0f5096211dc8100b40bf8eeb63be30)
2018-12-24mxc_v4l2_capture: add mxc_camera_common_lock/unlock, fix device nameTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit c9419af618e4e7944b56f65dce29f2f409681997) (cherry picked from commit 2e65a3ea2a4e3b27f7599db74d9c47a510c6dee8) Conflicts: drivers/media/platform/mxc/capture/mxc_v4l2_capture.c (cherry picked from commit 912f823a874ab9afb499c2ea344c6622db9d54ec)
2018-12-24ov5640_mipi: software reset does not affect i2c addressTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit c4b9844b183e2a067bfdc0b4a79a8f8142df0923) (cherry picked from commit a26957bd966f8b653ee25f38330b2d9c16efb2ed)
2018-12-24ipu_csi_enc: improve error messageTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit b935b1ff7c413bc8bf9c65df0397337909630376) (cherry picked from commit 916ed1ffda92b744206dd67cec71e4722ff3311c)
2018-12-24ipu_prp_enc: improve error messageTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 243bea2b77c43b8b1d19e4acd1eb179a730695c4) (cherry picked from commit 439ea46c8f4adefdd3ea871f2b5ef129a3e66444)
2018-12-24ov5642: fix csi/ipu check for imx6dlTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 1adbe34139fdfabded29d46ccbe5511c03785715) (cherry picked from commit cd35b253290e7da538f45474a886a0d2b807981e)
2018-12-24ov5640_mipi: fix csi/ipu check for imx6dlTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 1adbe34139fdfabded29d46ccbe5511c03785715) (cherry picked from commit 388605f0dbb35cdadf0312314251cd385062a18a)
2018-12-24ov5642: add i2c address change featureTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 5798f58479291edf32f5a587832acc0176dcf3c1) (cherry picked from commit 07bd62d2ca9340138d24f45e424d046561053321)
2018-12-24ov5640_mipi: add i2c address change featureTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 5798f58479291edf32f5a587832acc0176dcf3c1) (cherry picked from commit 73924ed00eda7cfe2c055b279617bd4ab60b432c)
2018-12-24ov5640_mipi: change registered name from ov5640 to ov5640_mipi to reduce ↵Troy Kisky
confusion Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit a7b51c237908ee83bfec7960f058bdbe45a271ea) (cherry picked from commit 9ffb829e3a95cda8bbc2602c80095fa9cd086399)
2018-12-24i.MX6: v4lout: none of our displays support color-space conversionEric Nelson
Without this, fb0 can become a YUV buffer and doesn't switch back to being rgb when fb0 is closed by the app. Signed-off-by: Eric Nelson <eric.nelson@boundarydevices.com> Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> (cherry picked from commit efdd29b0fd12e8245ca90f51d8cb6453f094cbc5) (cherry picked from commit 98963d07a9e65b354a19dc542a08fa458c79dc22)
2018-12-24ov5640_mipi: simplify mipi clock wait loopTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit fc51873dfc9cc3f5ef0fcc63b77cfb932002705d) (cherry picked from commit 66d988349477f4789b90db00506d642bd27002dd)
2018-12-24ov5640_mipi: print message on gpio request failureTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit aac2ec266cd0f5c356f5d2b66efc3713adaa6dd1) (cherry picked from commit 4898869c5880718b4b04a323a1cf2af729fc2072)
2018-12-24mxc_v4l2_capture: add ipu_id to sensor_dataTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit e1f8812a4c5155d190f85156f66f11d6771433f3) (cherry picked from commit e2954c501e13fe57d228682b43fccb701fe138c7)
2018-12-24ov5640_mipi: add remove *2 and add error checking to OV5640_get_sysclkTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit a7089d607873a51b2febdf07aab02e062b9d2cb9) (cherry picked from commit af79b8bab89500f5687862e511be1c3ff564dc54)
2018-12-24ov5640_mipi: add imx6 mipi/parallel selectionTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 2f3ef48564a9d624ba229ae9745aeb8c839ff95f) (cherry picked from commit a03ab419a5087a88a359ec69ddb40f900378c9ad)
2018-12-24ov5640: add pwm option for mclkTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit b4fc866e16424d9c0dcea5821dbab9780623f5ad) (cherry picked from commit 4f704da6694f704878c9c7bb7afd2b8e013f9261) [rebased to 4.9, get PWM period from current state] Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2018-12-24ov5642: add imx6 mipi/parallel selectionTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 1e44a4c2db2af9793871ef322455e0596c435968) (cherry picked from commit 81cf9418a31ee9c46b4d72b7ea5d9086b99c72f6)
2018-12-24fix camera power downTroy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 7a0e6c99a098a8c3b4ca41631814c5d6675530e7) (cherry picked from commit ede1722ea15228345ab4fe6df3836c4b7447f82d)
2018-12-24mxc_v4l2_capture: fix VIDIOC_ENUMSTD, return -EINVAL if index > 0Troy Kisky
Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com> (cherry picked from commit 8416153781d90d7153769310ea7b250166460f86) (cherry picked from commit bc387b6fd0e45132e951eaa79af1bfdc4c196ed0)
2018-12-12Merge tag 'v4.9.144' into 4.9-2.3.x-imxMarcel Ziswiler
This is the 4.9.144 stable release
2018-12-05media: em28xx: Fix use-after-free when disconnectingMatthias Schwarzott
[ Upstream commit 910b0797fa9e8af09c44a3fa36cb310ba7a7218d ] Fix bug by moving the i2c_unregister_device calls after deregistration of dvb frontend. The new style i2c drivers already destroys the frontend object at i2c_unregister_device time. When the dvb frontend is unregistered afterwards it leads to this oops: [ 6058.866459] BUG: unable to handle kernel NULL pointer dereference at 00000000000001f8 [ 6058.866578] IP: dvb_frontend_stop+0x30/0xd0 [dvb_core] [ 6058.866644] PGD 0 [ 6058.866646] P4D 0 [ 6058.866726] Oops: 0000 [#1] SMP [ 6058.866768] Modules linked in: rc_pinnacle_pctv_hd(O) em28xx_rc(O) si2157(O) si2168(O) em28xx_dvb(O) em28xx(O) si2165(O) a8293(O) tda10071(O) tea5767(O) tuner(O) cx23885(O) tda18271(O) videobuf2_dvb(O) videobuf2_dma_sg(O) m88ds3103(O) tveeprom(O) cx2341x(O) v4l2_common(O) dvb_core(O) rc_core(O) videobuf2_memops(O) videobuf2_v4l2(O) videobuf2_core(O) videodev(O) media(O) bluetooth ecdh_generic ums_realtek uas rtl8192cu rtl_usb rtl8192c_common rtlwifi usb_storage snd_hda_codec_realtek snd_hda_codec_hdmi snd_hda_codec_generic i2c_mux snd_hda_intel snd_hda_codec snd_hwdep x86_pkg_temp_thermal snd_hda_core kvm_intel kvm irqbypass [last unloaded: videobuf2_memops] [ 6058.867497] CPU: 2 PID: 7349 Comm: kworker/2:0 Tainted: G W O 4.13.9-gentoo #1 [ 6058.867595] Hardware name: MEDION E2050 2391/H81H3-EM2, BIOS H81EM2W08.308 08/25/2014 [ 6058.867692] Workqueue: usb_hub_wq hub_event [ 6058.867746] task: ffff88011a15e040 task.stack: ffffc90003074000 [ 6058.867825] RIP: 0010:dvb_frontend_stop+0x30/0xd0 [dvb_core] [ 6058.867896] RSP: 0018:ffffc90003077b58 EFLAGS: 00010293 [ 6058.867964] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 000000010040001f [ 6058.868056] RDX: ffff88011a15e040 RSI: ffffea000464e400 RDI: ffff88001cbe3028 [ 6058.868150] RBP: ffffc90003077b68 R08: ffff880119390380 R09: 000000010040001f [ 6058.868241] R10: ffffc90003077b18 R11: 000000000001e200 R12: ffff88001cbe3028 [ 6058.868330] R13: ffff88001cbe68d0 R14: ffff8800cf734000 R15: ffff8800cf734098 [ 6058.868419] FS: 0000000000000000(0000) GS:ffff88011fb00000(0000) knlGS:0000000000000000 [ 6058.868511] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 6058.868578] CR2: 00000000000001f8 CR3: 00000001113c5000 CR4: 00000000001406e0 [ 6058.868662] Call Trace: [ 6058.868705] dvb_unregister_frontend+0x2a/0x80 [dvb_core] [ 6058.868774] em28xx_dvb_fini+0x132/0x220 [em28xx_dvb] [ 6058.868840] em28xx_close_extension+0x34/0x90 [em28xx] [ 6058.868902] em28xx_usb_disconnect+0x4e/0x70 [em28xx] [ 6058.868968] usb_unbind_interface+0x6d/0x260 [ 6058.869025] device_release_driver_internal+0x150/0x210 [ 6058.869094] device_release_driver+0xd/0x10 [ 6058.869150] bus_remove_device+0xe4/0x160 [ 6058.869204] device_del+0x1ce/0x2f0 [ 6058.869253] usb_disable_device+0x99/0x270 [ 6058.869306] usb_disconnect+0x8d/0x260 [ 6058.869359] hub_event+0x93d/0x1520 [ 6058.869408] ? dequeue_task_fair+0xae5/0xd20 [ 6058.869467] process_one_work+0x1d9/0x3e0 [ 6058.869522] worker_thread+0x43/0x3e0 [ 6058.869576] kthread+0x104/0x140 [ 6058.869602] ? trace_event_raw_event_workqueue_work+0x80/0x80 [ 6058.869640] ? kthread_create_on_node+0x40/0x40 [ 6058.869673] ret_from_fork+0x22/0x30 [ 6058.869698] Code: 54 49 89 fc 53 48 8b 9f 18 03 00 00 0f 1f 44 00 00 41 83 bc 24 04 05 00 00 02 74 0c 41 c7 84 24 04 05 00 00 01 00 00 00 0f ae f0 <48> 8b bb f8 01 00 00 48 85 ff 74 5c e8 df 40 f0 e0 48 8b 93 f8 [ 6058.869850] RIP: dvb_frontend_stop+0x30/0xd0 [dvb_core] RSP: ffffc90003077b58 [ 6058.869894] CR2: 00000000000001f8 [ 6058.875880] ---[ end trace 717eecf7193b3fc6 ]--- Signed-off-by: Matthias Schwarzott <zzam@gentoo.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-27media: v4l: event: Add subscription to list before calling "add" operationSakari Ailus
commit 92539d3eda2c090b382699bbb896d4b54e9bdece upstream. Patch ad608fbcf166 changed how events were subscribed to address an issue elsewhere. As a side effect of that change, the "add" callback was called before the event subscription was added to the list of subscribed events, causing the first event queued by the add callback (and possibly other events arriving soon afterwards) to be lost. Fix this by adding the subscription to the list before calling the "add" callback, and clean up afterwards if that fails. Fixes: ad608fbcf166 ("media: v4l: event: Prevent freeing event subscriptions while accessed") Reported-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Tested-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Hans Verkuil <hans.verkuil@cisco.com> Cc: stable@vger.kernel.org (for 4.14 and up) Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> [Sakari Ailus: Backported to v4.9 stable] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-27Revert "media: videobuf2-core: don't call memop 'finish' when queueing"Hans Verkuil
This reverts commit 9ac47200b51cb09d2f15dbefa67e0412741d98aa. This commit fixes a bug in upstream commit a136f59c0a1f ("vb2: Move buffer cache synchronisation to prepare from queue") which isn't present in 4.9. So as a result you get an UNBALANCED message in the kernel log if this patch is applied: vb2: counters for queue ffffffc0f3687478, buffer 3: UNBALANCED! vb2: buf_init: 1 buf_cleanup: 1 buf_prepare: 805 buf_finish: 805 vb2: buf_queue: 806 buf_done: 806 vb2: alloc: 0 put: 0 prepare: 806 finish: 805 mmap: 0 vb2: get_userptr: 0 put_userptr: 0 vb2: attach_dmabuf: 1 detach_dmabuf: 1 map_dmabuf: 805 unmap_dmabuf: 805 vb2: get_dmabuf: 0 num_users: 1609 vaddr: 0 cookie: 805 Reverting this patch solves this regression. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
2018-11-21media: tvp5150: fix width alignment during set_selection()Marco Felsch
[ Upstream commit bd24db04101f45a9c1d874fe21b0c7eab7bcadec ] The driver ignored the width alignment which exists due to the UYVY colorspace format. Fix the width alignment and make use of the the provided v4l2 helper function to set the width, height and all alignments in one. Fixes: 963ddc63e20d ("[media] media: tvp5150: Add cropping support") Signed-off-by: Marco Felsch <m.felsch@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-21media: pci: cx23885: handle adding to list failureNicholas Mc Guire
[ Upstream commit c5d59528e24ad22500347b199d52b9368e686a42 ] altera_hw_filt_init() which calls append_internal() assumes that the node was successfully linked in while in fact it can silently fail. So the call-site needs to set return to -ENOMEM on append_internal() returning NULL and exit through the err path. Fixes: 349bcf02e361 ("[media] Altera FPGA based CI driver module") Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13media: em28xx: make v4l2-compliance happier by starting sequence on zeroMauro Carvalho Chehab
commit afeaade90db4c5dab93f326d9582be1d5954a198 upstream. The v4l2-compliance tool complains if a video doesn't start with a zero sequence number. While this shouldn't cause any real problem for apps, let's make it happier, in order to better check the v4l2-compliance differences before and after patchsets. This is actually an old issue. It is there since at least its videobuf2 conversion, e. g. changeset 3829fadc461 ("[media] em28xx: convert to videobuf2"), if VB1 wouldn't suffer from the same issue. Cc: stable@vger.kernel.org Fixes: d3829fadc461 ("[media] em28xx: convert to videobuf2") Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13media: em28xx: fix input name for Terratec AV 350Mauro Carvalho Chehab
commit 15644bfa195bd166d0a5ed76ae2d587f719c3dac upstream. Instead of using a register value, use an AMUX name, as otherwise VIDIOC_G_AUDIO would fail. Cc: stable@vger.kernel.org Fixes: 766ed64de554 ("V4L/DVB (11827): Add support for Terratec Grabster AV350") Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13media: tvp5150: avoid going past array on v4l2_querymenu()Mauro Carvalho Chehab
commit 5c4c4505b716cb782ad7263091edc466c4d1fbd4 upstream. The parameters of v4l2_ctrl_new_std_menu_items() are tricky: instead of the number of possible values, it requires the number of the maximum value. In other words, the ARRAY_SIZE() value should be decremented, otherwise it will go past the array bounds, as warned by KASAN: [ 279.839688] BUG: KASAN: global-out-of-bounds in v4l2_querymenu+0x10d/0x180 [videodev] [ 279.839709] Read of size 8 at addr ffffffffc10a4cb0 by task v4l2-compliance/16676 [ 279.839736] CPU: 1 PID: 16676 Comm: v4l2-compliance Not tainted 4.18.0-rc2+ #120 [ 279.839741] Hardware name: /NUC5i7RYB, BIOS RYBDWi35.86A.0364.2017.0511.0949 05/11/2017 [ 279.839743] Call Trace: [ 279.839758] dump_stack+0x71/0xab [ 279.839807] ? v4l2_querymenu+0x10d/0x180 [videodev] [ 279.839817] print_address_description+0x1c9/0x270 [ 279.839863] ? v4l2_querymenu+0x10d/0x180 [videodev] [ 279.839871] kasan_report+0x237/0x360 [ 279.839918] v4l2_querymenu+0x10d/0x180 [videodev] [ 279.839964] __video_do_ioctl+0x2c8/0x590 [videodev] [ 279.840011] ? copy_overflow+0x20/0x20 [videodev] [ 279.840020] ? avc_ss_reset+0xa0/0xa0 [ 279.840028] ? check_stack_object+0x21/0x60 [ 279.840036] ? __check_object_size+0xe7/0x240 [ 279.840080] video_usercopy+0xed/0x730 [videodev] [ 279.840123] ? copy_overflow+0x20/0x20 [videodev] [ 279.840167] ? v4l_enumstd+0x40/0x40 [videodev] [ 279.840177] ? __handle_mm_fault+0x9f9/0x1ba0 [ 279.840186] ? __pmd_alloc+0x2c0/0x2c0 [ 279.840193] ? __vfs_write+0xb6/0x350 [ 279.840200] ? kernel_read+0xa0/0xa0 [ 279.840244] ? video_usercopy+0x730/0x730 [videodev] [ 279.840284] v4l2_ioctl+0xa1/0xb0 [videodev] [ 279.840295] do_vfs_ioctl+0x117/0x8a0 [ 279.840303] ? selinux_file_ioctl+0x211/0x2f0 [ 279.840313] ? ioctl_preallocate+0x120/0x120 [ 279.840319] ? selinux_capable+0x20/0x20 [ 279.840332] ksys_ioctl+0x70/0x80 [ 279.840342] __x64_sys_ioctl+0x3d/0x50 [ 279.840351] do_syscall_64+0x6d/0x1c0 [ 279.840361] entry_SYSCALL_64_after_hwframe+0x44/0xa9 [ 279.840367] RIP: 0033:0x7fdfb46275d7 [ 279.840369] Code: b3 66 90 48 8b 05 b1 48 2d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 81 48 2d 00 f7 d8 64 89 01 48 [ 279.840474] RSP: 002b:00007ffee1179038 EFLAGS: 00000202 ORIG_RAX: 0000000000000010 [ 279.840483] RAX: ffffffffffffffda RBX: 00007ffee1179180 RCX: 00007fdfb46275d7 [ 279.840488] RDX: 00007ffee11790c0 RSI: 00000000c02c5625 RDI: 0000000000000003 [ 279.840493] RBP: 0000000000000002 R08: 0000000000000020 R09: 00000000009f0902 [ 279.840497] R10: 0000000000000000 R11: 0000000000000202 R12: 00007ffee117a5a0 [ 279.840501] R13: 00007ffee11790c0 R14: 0000000000000002 R15: 0000000000000000 [ 279.840515] The buggy address belongs to the variable: [ 279.840535] tvp5150_test_patterns+0x10/0xffffffffffffe360 [tvp5150] Fixes: c43875f66140 ("[media] tvp5150: replace MEDIA_ENT_F_CONN_TEST by a control") Cc: stable@vger.kernel.org Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13media: em28xx: use a default format if TRY_FMT failsMauro Carvalho Chehab
commit f823ce2a1202d47110a7ef86b65839f0be8adc38 upstream. Follow the V4L2 spec, as warned by v4l2-compliance: warn: v4l2-test-formats.cpp(732): TRY_FMT cannot handle an invalid pixelformat. warn: v4l2-test-formats.cpp(733): This may or may not be a problem. For more information see: warn: v4l2-test-formats.cpp(734): http://www.mail-archive.com/linux-media@vger.kernel.org/msg56550.html Cc: stable@vger.kernel.org Fixes: bddcf63313c6 ("V4L/DVB (9927): em28xx: use a more standard way to specify video formats") Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-11-13media: v4l2-tpg: fix kernel oops when enabling HFLIP and OSDHans Verkuil
commit 250854eed5d45a73d81e4137dfd85180af6f2ec3 upstream. When the OSD is on (i.e. vivid displays text on top of the test pattern), and you enable hflip, then the driver crashes. The cause turned out to be a division of a negative number by an unsigned value. You expect that -8 / 2U would be -4, but in reality it is 2147483644 :-( Fixes: 3e14e7a82c1ef ("vivid-tpg: add hor/vert downsampling support to tpg_gen_text") Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reported-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Cc: <stable@vger.kernel.org> # for v4.1 and up Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-20media: af9035: prevent buffer overflow on writeJozef Balga
[ Upstream commit 312f73b648626a0526a3aceebb0a3192aaba05ce ] When less than 3 bytes are written to the device, memcpy is called with negative array size which leads to buffer overflow and kernel panic. This patch adds a condition and returns -EOPNOTSUPP instead. Fixes bugzilla issue 64871 [mchehab+samsung@kernel.org: fix a merge conflict and changed the condition to match the patch's comment, e. g. len == 3 could also be valid] Signed-off-by: Jozef Balga <jozef.balga@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>