summaryrefslogtreecommitdiffstats
path: root/drivers/staging/media/omap4iss/iss_resizer.c
Commit message (Collapse)AuthorAgeFilesLines
* media: staging: media: omap4iss: Added SPDX license identifiersDaniel Graefe2018-09-121-5/+1
| | | | | | | | | | | | | | | | Added missing SPDX license identifiers to all files of the omap4iss driver. Most files already have license texts which clearly state them to be licensed under GPL 2.0 or later. SPDX identifiers were added accordingly. Some files do not have any license text. SPDX identifiers for GPL 2.0 were added to them, in accordance with the default license of the kernel. Signed-off-by: Daniel Graefe <daniel.graefe@fau.de> Signed-off-by: Roman Sommer <roman.sommer@fau.de> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* media: use strscpy() instead of strlcpy()Mauro Carvalho Chehab2018-09-111-1/+1
| | | | | | | | | | | 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>
* [media] staging: media: omap4iss: Replace a bit shift by a use of BITArushi Singhal2017-04-181-1/+1
| | | | | | | | | | | | | | This patch replaces bit shifting on 1 with the BIT(x) macro. This was done with coccinelle: @@ constant c; @@ -1 << c +BIT(c) Signed-off-by: Arushi Singhal <arushisinghal19971997@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
* [media] staging: omap4iss: remove pads prefix from *_create_pads_links()Javier Martinez Canillas2016-01-111-2/+2
| | | | | | | | | | The functions that create ISS internal and external entities links are called *_create_pads_links() but the "pads" prefix is redundant since the driver doesn't handle any other kind of link so it can be removed. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: use unsigned for pad indexMauro Carvalho Chehab2016-01-111-1/+1
| | | | | | | | The pad index is unsigned. Replace the occurences of it where pertinent. Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media framework: rename pads init function to media_entity_pads_init()Mauro Carvalho Chehab2016-01-111-1/+1
| | | | | | | | | | | | | | | | | With the MC next gen rework, what's left for media_entity_init() is to just initialize the PADs. However, certain devices, like a FLASH led/light doesn't have any input or output PAD. So, there's no reason why calling media_entity_init() would be mandatory. Also, despite its name, what this function actually does is to initialize the PADs data. So, rename it to media_entity_pads_init() in order to reflect that. The media entity actual init happens during entity register, at media_device_register_entity(). We should move init of num_links and num_backlinks to it. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] omap3/omap4/davinci: get rid of MEDIA_ENT_T_V4L2_SUBDEV abuseMauro Carvalho Chehab2016-01-111-3/+8
| | | | | | | | | | | | | | On omap3/omap4/davinci drivers, MEDIA_ENT_T_V4L2_SUBDEV macro is abused in order to "simplify" the pad checks. Basically, it does a logical or of this macro, in order to check for a local index and if the entity is either a subdev or not. As we'll get rid of MEDIA_ENT_T_V4L2_SUBDEV macro, replace it by 2 << 16 where it occurs, and add a note saying that the code there is actually a hack. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] staging: omap4iss: separate links creation from entities initJavier Martinez Canillas2016-01-111-12/+17
| | | | | | | | | | | | | | The omap4iss driver initializes the entities and creates the pads links before the entities are registered with the media device. This does not work now that object IDs are used to create links so the media_device has to be set. Split out the pads links creation from the entity initialization so are made after the entities registration. Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: rename the function that create pad linksMauro Carvalho Chehab2016-01-111-1/+1
| | | | | | | | | | | | | | | | | With the new API, a link can be either between two PADs or between an interface and an entity. So, we need to use a better name for the function that create links between two pads. So, rename the such function to media_create_pad_link(). No functional changes. This patch was created via this shell script: for i in $(find drivers/media -name '*.[ch]' -type f) $(find drivers/staging/media -name '*.[ch]' -type f) $(find include/ -name '*.h' -type f) ; do sed s,media_entity_create_link,media_create_pad_link,g <$i >a && mv a $i; done Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Tested-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] media: get rid of unused "extra_links" param on media_entity_init()Mauro Carvalho Chehab2016-01-111-1/+1
| | | | | | | | | | | | | | | | | | Currently, media_entity_init() creates an array with the links, allocated at init time. It provides a parameter (extra_links) that would allocate more links than the current needs, but this is not used by any driver. As we want to be able to do dynamic link allocation/removal, we'll need to change the implementation of the links. So, before doing that, let's first remove that extra unused parameter, in order to cleanup the interface first. Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] omap4iss: Fix overlapping luma/chroma planesNate Weibley2015-11-191-2/+2
| | | | | | | | | | The chroma data base address for NV12 formatted data should begin offset rows*bytes_per_row from the base address for luminance data. We were OBO causing a stripe of green pixels at the bottom of the frame. Signed-off-by: Nate Weibley <nweibley@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* staging: media: omap4iss: Matches alignment with open parenthesisAmarjargal Gundjalam2015-10-271-8/+8
| | | | | | | | | This patch fixes some of the checkpatch issue: CHECK: Alignment should match open parenthesis Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: media: omap4iss: Removes unnecessary blank linesAmarjargal Gundjalam2015-10-271-2/+0
| | | | | | | | | | This patch fixes checkpatch issues: CHECK: Blank lines aren't necessary before a close brace '}' CHECK: Please don't use multiple blank lines Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: media: omap4iss: Fixes misspellingAmarjargal Gundjalam2015-10-271-2/+2
| | | | | | | | | This patch fixes the checkpatch issue: CHECK: 'splitted' may be misspelled - perhaps 'split'? Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* staging: media: omap4iss: Fixes NULL comparisonAmarjargal Gundjalam2015-10-271-3/+3
| | | | | | | | | This patch fixes the checkpatch issue: CHECK: Comparison to NULL could be written Signed-off-by: Amarjargal Gundjalam <amarjargal.gundjalam@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* [media] staging: media: omap4iss: Reformat overly long linesPiotr S. Staszewski2015-06-091-3/+5
| | | | | | | | This reformats lines that were previously above 80 characters long, improving readability and making checkpatch.pl happier. Signed-off-by: Piotr S. Staszewski <p.staszewski@gmail.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] staging: media: omap4iss: Cleanup media entities after unregistrationLaurent Pinchart2015-04-021-3/+3
| | | | | | | | | The ipipeif, ipipe and resizer media entities are cleaned up before unregistering the media device, creating a race condition. Fix it by cleaning them up at cleanup time. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-subdev: add support for the new enum_frame_size 'which' fieldHans Verkuil2015-03-231-4/+2
| | | | | | | | | | | | | | Support the new 'which' field in the enum_frame_size ops. Most drivers do not need to be changed since they always returns the same enumeration regardless of the 'which' field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Andrzej Hajda <a.hajda@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-subdev: support new 'which' field in enum_mbus_codeHans Verkuil2015-03-231-1/+1
| | | | | | | | | | | Support the new 'which' field in the enum_mbus_code ops. Most drivers do not need to be changed since they always return the same enumeration regardless of the 'which' field. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l2-subdev: replace v4l2_subdev_fh by v4l2_subdev_pad_configHans Verkuil2015-03-231-21/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a subdevice pad op is called from a bridge driver, then there is no v4l2_subdev_fh struct that can be passed to the subdevice. This made it hard to use such subdevs from a bridge driver. This patch replaces the v4l2_subdev_fh pointer by a v4l2_subdev_pad_config pointer in the pad ops. This allows bridge drivers to use the various try_ pad ops by creating a v4l2_subdev_pad_config struct and passing it along to the pad op. The v4l2_subdev_get_try_* macros had to be changed because of this, so I also took the opportunity to use the full name of the v4l2_subdev_get_try_* functions in the __V4L2_SUBDEV_MK_GET_TRY macro arguments: if you now do 'git grep v4l2_subdev_get_try_format' you will actually find the header where it is defined. One remark regarding the drivers/staging/media/davinci_vpfe patches: the *_init_formats() functions assumed that fh could be NULL. However, that's not true for this driver, it's always set. This is almost certainly a copy and paste from the omap3isp driver. I've updated the code to reflect the fact that fh is never NULL. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] v4l: omap4iss: Remove bogus frame number propagationLaurent Pinchart2014-12-231-17/+1
| | | | | | | | | | | | | | Frame number propagation tries to increase the robustness of the frame number counter by using sources less likely to be missed than the end of frame interrupts, such as hardware frame counters or start of frame interrupts. Increasing the frame number in the IPIPE ISIF and resizer end of frame interrupt handlers is pointless as it doesn't bring any improvement. Don't do it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
* [media] staging: media: Make use of MEDIA_BUS_FMT_ definitionsBoris BREZILLON2014-11-141-13/+13
| | | | | | | | | | | | | | | In order to have subsytem agnostic media bus format definitions we've moved media bus definition to include/uapi/linux/media-bus-format.h and prefixed values with MEDIA_BUS_FMT instead of V4L2_MBUS_FMT. Reference new definitions in all media drivers residing in staging. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Sakari Ailus <sakari.ailus@linux.intel.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@osg.samsung.com>
* staging: media: omap4iss: Removed unnecessary else expression.Gulsah Kose2014-09-281-2/+1
| | | | | | | | This patch fixes "else is not generally useful after a break or return" checkpatch.pl warning iss_resizer.c Signed-off-by: Gulsah Kose <gulsah.1004@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* [media] v4l: omap4iss: resizer: Fix comment regarding bypass modeLaurent Pinchart2013-12-111-1/+3
| | | | | | | The comment explaining the usage of the bypass bit is wrong, fix it. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Cancel streaming when a fatal error occursLaurent Pinchart2013-12-111-1/+1
| | | | | | | | | | | When a fatal error that prevents any further video streaming occurs in a pipeline, all queued buffers must be marked as erroneous and new buffers must be prevented from being queued. Implement this behaviour with a new omap4iss_pipeline_cancel_stream() function that can be used by submodules to cancel streaming. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Enable/disabling the ISP interrupts globallyLaurent Pinchart2013-12-111-3/+0
| | | | | | | | | | ISP interrupts are enabled/disabled when starting/stopping the IPIPEIF or resizer. This doesn't permit using the two modules in separate pipelines. Fix it by enabling/disabling the ISP interrupts at the same time as the ISS interrupts, in the ISS device get/put operations. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Propagate stop timeouts from submodules to the driver ↵Laurent Pinchart2013-12-111-2/+1
| | | | | | | | | | | core Return an error from the s_stream handlers when stopping the stream failed instead of just logging the error and ignoring it. While we're at it, move the logging code from submodules to the driver code. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: resizer: Stop the whole resizer to avoid FIFO overflowsLaurent Pinchart2013-12-111-3/+5
| | | | | | | | | When stopping the resizer due to a buffer underrun, disabling RZA only produces input FIFO overflows, most probably when the next frame is received. Disable the whole resizer to work around the problem. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Create and use register access functionsLaurent Pinchart2013-12-111-90/+76
| | | | | | | | | Replace the direct readl/writel calls with helper functions that take an ISS pointer and compute the register memory address. Also add bit clear, set and update helpers. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Fix operators precedence in ternary operatorsLaurent Pinchart2013-12-111-7/+5
| | | | | | | | The ternary operator ? : has a low precedence. Use parenthesis where needed. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Define more ISS and ISP IRQ register bitsLaurent Pinchart2013-12-111-2/+2
| | | | | | | | Add more register definitions at iss_regs.h and improve some register names. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Restrict line lengths to 80 characters where possibleLaurent Pinchart2013-12-111-20/+27
| | | | | | | Pure CodingStyle fixes. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Don't split log strings on multiple linesLaurent Pinchart2013-12-111-4/+1
| | | | | | | Non-split strings help grepping for messages. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] v4l: omap4iss: Add support for OMAP4 camera interface - ResizerSergio Aguirre2013-12-031-0/+905
This adds a very simplistic driver to utilize the CSI2A interface inside the ISS subsystem in OMAP4, and dump the data to memory. Check Documentation/video4linux/omap4_camera.txt for details. This commit adds resizer support. [Port the driver to v3.12-rc3, including the following changes - Don't include plat/ headers - Don't use cpu_is_omap44xx() macro - Don't depend on EXPERIMENTAL - Fix s_crop operation prototype - Update link_notify prototype - Rename media_entity_remote_source to media_entity_remote_pad] Signed-off-by: Sergio Aguirre <sergio.a.aguirre@gmail.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>