summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/vivid/vivid-core.c
Commit message (Collapse)AuthorAgeFilesLines
* media: vivid: use ktime_t for timestamp calculationArnd Bergmann2017-12-081-1/+1
| | | | | | | | | | | | | | | timespec is generally deprecated because of the y2038 overflow. In vivid, the usage is fine, since we are dealing with monotonic timestamps, but we can also simplify the code by going to ktime_t. Using ktime_divns() should be roughly as efficient as the old code, since the constant 64-bit division gets turned into a multiplication on modern platforms, and we save multiple 32-bit divisions that can be expensive e.g. on ARMv7. Tested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* media: vivid: fix incorrect HDMI input/output CEC loggingHans Verkuil2017-08-261-4/+4
| | | | | | | | | | | Only the first HDMI input has a CEC adapter, so just report 'HDMI 0' as the HDMI input name. For the HDMI outputs use bus_cnt instead of i as the output number. The HDMI name now corresponds to what 'v4l2-ctl --list-outputs' reports. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vivid: support for contiguous DMA buffersVincent ABRIOU2017-03-031-5/+27
| | | | | | | | | | | | | | | | It allows to simulate the behavior of hardware with such limitations or to connect vivid to real hardware with such limitations. Add the "allocators" module parameter option to let vivid use the dma-contig instead of vmalloc. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Vincent Abriou <vincent.abriou@st.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] cec: pass parent device in register(), not allocate()Hans Verkuil2016-11-291-5/+4
| | | | | | | | | | | | | | The cec_allocate_adapter function doesn't need the parent device, only the cec_register_adapter function needs it. Drop the cec_devnode parent field, since devnode.dev.parent can be used instead. This change makes the framework consistent with other frameworks where the parent device is not used until the device is registered. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vivid: fix HDMI VSDB block in the EDIDHans Verkuil2016-11-221-2/+2
| | | | | | | | | | | The maximum 'Max TMDS Rate' in the HDMI VSDB block is 340 MHz, not 600. Higher rates are advertised in the HDMI Forum VSDB block. So lower the Max TMDS rate in the HDMI VSDB block that the vivid driver uses to 300 MHz, which is typical of most HDMI 1.4b devices. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vivid: fix error return code in vivid_create_instance()Wei Yongjun2016-09-191-1/+4
| | | | | | | | | Fix to return error code -ENOMEM from the memory or workqueue alloc error handling case instead of 0, as done elsewhere in this function. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vivid: update EDIDHans Verkuil2016-09-061-29/+29
| | | | | | | | Update the vivid EDID, fixing various incorrect values (wrong name, product code, various video capabilities). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vivid: fix typo causing incorrect CEC physical addressesHans Verkuil2016-07-151-1/+1
| | | | | | | | Fix typo in vivid that caused all HDMI outputs to have the same physical address. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vivid: add CEC emulationHans Verkuil2016-06-281-9/+109
| | | | | | | | | | | The vivid driver has been extended to provide CEC adapters for the HDMI input and HDMI outputs in order to test CEC applications. This CEC emulation is faithful to the CEC timings (i.e., it all at a snail's pace). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] vivid: set device_caps in video_deviceHans Verkuil2016-04-131-15/+7
| | | | | | | | This simplifies the querycap function. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: Add an option to configure the maximum number of devicesEzequiel Garcia2015-10-031-1/+1
| | | | | | | | | | The vivid driver currently has a hard-coded limit of 64 devices, however there's nothing that prevents the creation of even more devices. This commit adds a new driver option (which defaults to 64) to allow this maximum number to be configurable. Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: Fix iteration in driver removal pathEzequiel Garcia2015-10-031-1/+4
| | | | | | | | | | | | | | When the diver is removed and all the resources are deallocated, we should be iterating through the created devices only. Currently, the iteration ends when vivid_devs[i] is NULL. Since the array contains VIVID_MAX_DEVS elements, it will oops if n_devs=VIVID_MAX_DEVS because in that case, no element is NULL. Fixes: c88a96b023d8 ('[media] vivid: add core driver code') Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: SDR cap add 'CU08' Complex U8 formatAntti Palosaari2015-05-301-2/+5
| | | | | | | | Add complex unsigned 8-bit sample format for SDR capture. Signed-off-by: Antti Palosaari <crope@iki.fi> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid-tpg: add tpg_log_status()Hans Verkuil2015-04-281-1/+12
| | | | | | | | Add a log_status function to the test pattern generator and use that in vivid. This simplifies debugging complex colorspace problems. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: use v4l2_device.release to clean up the driverHans Verkuil2015-04-021-20/+23
| | | | | | | | | Use the release callback of the v4l2_device to clean up the memory. This prevents vivid from breaking if someone tries to unbind the driver. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: turn this into a platform_deviceHans Verkuil2015-04-021-5/+45
| | | | | | | | | This turns this driver into a platform device. This ensures that it appears in /sys/bus/platform_device since it now has a proper parent device. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: enable vb2_expbuf supportHans Verkuil2014-11-251-1/+1
| | | | | | | | | Now that vb2 supports DMABUF export for dma-sg and vmalloc memory modes, we can enable the vb2_expbuf support in vivid. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Pawel Osciak <pawel@osciak.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: vivid: use vb2_ops_wait_prepare/finish helperPrabhakar Lad2014-11-251-14/+5
| | | | | | Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: default to single planar device instancesHans Verkuil2014-11-031-8/+3
| | | | | | | | | | | The default used to be that the first vivid device instance was single planar, the second multi planar, the third single planar, etc. However, that turned out to be unexpected and awkward. Change the driver to always default to single planar. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] vivid: add missing includesHans Verkuil2014-09-081-0/+1
| | | | | | | | Fix kbuild test robot warnings about missing vmalloc.h and string.h includes. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] vivid: Don't declare .vidioc_overlay twiceMauro Carvalho Chehab2014-09-021-1/+0
| | | | | | | | | | | Removes the following warnings: drivers/media/platform/vivid/vivid-core.c:581:2: warning: initialized field overwritten [-Woverride-init] .vidioc_overlay = vidioc_overlay, ^ drivers/media/platform/vivid/vivid-core.c:581:2: warning: (near initialization for 'vivid_ioctl_ops.vidioc_overlay') [-Woverride-init] Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] vivid: add core driver codeHans Verkuil2014-09-021-0/+1390
This is the core driver code that creates all the driver instances and all the configured devices. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
OpenPOWER on IntegriCloud