summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform
Commit message (Collapse)AuthorAgeFilesLines
...
* | media: coda: set codec earlierPhilipp Zabel2019-04-221-8/+20
| | | | | | | | | | | | | | | | | | | | The chosen codec depends on the coded format, which is known as soon as the S_FMT call on the coded queue. This allows to use the codec in callbacks that may be called before start_streaming, such as buf_queue. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vivid: use vfree() instead of kfree() for dev->bitmap_capAlexander Potapenko2019-04-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | syzkaller reported crashes on kfree() called from vivid_vid_cap_s_selection(). This looks like a simple typo, as dev->bitmap_cap is allocated with vzalloc() throughout the file. Fixes: ef834f7836ec0 ("[media] vivid: add the video capture and output parts") Signed-off-by: Alexander Potapenko <glider@google.com> Reported-by: Syzbot <syzbot+6c0effb5877f6b0344e2@syzkaller.appspotmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: mtk-vcodec: fix vp9 content playback error with show exist frameMaoguang Meng2019-04-221-9/+7Star
| | | | | | | | | | | | | | | | | | | | Update referenced frame buffer's reference count when playing vp9 content which has show_existing_frame flag, and copy enough buffer data to current shown frame. Signed-off-by: Maoguang Meng <maoguang.meng@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: stm32-dcmi: fix crash when subdev do not expose any formatsHugues Fruchet2019-04-221-0/+6
| | | | | | | | | | | | | | | | | | Do not access sd_formats[] if num_of_sd_formats is zero, ie subdev sensor didn't expose any formats. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: stm32-dcmi: do not emit error trace in case of few overrunHugues Fruchet2019-04-221-4/+8
| | | | | | | | | | | | | | | | Report overrun error only when it exceeds a given threshold. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: stm32-dcmi: fix error messagesHugues Fruchet2019-04-221-2/+3
| | | | | | | | | | | | | | | | Revisit and add some error messages. Signed-off-by: Hugues Fruchet <hugues.fruchet@st.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: mtk-vcodec: enlarge struct vdec_pic_info fieldsYunfei Dong2019-04-225-40/+57
| | | | | | | | | | | | | | | | | | Enlarge the plane number to support more complex case and add the support for fmt change case. Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: propagate pixel format in the streamHelen Fornazier2019-04-228-342/+304Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Media bus codes were being mapped to pixelformats, which causes a limitation on vimc because not all pixelformats can be mapped to media bus codes. Also, media bus codes are an internal configuration from the device. Userspace only assures media bus codes matches between pads and expects the image in a given pixelformat. So we can allow almost any media bus format to be configured between pads, except for debayer that expects a media bus code of type bayer in the sink pad. [hverkuil-cisco@xs4all.nl: drop use of v4l2_get_fourcc_name: not yet available] [hverkuil-cisco@xs4all.nl: made vimc_mbus_list static] Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: platform: stm32: wait end of transmissionYannick Fertre2019-04-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | It is mandatory to write CEC_CFGR only when CECEN=0. To protect transmission, a check have been added to delayed logical address modification. This patch is necessary tp pass all tests of compliance. Signed-off-by: Yannick Fertré <yannick.fertre@st.com> Reviewed-by: Benjamin Gaignard <benjamin.gaignard@linaro.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: atmel: atmel-isc: removed ARGB32 added ABGR32 and XBGR32Eugen Hristev2019-04-221-4/+10
| | | | | | | | | | | | | | | | | | | | | | ISC will output the "ARGB32" configuration in byte order: B, G, R, Alpha. This is in fact the format BGRA, aka ABGR32. If alpha is missing, the same format is equivalent to XBGR32. Added both formats and removed ARGB32 which is wrong. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: atmel: atmel-isc: reworked driver and formatsEugen Hristev2019-04-221-417/+480
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is a redesign in the formats and the way the ISC is configured w.r.t. sensor format and the output format from the ISC. I have changed the splitting between sensor output (which is also ISC input) and ISC output. The sensor format represents the way the sensor is configured, and what ISC is receiving. The format configuration represents the way ISC is interpreting the data and formatting the output to the subsystem. Now it's much easier to figure out what is the ISC configuration for input, and what is the configuration for output. The non-raw format can be obtained directly from sensor or it can be done inside the ISC. The controller format list will include a configuration for each format. The old supported formats are still in place, if we want to dump the sensor format directly to the output, the try format routine will detect and configure the pipeline accordingly. This also fixes the previous issues when the raw format was NULL which resulted in many crashes for sensors which did not have the expected/tested formats. Signed-off-by: Eugen Hristev <eugen.hristev@microchip.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: replace strncpy() by strscpy()Mauro Carvalho Chehab2019-03-2915-25/+26
| | | | | | | | | | | | | | | | | | | | | | 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>
* | media: vim2m: Fix RGB 565 BE/LE supportMauro Carvalho Chehab2019-03-291-13/+17
| | | | | | | | | | | | | | The support for those two formats are archtecture-dependent. Use the endianness to CPU macros to do it right. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: video-mux: fix null pointer dereferencesKangjie Lu2019-03-291-0/+5
| | | | | | | | | | | | | | | | | | | | devm_kcalloc may fail and return a null pointer. The fix returns -ENOMEM upon failures to avoid null pointer dereferences. Signed-off-by: Kangjie Lu <kjlu@umn.edu> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: mtk-vcodec: remove ready_to_displayAlexandre Courbot2019-03-292-7/+0Star
| | | | | | | | | | | | | | | | This member is never read throughout the code, so remove it. Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: mtk-vcodec: fix access to incorrect planes memberAlexandre Courbot2019-03-292-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 0650a91499e0 ("media: mtk-vcodec: Correct return type for mem2mem buffer helpers") fixed the return types for mem2mem buffer helper functions by changing a few local variables from vb2_buffer to vb2_v4l2_buffer. However, it left a few accesses to vb2_buffer::planes as-is, accidentally turning them into accesses to vb2_v4l2_buffer::planes and resulting in values being read from/written to the wrong place. Fix this by inserting vb2_buf into these accesses so they mimic their original behavior. Fixes: 0650a91499e0 ("media: mtk-vcodec: Correct return type for mem2mem buffer helpers") Signed-off-by: Alexandre Courbot <acourbot@chromium.org> Reviewed-by: Ezequiel Garcia <ezequiel@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: davinci-isif: avoid uninitialized variable useArnd Bergmann2019-03-291-9/+0Star
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang warns about a possible variable use that gcc never complained about: drivers/media/platform/davinci/isif.c:982:32: error: variable 'frame_size' is uninitialized when used here [-Werror,-Wuninitialized] dm365_vpss_set_pg_frame_size(frame_size); ^~~~~~~~~~ drivers/media/platform/davinci/isif.c:887:2: note: variable 'frame_size' is declared here struct vpss_pg_frame_size frame_size; ^ 1 error generated. There is no initialization for this variable at all, and there has never been one in the mainline kernel, so we really should not put that stack data into an mmio register. On the other hand, I suspect that gcc checks the condition more closely and notices that the global isif_cfg.bayer.config_params.test_pat_gen flag is initialized to zero and never written to from any code path, so anything depending on it can be eliminated. To shut up the clang warning, just remove the dead code manually, it has probably never been used because any attempt to do so would have resulted in undefined behavior. Fixes: 63e3ab142fa3 ("V4L/DVB: V4L - vpfe capture - source for ISIF driver on DM365") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Nathan Chancellor <natechancellor@gmail.com> Acked-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: hfi_parser: don't trick gcc with a wrong expected sizeMauro Carvalho Chehab2019-03-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Smatch warns about small size on two structs: drivers/media/platform/qcom/venus/hfi_parser.c:103 parse_profile_level() error: memcpy() 'proflevel' too small (8 vs 128) drivers/media/platform/qcom/venus/hfi_parser.c: drivers/media/platform/qcom/venus/hfi_parser.c:129 parse_caps() error: memcpy() 'cap' too small (16 vs 512) The reason is that the hfi_parser actually expects: - multiple data entries on hfi_capabilities - multiple profile_level on hfi_profile_level_supported However, the structs trick gcc, making it to believe that there's just one value for each. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: rcar-dma: p_set can't be NULLMauro Carvalho Chehab2019-03-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The only way for p_set to be NULL would be if vin_coef_set would be an empty array. On such case, the driver will OOPS, as it would try to de-reference a NULL value. So, the check if p_set is not NULL doesn't make any sense. Solves those two smatch warnings: drivers/media/platform/rcar-vin/rcar-dma.c:489 rvin_set_coeff() warn: variable dereferenced before check 'p_set' (see line 484) drivers/media/platform/rcar-vin/rcar-dma.c:494 rvin_set_coeff() error: we previously assumed 'p_set' could be null (see line 489) Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: sti/delta: remove uneeded checkMauro Carvalho Chehab2019-03-251-4/+2Star
| | | | | | | | | | | | | | | | | | | | | | At the error logic, ipc_buf was already asigned to &ctx->ipc_buf_struct, with can't be null, as warned by smatch: drivers/media/platform/sti/delta/delta-ipc.c:223 delta_ipc_open() warn: variable dereferenced before check 'ctx->ipc_buf' (see line 183) So, remove the uneeded check. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: v4l: rcar_fdp1: Fix indentation odditiesLaurent Pinchart2019-03-251-14/+14
| | | | | | | | | | | | | | | | | | Indentation is odd in several places, especially when printing messages to the kernel log. Fix it to match the usual coding style. Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: set pixelformat to V4L2_PIX_FMT_FWHT_STATELESS for stateless ↵Dafna Hirschfeld2019-03-251-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | decoder for stateless decoder, set the output pixelformat to V4L2_PIX_FMT_FWHT_STATELESS and the pix info to pixfmt_stateless_fwht Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: Add support for stateless decoder.Dafna Hirschfeld2019-03-252-24/+264
| | | | | | | | | | | | | | | | | | Implement a stateless decoder for the new node. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: add 'return 0;' before default case in vicodec_try_ctrl()] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: Register another node for stateless decoderDafna Hirschfeld2019-03-251-4/+42
| | | | | | | | | | | | | | | | | | | | | | Add stateless decoder instance field to the dev struct and register another node for the statelsess decoder. The stateless API for the node will be implemented in further patches. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: fix typo: videdev-stateless-dec -> stateless-decoder] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: Introducing stateless fwht defs and structsDafna Hirschfeld2019-03-251-28/+13Star
| | | | | | | | | | | | | | | | | | | | Add structs and definitions needed to implement stateless decoder for fwht and add I/P-frames QP controls to the public api. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: add struct for encoder/decoder instanceDafna Hirschfeld2019-03-251-102/+92Star
| | | | | | | | | | | | | | | | | | Add struct 'vicodec_dev_instance' for the fields in vicodec_dev that have have both decoder and encoder versions. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: Handle the case that the reference buffer is NULLDafna Hirschfeld2019-03-252-4/+16
| | | | | | | | | | | | | | | | | | | | In the stateless decoder the reference buffer is null if the frame is an I-frame (flagged with FWHT_FL_I_FRAME). Make sure not to dereference it in that case. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: rename v4l2_fwht_default_fmt to v4l2_fwht_find_nth_fmtDafna Hirschfeld2019-03-253-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | Rename 'v4l2_fwht_default_fmt' to 'v4l2_fwht_find_nth_fmt' and add a function 'v4l2_fwht_validate_fmt' to check if a format info matches the parameters. This function will also be used to validate the stateless params when adding support for stateless codecs. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: Validate version dependent header values in a separate functionDafna Hirschfeld2019-03-251-12/+19
| | | | | | | | | | | | | | | | | | Move the code that validates version dependent header values to a separate function 'validate_by_version' Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: keep the ref frame according to the format in decoderDafna Hirschfeld2019-03-255-268/+122Star
| | | | | | | | | | | | | | | | | | | | | | | | In the decoder, save the inner reference frame in the same format as the capture buffer. The decoder writes directly to the capture buffer and then the capture buffer is copied to the reference buffer. This will simplify the stateless decoder. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: add field 'buf' to fwht_raw_frameDafna Hirschfeld2019-03-252-2/+6
| | | | | | | | | | | | | | | | | | | | | | Add the field 'buf' to fwht_raw_frame to indicate the start of the raw frame buffer. This field will be used to copy the capture buffer to the reference buffer in the next patch. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: Move raw frame preparation code to a functionDafna Hirschfeld2019-03-251-65/+78
| | | | | | | | | | | | | | | | | | Introduce 'prepare_raw_frame' function that fills the values of a raw frame struct according to the format. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: bugfix: free compressed_frame upon device releaseDafna Hirschfeld2019-03-251-0/+1
| | | | | | | | | | | | | | | | Free compressed_frame buffer upon device release. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: bugfix - call v4l2_m2m_buf_copy_metadata also if decoding failsDafna Hirschfeld2019-03-251-8/+9
| | | | | | | | | | | | | | | | | | | | | | The function 'v4l2_m2m_buf_copy_metadata' should be called even if decoding/encoding ends with status VB2_BUF_STATE_ERROR, so that the metadata is copied from the source buffer to the dest buffer. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: change variable name for the return value of v4l2_fwht_encodeDafna Hirschfeld2019-03-251-4/+5
| | | | | | | | | | | | | | | | | | | | | | v4l2_fwht_encode returns either an error code on failure or the size of the compressed frame on success. So change the var assigned to it from 'ret' to 'comp_sz_or_errcode' to clarify that. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: upon release, call m2m release before freeing ctrl handlerDafna Hirschfeld2019-03-251-3/+3
| | | | | | | | | | | | | | | | | | 'v4l2_m2m_ctx_release' calls request complete so it should be called before 'v4l2_ctrl_handler_free'. Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: fix g_selection: either handle crop or composeHans Verkuil2019-03-251-5/+17
| | | | | | | | | | | | | | | | The logic of g_selection was wrong: encoders support crop, decoders support compose, but the code allowed both. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: selection api should only check single buffer typesDafna Hirschfeld2019-03-251-17/+3Star
| | | | | | | | | | | | | | | | | | | | The selection api should check only single buffer types because multiplanar types are converted to single in drivers/media/v4l2-core/v4l2-ioctl.c Signed-off-by: Dafna Hirschfeld <dafna3@gmail.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: Kconfig files: use the right help coding styleMauro Carvalho Chehab2019-03-209-49/+49
| | | | | | | | | | | | | | | | | | | | | | Checkpatch wants to use 'help' instead of '---help---': WARNING: prefer 'help' over '---help---' for new help texts Let's change it globally at the media subsystem, as otherwise people would keep using the old way. Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: ti-vpe: Parse local endpoint for properties, not the remote oneSakari Ailus2019-03-201-10/+2Star
| | | | | | | | | | | | | | | | ti-vpe driver parsed the remote endpoints for properties but ignored the local ones. Fix this by parsing the local endpoint properties instead. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: pxa-camera: Match with device node, not the port nodeSakari Ailus2019-03-201-1/+1
| | | | | | | | | | | | | | | | V4L2 fwnode matching right now still works based on device nodes, not port nodes. Fix this. Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: reset last_src/dst_buf based on the IS_OUTPUTHans Verkuil2019-03-201-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When start_streaming was called both last_src_buf and last_dst_buf pointers were set to NULL, but this depends on whether the capture or output queue starts streaming. When decoding with resolution changes in between the capture queue has to restart streaming whenever a resolution change occurs. And that would reset last_src_buf as well, which causes a problem if the decoder was stopped by the application. Since last_src_buf is now NULL, the LAST flag is never set for the last capture buffer. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: remove WARN_ON(1) from get_q_data()Hans Verkuil2019-03-201-1/+0Star
| | | | | | | | | | | | | | | | | | Some functions like enum_fmt use the buffer type as was passed from userspace, which might cause the switch to fall into the default case. Just drop the WARN_ON(1) to avoid kernel log pollution. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: stream: init/terminate the first entityHelen Fornazier2019-03-191-10/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The s_stream callback was not being called for the first entity in the stream pipeline array. Instead of verifying the type of the node (video or subdevice) and calling s_stream from the second entity in the pipeline, do this process for all the entities in the pipeline for consistency. The previous code was not a problem because the first entity is a video device and not a subdevice, but this patch prepares vimc to allow setting some configuration in the entity before calling s_stream. Signed-off-by: Helen Koike <helen.koike@collabora.com> Tested-by: André Almeida <andre.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> [hverkuil-cisco@xs4all.nl: fix line-too-long warning] Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: stream: add docs to struct vimc_streamHelen Fornazier2019-03-191-0/+15
| | | | | | | | | | | | | | | | Add missing documentation for struct vimc_stream Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: stream: cleanup frame field from struct vimc_streamHelen Fornazier2019-03-192-7/+4Star
| | | | | | | | | | | | | | | | | | There is no need to have the frame field in the vimc_stream struct. Signed-off-by: Helen Koike <helen.koike@collabora.com> Tested-by: André Almeida <andre.almeida@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: cap: fix step width/height in enum framesizeHelen Fornazier2019-03-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | The type V4L2_FRMSIZE_TYPE_CONTINUOUS expects a step of 1. This fixes v4l2-compliance test error: fail: v4l2-test-formats.cpp(184): invalid step_width/height for continuous framesize test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: FAIL Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: stream: fix thread state before sleepHelen Fornazier2019-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The state TASK_UNINTERRUPTIBLE should be set just before schedule_timeout() call, so it knows the sleep mode it should enter. There is no point in setting TASK_UNINTERRUPTIBLE at the initialization of the thread as schedule_timeout() will set the state back to TASK_RUNNING. This fixes a warning in __might_sleep() call, as it's expecting the task to be in TASK_RUNNING state just before changing the state to a sleeping state. Reported-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vimc: deb: fix default sink bayer formatHelen Fornazier2019-03-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | The format of the sink pad should be a bayer mbus format. This fixes a kernel NULL pointer dereference error that was caused when the stream starts because the configured format was not found in the pixelmap table. Reported-by: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Helen Koike <helen.koike@collabora.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
* | media: vicodec: avoid clang frame size warningArnd Bergmann2019-03-191-11/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang-9 makes some different inlining decisions compared to gcc, which leads to a warning about a possible stack overflow problem when building with CONFIG_KASAN, including when setting asan-stack=0, which avoids most other frame overflow warnings: drivers/media/platform/vicodec/codec-fwht.c:673:12: error: stack frame size of 2224 bytes in function 'encode_plane' Manually adding noinline_for_stack annotations in those functions called by encode_plane() or decode_plane() that require a significant amount of kernel stack makes this impossible to happen with any compiler. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>