aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/davinci/vpif_display.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-03-18media: platform: rename davinci/ to ti/davinci/Mauro Carvalho Chehab1-1408/+0
As the end goal is to have platform drivers split by vendor, rename davinci/ to ti/davinci/. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2022-03-07media: davinci: vpif: Use platform_get_irq_optional() to get the interruptLad Prabhakar1-9/+15
platform_get_resource(pdev, IORESOURCE_IRQ, ..) relies on static allocation of IRQ resources in DT core code, this causes an issue when using hierarchical interrupt domains using "interrupts" property in the node as this bypasses the hierarchical setup and messes up the irq chaining. In preparation for removal of static setup of IRQ resource from DT core code use platform_get_irq_optional(). While at it, propagate error code in case devm_request_irq() fails instead of returning -EINVAL. Signed-off-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
2021-05-20media: davinci: fix two kernel-doc commentsMauro Carvalho Chehab1-1/+1
A typo there is causing two warnings: drivers/media/platform/davinci/vpif_display.c:114: warning: Function parameter or member 'nplanes' not described in 'vpif_buffer_queue_setup' drivers/media/platform/davinci/vpif_capture.c:112: warning: Function parameter or member 'nplanes' not described in 'vpif_buffer_queue_setup' Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2021-02-06media: davinci: vpif_display: Remove unused v4l2-async codeEzequiel Garcia1-71/+15
There are no users for vpif_display_config.asd_sizes and vpif_display_config.asd members, which means the v4l2-async subdevices aren't being defined anywhere. Remove the v4l2-async, leaving only the synchronous setup. Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com> Reviewed-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-07-19media: davinci: replace http references with httpsAlexander A. Klimov1-1/+1
TI DAVINCI SERIES MEDIA DRIVER: Replace HTTP links with HTTPS ones Rationale: Reduces attack surface on kernel devs opening the links for MITM as HTTPS traffic is much harder to manipulate. Deterministic algorithm: For each file: If not .svg: For each line: If doesn't contain `\bxmlns\b`: If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`: If both the HTTP and HTTPS versions return 200 OK and serve the same content: Replace HTTP with HTTPS. Signed-off-by: Alexander A. Klimov <grandmaster@al2klimov.de> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-04-21media: davinci: remove redundant assignment to pointer 'common'Colin Ian King1-1/+0
The pointer 'common' is being assigned with a value that is never read, the assignment is redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2020-02-24media: media/platform: rename VFL_TYPE_GRABBER to _VIDEOHans Verkuil1-1/+1
'GRABBER' is a weird name, all other types map to the /dev device names. Rename to 'VIDEO' to be consistent with the other types. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
2019-07-22media: am437x/davinci: set device_caps in struct video_deviceHans Verkuil1-2/+1
Instead of filling in the struct v4l2_capability device_caps field, fill in the struct video_device device_caps field. That way the V4L2 core knows what the capabilities of the video device are. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-07-22media: media/platform: don't set description in ENUM_FMTHans Verkuil1-4/+0
The V4L2 core sets the format description and flags for the driver in order to ensure consistent naming. So drop the strscpy of the description in drivers. Also remove any description strings in driver-internal structures since those are no longer needed. And in am437x-vpfe.c drop an unnecessary f->type assignment in vpfe_enum_fmt(). Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Acked-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> [hverkuil-cisco@xs4all.nl: addressed some small suggestions from Laurent] Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-29media: replace strncpy() by strscpy()Mauro Carvalho Chehab1-2/+2
The strncpy() function is being deprecated upstream. Replace it by the safer strscpy(). While here, replace a few occurences of strlcpy() that were recently added to also use strscpy(). Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2019-03-01media: platform: fix several typosMauro Carvalho Chehab1-2/+2
Use codespell to fix lots of typos over frontends. Manually verified to avoid false-positives. Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Acked-by: Andrzej Pietrasiewicz <andrzejtp2010@gmail.com> Reviewed-by: Benoit Parrot <bparrot@ti.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Reviewed-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Houlong Wei <houlong.wei@mediatek.com> Reviewed-by: Yong Deng <yong.deng@magewell.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-10-04media: platform: Switch to v4l2_async_notifier_add_subdevSteve Longerbeam1-3/+17
Switch all media platform drivers to call v4l2_async_notifier_add_subdev() to add asd's to a notifier, in place of referencing the notifier->subdevs[] array. These drivers also must now call v4l2_async_notifier_init() before adding asd's to their notifiers. There may still be cases where a platform driver maintains a list of asd's that is a duplicate of the notifier asd_list, in which case its possible the platform driver list can be removed, and can reference the notifier asd_list instead. One example of where a duplicate list has been removed in this patch is xilinx-vipp.c. If there are such cases remaining, those drivers should be optimized to remove the duplicate platform driver asd lists. None of the changes to the platform drivers in this patch have been tested. Verify that the async subdevices needed by the platform are bound at load time, and that the driver unloads and reloads correctly with no memory leaking of asd objects. Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Steve Longerbeam <slongerbeam@gmail.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-11media: replace strcpy() by strscpy()Mauro Carvalho Chehab1-1/+2
The strcpy() function is being deprecated upstream. Replace it by the safer strscpy(). Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-09-11media: use strscpy() instead of strlcpy()Mauro Carvalho Chehab1-3/+3
The implementation of strscpy() is more robust and safer. That's now the recommended way to copy NUL terminated strings. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-08-02media: davinci: vpif_display: Mix memory leak on probe error pathAnton Vasilyev1-8/+16
If vpif_probe() fails on v4l2_device_register() then memory allocated at initialize_vpif() for global vpif_obj.dev[i] become unreleased. The patch adds deallocation of vpif_obj.dev[i] on the error path and removes duplicated check on platform_data presence. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Anton Vasilyev <vasilyev@ispras.ru> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2017-11-30media: davinci: fix kernel-doc warningsMauro Carvalho Chehab1-8/+8
There are several of kernel-doc warnings: drivers/media/platform/davinci/vpif_display.c:114: warning: No description found for parameter 'sizes' drivers/media/platform/davinci/vpif_display.c:165: warning: No description found for parameter 'vq' drivers/media/platform/davinci/vpif_display.c:165: warning: Excess function parameter 'vb' description in 'vpif_start_streaming' drivers/media/platform/davinci/vpif_display.c:780: warning: No description found for parameter 'vpif_cfg' drivers/media/platform/davinci/vpif_display.c:780: warning: No description found for parameter 'chan_cfg' drivers/media/platform/davinci/vpif_display.c:780: warning: No description found for parameter 'index' drivers/media/platform/davinci/vpif_display.c:813: warning: No description found for parameter 'vpif_cfg' drivers/media/platform/davinci/vpif_display.c:813: warning: No description found for parameter 'ch' drivers/media/platform/davinci/vpif_display.c:813: warning: No description found for parameter 'index' drivers/media/platform/davinci/vpif_capture.c:121: warning: No description found for parameter 'sizes' drivers/media/platform/davinci/vpif_capture.c:174: warning: No description found for parameter 'vq' drivers/media/platform/davinci/vpif_capture.c:174: warning: Excess function parameter 'vb' description in 'vpif_start_streaming' drivers/media/platform/davinci/vpif_capture.c:636: warning: No description found for parameter 'iface' drivers/media/platform/davinci/vpif_capture.c:647: warning: No description found for parameter 'ch' drivers/media/platform/davinci/vpif_capture.c:647: warning: No description found for parameter 'muxmode' drivers/media/platform/davinci/vpif_capture.c:676: warning: No description found for parameter 'vpif_cfg' drivers/media/platform/davinci/vpif_capture.c:676: warning: No description found for parameter 'chan_cfg' drivers/media/platform/davinci/vpif_capture.c:676: warning: No description found for parameter 'input_index' drivers/media/platform/davinci/vpif_capture.c:712: warning: No description found for parameter 'vpif_cfg' drivers/media/platform/davinci/vpif_capture.c:712: warning: No description found for parameter 'ch' drivers/media/platform/davinci/vpif_capture.c:712: warning: No description found for parameter 'index' drivers/media/platform/davinci/vpif_capture.c:798: warning: No description found for parameter 'std' drivers/media/platform/davinci/vpif_capture.c:798: warning: Excess function parameter 'std_id' description in 'vpif_g_std' drivers/media/platform/davinci/vpif_capture.c:940: warning: No description found for parameter 'fmt' drivers/media/platform/davinci/vpif_capture.c:940: warning: Excess function parameter 'index' description in 'vpif_enum_fmt_vid_cap' drivers/media/platform/davinci/vpif_capture.c:1750: warning: No description found for parameter 'dev' Fix them. Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-31media: v4l: async: Move async subdev notifier operations to a separate structureLaurent Pinchart1-2/+6
The async subdev notifier .bound(), .unbind() and .complete() operations are function pointers stored directly in the v4l2_async_subdev structure. As the structure isn't immutable, this creates a potential security risk as the function pointers are mutable. To fix this, move the function pointers to a new v4l2_async_subdev_operations structure that can be made const in drivers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se> Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: davinci: vpif_display: constify vb2_ops structureGustavo A. R. Silva1-1/+1
Check for vb2_ops structures that are only stored in the ops field of a vb2_queue structure. That field is declared const, so vb2_ops structures that have this property can be declared as const also. This issue was detected using Coccinelle and the following semantic patch: @r disable optional_qualifier@ identifier i; position p; @@ static struct vb2_ops i@p = { ... }; @ok@ identifier r.i; struct vb2_queue e; position p; @@ e.ops = &i@p; @bad@ position p != {r.p,ok.p}; identifier r.i; struct vb2_ops e; @@ e@i@p @depends on !bad disable optional_qualifier@ identifier r.i; @@ static +const struct vb2_ops i = { ... }; Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-17media: davinci: variable 'common' set but not usedMauro Carvalho Chehab1-2/+0
Get rid of those two warnings: drivers/media/platform/davinci/vpif_capture.c: In function 'vpif_remove': drivers/media/platform/davinci/vpif_capture.c:1722:21: warning: variable 'common' set but not used [-Wunused-but-set-variable] struct common_obj *common; ^~~~~~ drivers/media/platform/davinci/vpif_display.c: In function 'vpif_remove': drivers/media/platform/davinci/vpif_display.c:1342:21: warning: variable 'common' set but not used [-Wunused-but-set-variable] struct common_obj *common; ^~~~~~ Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07[media] davinci: vpif_capture: get subdevs from DT when availableKevin Hilman1-0/+5
Enable getting of subdevs from DT ports and endpoints. The _get_pdata() function was larely inspired by (i.e. stolen from) am437x-vpfe.c 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-03-22[media] media: vpif: use a configurable i2c_adapter_id for vpif displayBartosz Golaszewski1-1/+1
The vpif display driver uses a static i2c adapter ID of 1 but on the da850-evm board in DT boot mode the i2c adapter ID is actually 0. Make the adapter ID configurable like it already is for vpif capture. Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com> Acked-by: Kevin Hilman <khilman@baylibre.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@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] davinci: VPIF: fix module loading, init errorsKevin Hilman1-0/+6
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>
2016-11-16[media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in process_progressive_mode()Markus Elfring1-1/+1
The local variable "addr" will be set to an appropriate value a bit later. Thus omit the explicit initialisation at the beginning. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16[media] DaVinci-VPIF-Display: Delete an unnecessary variable initialisation in vpif_channel_isr()Markus Elfring1-1/+1
The local variable "channel_id" will be reassigned with the following statement at the beginning. Thus omit the explicit initialisation. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16[media] DaVinci-VPIF-Display: Adjust 11 checks for null pointersMarkus Elfring1-11/+11
The script "checkpatch.pl" pointed information out like the following. Comparison to NULL could be written... Thus fix the affected source code places. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16[media] DaVinci-VPIF-Display: Delete an error message for a failed memory allocationMarkus Elfring1-1/+0
Omit an extra message for a memory allocation failure in this function. Link: http://events.linuxfoundation.org/sites/events/files/slides/LCJ16-Refactor_Strings-WSang_0.pdf Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-16[media] DaVinci-VPIF-Display: Use kcalloc() in vpif_probe()Markus Elfring1-2/+1
* A multiplication for the size determination of a memory allocation indicated that an array data structure should be processed. Thus use the corresponding function "kcalloc". This issue was detected by using the Coccinelle software. * Replace the specification of a data type by a pointer dereference to make the corresponding size determination a bit safer according to the Linux coding style convention. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-10-21[media] davinci: don't break long linesMauro Carvalho Chehab1-7/+2
Due to the 80-cols restrictions, and latter due to checkpatch warnings, several strings were broken into multiple lines. This is not considered a good practice anymore, as it makes harder to grep for strings at the source code. As we're right now fixing other drivers due to KERN_CONT, we need to be able to identify what printk strings don't end with a "\n". It is a way easier to detect those if we don't break long lines. So, join those continuation lines. The patch was generated via the script below, and manually adjusted if needed. </script> use Text::Tabs; while (<>) { if ($next ne "") { $c=$_; if ($c =~ /^\s+\"(.*)/) { $c2=$1; $next =~ s/\"\n$//; $n = expand($next); $funpos = index($n, '('); $pos = index($c2, '",'); if ($funpos && $pos > 0) { $s1 = substr $c2, 0, $pos + 2; $s2 = ' ' x ($funpos + 1) . substr $c2, $pos + 2; $s2 =~ s/^\s+//; $s2 = ' ' x ($funpos + 1) . $s2 if ($s2 ne ""); print unexpand("$next$s1\n"); print unexpand("$s2\n") if ($s2 ne ""); } else { print "$next$c2\n"; } $next=""; next; } else { print $next; } $next=""; } else { if (m/\"$/) { if (!m/\\n\"$/) { $next=$_; next; } } } print $_; } </script> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] vb2: replace void *alloc_ctxs by struct device *alloc_devsHans Verkuil1-2/+2
Make this a proper typed array. Drop the old allocate context code since that is no longer used. Note that the memops functions now get a struct device pointer instead of the struct device ** that was there initially (actually a void pointer to a struct containing only a struct device pointer). This code is now a lot cleaner. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Sakari Ailus <sakari.ailus@iki.fi> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-07-08[media] media/platform: convert drivers to use the new vb2_queue dev fieldHans Verkuil1-10/+1
Stop using alloc_ctx and just fill in the device pointer. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Cc: Scott Jiang <scott.jiang.linux@gmail.com> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2015-12-18[media] media: videobuf2: Move timestamp to vb2_bufferJunghak Sung1-3/+3
Move timestamp from struct vb2_v4l2_buffer to struct vb2_buffer for common use, and change its type to u64 in order to handling y2038 problem. This patch also includes all device drivers' changes related to this restructuring. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-12-18[media] vb2: drop v4l2_format argument from queue_setupHans Verkuil1-6/+7
The queue_setup callback has a void pointer that is just for V4L2 and is the pointer to the v4l2_format struct that was passed to VIDIOC_CREATE_BUFS. The idea was that drivers would use the information from that struct to buffers suitable for the requested format. After the vb2 split series this pointer is now a void pointer, which is ugly, and the reality is that all existing drivers will effectively just look at the sizeimage field of v4l2_format. To make this more generic the queue_setup callback is changed: the void pointer is dropped, instead if the *num_planes argument is 0, then use the current format size, if it is non-zero, then it contains the number of requested planes and the sizes array contains the requested sizes. If either is unsupported, then return -EINVAL, otherwise use the requested size(s). Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-20[media] media: videobuf2: Change queue_setup argumentJunghak Sung1-1/+2
Replace struct v4l2_format * with void * to make queue_setup() for common use. And then, modify all device drivers related with this change. Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fix missing const in fimc-lite.c] Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-10-01[media] media: videobuf2: Restructure vb2_bufferJunghak Sung1-17/+22
Remove v4l2 stuff - v4l2_buf, v4l2_plane - from struct vb2_buffer. Add new member variables - bytesused, length, offset, userptr, fd, data_offset - to struct vb2_plane in order to cover all information of v4l2_plane. struct vb2_plane { <snip> unsigned int bytesused; unsigned int length; union { unsigned int offset; unsigned long userptr; int fd; } m; unsigned int data_offset; } Replace v4l2_buf with new member variables - index, type, memory - which are common fields for buffer management. struct vb2_buffer { <snip> unsigned int index; unsigned int type; unsigned int memory; unsigned int num_planes; struct vb2_plane planes[VIDEO_MAX_PLANES]; <snip> }; v4l2 specific fields - flags, field, timestamp, timecode, sequence - are moved to vb2_v4l2_buffer in videobuf2-v4l2.c struct vb2_v4l2_buffer { struct vb2_buffer vb2_buf; __u32 flags; __u32 field; struct timeval timestamp; struct v4l2_timecode timecode; __u32 sequence; }; Signed-off-by: Junghak Sung <jh1009.sung@samsung.com> Signed-off-by: Geunyoung Kim <nenggun.kim@samsung.com> Acked-by: Seung-Woo Kim <sw0312.kim@samsung.com> Acked-by: Inki Dae <inki.dae@samsung.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-04-02[media] media: davinci: vpif_display: embed video_device struct in channel_objLad, Prabhakar1-40/+9
Embed video_device struct (video_dev) in channel_obj and also the Unregister path doesn't need to free the video_device structure, hence, change the video_device.release callback point to video_device_release_empty. 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>
2014-10-20media: platform: davinci: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2014-09-21[media] media: davinci: vpif_display: fix the check on suspend/resume callbacksPrabhakar Lad1-2/+2
It is possible to call STREAMON without having any buffers queued. So vb2_is_streaming() can return true without start_streaming() having been called. Only after at least one buffer has been queued will start_streaming be called. The check vb2_is_streaming() is incorrect as this would start the DMA without having proper DMA pointers set up. this patch uses vb2_start_streaming_called() instead to check is streaming was called. 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>
2014-09-21[media] media: davinci: vpif_display: drop setting of vb2 buffer state to ACTIVEPrabhakar Lad1-4/+0
this patch drops setting of vb2 buffer state to VB2_BUF_STATE_ACTIVE, as any buffer queued to the driver is marked ACTIVE by the vb2 core. 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>
2014-08-26[media] vpif: don't cast pointers to intMauro Carvalho Chehab1-2/+2
Shut up several warnings about invalid casting when printing the values of two pointers. Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-08-26[media] vpif_display: get rid of some unused varsMauro Carvalho Chehab1-8/+2
drivers/media/platform/davinci/vpif_display.c: In function 'vpif_channel_isr': drivers/media/platform/davinci/vpif_display.c:363:18: warning: variable 'field' set but not used [-Wunused-but-set-variable] enum v4l2_field field; ^ drivers/media/platform/davinci/vpif_display.c: In function 'vpif_calculate_offs ets': drivers/media/platform/davinci/vpif_display.c:505:23: warning: variable 'vpitch ' set but not used [-Wunused-but-set-variable] unsigned int hpitch, vpitch, sizeimage; ^ drivers/media/platform/davinci/vpif_display.c: In function 'vpif_set_output': drivers/media/platform/davinci/vpif_display.c:816:27: warning: variable 'subdev _info' set but not used [-Wunused-but-set-variable] struct vpif_subdev_info *subdev_info = NULL; Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-22Merge commit '67dd8f35c2d8ed80f26c9654b474cffc11c6674d' into patchworkMauro Carvalho Chehab1-0/+1
* .: (268 commits) Linux 3.16-rc6 um: segv: Save regs only in case of a kernel mode fault um: Fix hung task in fix_range_common() um: Ensure that a stub page cannot get unmapped Revert "um: Fix wait_stub_done() error handling" btrfs: test for valid bdev before kobj removal in btrfs_rm_device Btrfs: fix abnormal long waiting in fsync random: check for increase of entropy_count because of signed conversion ARM: EXYNOS: Fix core ID used by platsmp and hotplug code ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode) ARM: at91/dt: add missing clocks property to pwm node in sam9x5.dtsi ARM: at91/dt: fix usb0 clocks definition in sam9n12 dtsi ARM: at91: at91sam9x5: correct typo error for ohci clock irqchip: gic: Fix core ID calculation when topology is read from DT GFS2: fs/gfs2/rgrp.c: kernel-doc warning fixes GFS2: memcontrol: Spelling s/invlidate/invalidate/ GFS2: Allow caching of glocks for flock GFS2: Allow flocks to use normal glock dq rather than dq_wait GFS2: replace count*size kzalloc by kcalloc GFS2: Use GFP_NOFS when allocating glocks ... Conflicts: drivers/media/dvb-frontends/si2168.c drivers/media/dvb-frontends/si2168_priv.h drivers/media/tuners/si2157.c
2014-07-22[media] media: davinci: vpif: fix array out of bound warningsPrabhakar Lad1-1/+1
This patch fixes following array out of bound warnings, drivers/media/platform/davinci/vpif_display.c: In function 'vpif_remove': drivers/media/platform/davinci/vpif_display.c:1389:36: warning: iteration 1u invokes undefined behavior [-Waggressive-loop-optimizations] vb2_dma_contig_cleanup_ctx(common->alloc_ctx); ^ drivers/media/platform/davinci/vpif_display.c:1385:2: note: containing loop for (i = 0; i < VPIF_DISPLAY_MAX_DEVICES; i++) { ^ drivers/media/platform/davinci/vpif_capture.c: In function 'vpif_remove': drivers/media/platform/davinci/vpif_capture.c:1581:36: warning: iteration 1u invokes undefined behavior [-Waggressive-loop-optimizations] vb2_dma_contig_cleanup_ctx(common->alloc_ctx); ^ drivers/media/platform/davinci/vpif_capture.c:1577:2: note: containing loop for (i = 0; i < VPIF_CAPTURE_MAX_DEVICES; i++) { ^ drivers/media/platform/davinci/vpif_capture.c:1580:23: warning: array subscript is above array bounds [-Warray-bounds] common = &ch->common[i]; Reported-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-17[media] v4l: Support extending the v4l2_pix_format structureLaurent Pinchart1-1/+0
The v4l2_pix_format structure has no reserved field. It is embedded in the v4l2_framebuffer structure which has no reserved fields either, and in the v4l2_format structure which has reserved fields that were not previously required to be zeroed out by applications. To allow extending v4l2_pix_format, inline it in the v4l2_framebuffer structure, and use the priv field as a magic value to indicate that the application has set all v4l2_pix_format extended fields and zeroed all reserved fields following the v4l2_pix_format field in the v4l2_format structure. The availability of this API extension is reported to userspace through the new V4L2_CAP_EXT_PIX_FORMAT capability flag. Just checking that the priv field is still set to the magic value at [GS]_FMT return wouldn't be enough, as older kernels don't zero the priv field on return. To simplify the internal API towards drivers zero the extended fields and set the priv field to the magic value for applications not aware of the extensions. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-04[media] media: remove the setting of the flag V4L2_FL_USE_FH_PRIORamakrishnan Muthukrishnan1-1/+0
Since all the drivers that use `struct v4l2_fh' use the core priority checking, the setting of the flag in the drivers can be removed. Signed-off-by: Ramakrishnan Muthukrishnan <ramakrmu@cisco.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-07-04[media] davinci: vpif: missing unlocks on errorDan Carpenter1-0/+1
We recently changed some locking around so we need some new unlocks on the error paths. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-25[media] media: davinci: vpif: Switch to pad-level DV operationsLaurent Pinchart1-1/+3
The video-level enum_dv_timings and dv_timings_cap operations are deprecated in favor of the pad-level versions. All subdev drivers implement the pad-level versions, switch to them. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-24[media] v4l: subdev: Move [gs]_std operation to video opsLaurent Pinchart1-1/+1
The g_std and s_std operations are video-related, move them to the video ops where they belong. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.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 <m.chehab@samsung.com>
2014-05-24[media] media: davinci: vpif: add Copyright messageLad, Prabhakar1-0/+1
Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] media: davinci: vpif_display: fix v4l-compliance issuesLad, Prabhakar1-87/+51
this patch does following, 1: sets initial default format during probe. 2: removes spurious messages. 3: optimize vpif_s/try_fmt_vid_out code. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2014-05-23[media] media: davinci: vpif_display: return -ENODATA for *std callsLad, Prabhakar1-1/+24
this patch adds supports to return -ENODATA to *std calls if the selected output does not support it. Signed-off-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>