aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda/coda-bit.c (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-04-22media: coda: clear error return value before picture runPhilipp Zabel1-0/+3
The error return value is not written by some firmware codecs, such as MPEG-2 decode on CodaHx4. Clear the error return value before starting the picture run to avoid misinterpreting unrelated values returned by sequence initialization as error return value. 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>
2019-01-21media: coda: fix decoder capture buffer payloadPhilipp Zabel1-16/+2
It is not correct to calculate decoder capture payload dynamically from the decoded frame width and height reported by the firmware. These tell us what the decoder wrote into the internal framebuffers. The rotator or VDOA always write the full sizeimage when copying the previously decoded frame from the internal framebuffers into the capture 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>
2019-01-16media: coda: Add control for h.264 chroma qp index offsetPhilipp Zabel1-1/+3
Allow to set a fixed quantization parameter offset between luma and chroma in the h.264 encoder. 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>
2019-01-16media: coda: Add control for h.264 constrained intra predictionPhilipp Zabel1-1/+3
Allow to enable constrained intra prediction in the h.264 encoder. 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>
2018-12-07media: coda: fix H.264 deblocking filter controlsPhilipp Zabel1-10/+9
Add support for the third loop filter mode V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY, and fix V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA and V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA controls. The filter offset controls are signed values in the -6 to 6 range and are stored into the slice header fields slice_alpha_c0_offset_div2 and slice_beta_offset_div2. The actual filter offsets FilterOffsetA/B are double their value, in range of -12 to 12. Rename variables to more closely match the nomenclature in the H.264 specification. 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>
2018-11-23media: coda: normalise debug outputPhilipp Zabel1-31/+24
Consistently add the context index to debug output, which otherwise is impossible to make sense of when two contexts are running concurrently. For this purpose, add a convenience macro coda_dbg(). Use the function name with the coda_ prefix stripped as keyword where applicable, and consistently use vid-out and vid-cap names for the queues. Add sequence counters to the decoder job finished message and correctly indicate B frames. Add a start streaming message to complement the stop streaming message and a start encoding message to complement the existing start decoding message. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: coda: print SEQ_INIT error code as hex valueMichael Tretter1-1/+1
The error code looks much more like a bit field than an error value. Print it as hex rather than decimal. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: coda: don't disable IRQs across buffer meta handlingLucas Stach1-12/+7
The CODA driver uses threaded IRQs only, so there is nothing happening in hardirq context that could interfere with the buffer meta handling. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: coda: limit queueing into internal bitstream bufferLucas Stach1-0/+28
The ringbuffer used to hold the bitstream is very conservatively sized, as keyframes can get very large and still need to fit into this buffer. This means that the buffer is way oversized for the average stream to the extend that it will hold a few hundred frames when the video data is compressing well. The current strategy of queueing as much bitstream data as possible leads to large delays when draining the decoder. In order to keep the drain latency to a reasonable bound, try to only queue a full reorder window of buffers. We can't always hit this low target for very well compressible video data, as we might end up with less than the minimum amount of data that needs to be available to the bitstream prefetcher, so we must take this into account and allow more buffers to be queued in this case. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-11-23media: coda: store unmasked fifo position in metaPhilipp Zabel1-6/+3
Storing the unmasked kfifo->in position as meta->start and ->end allows to more easily compare a point past meta->end with the current kfifo->in. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: coda: add SPS fixup code for frame sizes that are not multiples of 16Philipp Zabel1-0/+21
The CODA7541 firmware does not set the SPS frame cropping fields to properly describe coded h.264 streams with frame sizes that are not a multiple of the macroblock size. This adds RBSP parsing code and a SPS fixup routine to manually replace the cropping information in the headers produced by the firmware with the correct values. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> [hans.verkuil@cisco.com: added explanation of SPS RBSP to comment] Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-27media: coda: let CODA960 firmware set frame cropping in SPS headerPhilipp Zabel1-0/+19
When encoding h.264, if visible resolution is not aligned to macroblock size, frame cropping has to be set in the SPS header to produce correct streams. The CODA960 firmware can do this on its own if asked to. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-25media: coda: use encoder crop rectangle to set visible width and heightPhilipp Zabel1-12/+12
Allow to set a crop rectangle on the encoder output queue to set the visible resolution as required by the V4L2 codec API. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-25media: coda: streamline framebuffer size calculation a bitPhilipp Zabel1-9/+5
Remove the intermediate width and height variables, the calculation is simple enough. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-25media: coda: move framebuffer size calculation out of loopPhilipp Zabel1-6/+7
All internal YCbCr frame buffers are the same size, calculate ycbcr_size once before the allocation loop. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-04media: coda: mark CODA960 firmware version 2.1.9 as supportedPhilipp Zabel1-0/+1
This patch adds the i.MX6 CODA960 firmware versions 2.1.9 (revision 32515) to the list of supported firmware versions. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-04media: coda: jpeg: explicitly disable thumbnails in SEQ_INITPhilipp Zabel1-0/+2
Explicitly clear DEC_SEQ_JPG_THUMB_EN during sequence initialization. Not clearing the register does not cause problems, since the only other codec (MPEG-4 decode) that writes to this register happens to always write 0 as well. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-04media: coda: jpeg: only queue two buffers into the bitstream for JPEG on CODA7541Philipp Zabel1-3/+4
Padding the bitstream buffer is not enough to reliably avoid prefetch failures. Picture runs with the next buffer's header already visible to the CODA7541 succeed much more reliably, so always queue two JPEG frames into the bitstream buffer. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-04media: coda: fix reorder detection for unknown levelsPhilipp Zabel1-21/+4
Whether reordering should be enabled only depends on the h.264 profile. Stop parsing the level and drop the debug message, profile and level can now be determined via read-only decoder controls. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-07-04media: coda: fix encoder source stridePhilipp Zabel1-1/+2
The encoder picture run command takes a picture source stride parameter. This must be set to the output queue's bytesperline, not width. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
2018-02-26media: coda: Add i.MX51 (CodaHx4) supportPhilipp Zabel1-12/+34
Add support for the CodaHx4 VPU used on i.MX51. Decoding h.264, MPEG-4, and MPEG-2 video works, as well as encoding h.264. MPEG-4 encoding is not enabled, it currently produces visual artifacts. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> [hans.verkuil@cisco.com: fix (bogus) sparse warning about uninited me_bits] Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-18media: coda: use correct offset for mpeg4 decoder mvcol bufferPhilipp Zabel1-9/+7
The mvcol buffer needs to be placed behind the chroma plane(s) when decoding MPEG-4, same as for the h.264 decoder. Use the real offset with the required rounding. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-18media: coda: allocate space for mpeg4 decoder mvcol bufferPhilipp Zabel1-2/+4
The MPEG-4 decoder mvcol buffer was registered, but its size not added to a frame buffer allocation. This could cause the decoder to write past the end of the allocated buffer for large frame sizes. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-12-18media: coda: round up frame sizes to multiples of 16 for MPEG-4 decoderPhilipp Zabel1-0/+1
We need internal frames to be rounded up to full macroblocks for MPEG-4 decoding as well. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-10-27media: coda: Handle return value of kasprintfArvind Yadav1-0/+4
kasprintf() can fail here and we must check its return value. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2017-08-08media: coda: fix decoder sequence init escape flagPhilipp Zabel1-8/+5
coda_command_sync calls coda_command_async, which writes the bit_stream_param context variable into the BIT_STREAM_PARAM register, overwriting the previously set value during coda_start_decoding. Instead of writing to the register, set bit_stream_param to ensure that the decoder sequence init command is executed with the escape flag set. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: coda: mark CODA960 firmware versions 2.3.10 and 3.1.1 as supportedPhilipp Zabel1-0/+2
Firmware versions 2.3.10 revision 40778 and 3.1.1 revision 46072 are contained in the i.MX firmware download archives provided by NXP at http://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-3.5.7-1.0.0.bin and http://www.nxp.com/lgfiles/NMG/MAD/YOCTO/firmware-imx-5.4.bin, respectively. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: coda: set MPEG-4 encoder class registerPhilipp Zabel1-0/+4
Explicitly set MPEG-4 encoder class register instead of relying on the default value of 0. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: coda: align internal mpeg4 framebuffers to 16x16 macroblocksPhilipp Zabel1-1/+2
This fixes visual artifacts in the first macroblock row of encoded MPEG-4 video output caused by 8 additional lines of luma data leaking into the chroma planes of the internal reference framebuffers: the buffer size is rounded up to a multiple of 16x16 macroblock size, same as for the h.264 encoder. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: coda: set field of destination buffersPhilipp Zabel1-0/+2
Set the field of destination buffers properly. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-07-19media: coda: extend GOP size rangePhilipp Zabel1-2/+3
CodaDx6 only accepts GOP sizes up to 60 frames, but CODA960 can handle up to 99 frames. If we disable automatic I frame generation altogether by setting GOP size to 0, we can let an application produce arbitrarily large I frame intervals using the V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME control. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: coda: rename the picture run timeout error handlerPhilipp Zabel1-2/+2
I would have liked the the picture run timeout error handler to be renamed to something a bit more descriptive in the original commit fb2be08f8cb3 ("[media] coda: first step at error recovery"). Somehow v1 [1] was merged instead of v2 [2]. [1] https://patchwork.kernel.org/patch/9663965/ [2] https://patchwork.kernel.org/patch/9774239/ Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-24media: coda: ctx->codec is not NULL in coda_alloc_framebuffersPhilipp Zabel1-2/+2
This fixes a smatch warning: drivers/media/platform/coda/coda-bit.c:415 coda_alloc_framebuffers() error: we previously assumed 'ctx->codec' could be null (see line 396) coda_alloc_framebuffers() is called from coda_start_encoding() and __coda_start_decoding(). Both dereference ctx->codec before calling coda_alloc_framebuffers() in lines 935 and 1649, so ctx->codec can not be NULL. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] coda: first step at error recoveryLucas Stach1-0/+20
This implements a simple handler for the case where decode did not finish sucessfully. This might be helpful during normal streaming, but for now it only handles the case where the context would deadlock with userspace, i.e. userspace issued DEC_CMD_STOP and waits for EOS, but after the failed decode run we would hold the context and wait for userspace to queue more buffers. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-20[media] coda: use correct offset for mvcol bufferLucas Stach1-4/+4
The mvcol buffer needs to be placed behind the chroma plane(s), so use the real offset including any required rounding. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hansverk@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07[media] coda: copy headers in front of every I-framePhilipp Zabel1-4/+5
That way we don't have to rely on userspace to inject the headers on IDR requests, and there is always enough information to start decoding at an I-frame. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-06-07[media] coda: implement forced key framesPhilipp Zabel1-4/+8
Implement the V4L2_CID_MPEG_VIDEO_FORCE_KEY_FRAME control to force IDR frames. This is useful to implement VFU (Video Fast Update) on RTP transmissions. We already force an IDR frame at the beginning of each GOP to work around a firmware bug on i.MX27, use the same mechanism to service IDR requests from userspace. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-22[media] coda: disable reordering for baseline profile h.264 streamsPhilipp Zabel1-2/+42
With reordering enabled, the sequence init in CODA960 firmware requests an unreasonable number of internal frames for some baseline profile streams. Disabling the reordering feature manually if baseline streams are detected fixes this problem. Signed-off-by: Lucas Stach <l.stach@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-22[media] coda: pad first h.264 buffer to 512 bytesPhilipp Zabel1-2/+26
The bitstream reader needs 512 bytes ready to read to examine the headers in the first frame. If that frame is too small, prepend it with a filler NAL. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-03-22[media] coda: keep queued buffers on a temporary list during start_streamingPhilipp Zabel1-6/+22
Keeping buffers filled into the bitstream on a temporary list instead of immediately calling vb2_buffer_done on each of them immediately allows start_streaming to correctly decide whether they should be marked as done or requeued if an error occurs after the bitstream has been filled. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: support YUYV output if VDOA is usedMichael Tretter1-2/+5
The VDOA is able to transform the NV12 custom macroblock tiled format of the CODA to YUYV format. If and only if the VDOA is available, the driver can also provide YUYV support. While the driver is configured to produce YUYV output, the CODA must be configured to produce NV12 macroblock tiled frames and the VDOA must transform the intermediate result into the final YUYV output. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: use VDOA for un-tiling custom macroblock formatMichael Tretter1-25/+61
If the CODA driver is configured to produce NV12 output and the VDOA is available, the VDOA can be used to transform the custom macroblock tiled format to a raster-ordered format for scanout. In this case, set the output format of the CODA to the custom macroblock tiled format, disable the rotator, and use the VDOA to write to the v4l2 buffer. The VDOA is synchronized with the CODA to always un-tile the frame that the CODA finished in the previous run. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2017-01-31[media] coda: fix frame index to returned errorMichael Tretter1-1/+1
display_idx refers to the frame that will be returned in the next round. The currently processed frame is ctx->display_idx and errors should be reported for this frame. Signed-off-by: Michael Tretter <m.tretter@pengutronix.de> Acked-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-03-16Merge tag 'media/v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-mediaLinus Torvalds1-1/+1
Pull media updates from Mauro Carvalho Chehab: - Added support for some new video formats - mn88473 DVB frontend driver got promoted from staging - several improvements at the VSP1 driver - several cleanups and improvements at the Media Controller - added Media Controller support to snd-usb-audio. Currently, enabled only for au0828-based V4L2/DVB boards - Several improvements at nuvoton-cir: it now supports wake up codes - Add media controller support to em28xx and saa7134 drivers - coda driver now accepts NXP distributed firmware files - Some legacy SoC camera drivers will be moving to staging, as they're outdated and nobody so far is willing to fix and convert them to use the current media framework - As usual, lots of cleanups, improvements and new board additions. * tag 'media/v4.6-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (381 commits) media: au0828 disable tuner to demod link in au0828_media_device_register() [media] touptek: cast char types on %x printk [media] touptek: don't DMA at the stack [media] mceusb: use %*ph for small buffer dumps [media] v4l: exynos4-is: Drop unneeded check when setting up fimc-lite links [media] v4l: vsp1: Check if an entity is a subdev with the right function [media] hide unused functions for !MEDIA_CONTROLLER [media] em28xx: fix Terratec Grabby AC97 codec detection [media] media: add prefixes to interface types [media] media: rc: nuvoton: switch attribute wakeup_data to text [media] v4l2-ioctl: fix YUV422P pixel format description [media] media: fix null pointer dereference in v4l_vb2q_enable_media_source() [media] v4l2-mc.h: fix yet more compiler errors [media] staging/media: add missing TODO files [media] media.h: always start with 1 for the audio entities [media] sound/usb: Use meaninful names for goto labels [media] v4l2-mc.h: fix compiler warnings [media] media: au0828 audio mixer isn't connected to decoder [media] sound/usb: Use Media Controller API to share media resources [media] dw2102: add support for TeVii S662 ...
2016-03-09dma, mm/pat: Rename dma_*_writecombine() to dma_*_wc()Luis R. Rodriguez1-5/+5
Rename dma_*_writecombine() to dma_*_wc(), so that the naming is coherent across the various write-combining APIs. Keep the old names for compatibility for a while, these can be removed at a later time. A guard is left to enable backporting of the rename, and later remove of the old mapping defines seemlessly. Build tested successfully with allmodconfig. The following Coccinelle SmPL patch was used for this simple transformation: @ rename_dma_alloc_writecombine @ expression dev, size, dma_addr, gfp; @@ -dma_alloc_writecombine(dev, size, dma_addr, gfp) +dma_alloc_wc(dev, size, dma_addr, gfp) @ rename_dma_free_writecombine @ expression dev, size, cpu_addr, dma_addr; @@ -dma_free_writecombine(dev, size, cpu_addr, dma_addr) +dma_free_wc(dev, size, cpu_addr, dma_addr) @ rename_dma_mmap_writecombine @ expression dev, vma, cpu_addr, dma_addr, size; @@ -dma_mmap_writecombine(dev, vma, cpu_addr, dma_addr, size) +dma_mmap_wc(dev, vma, cpu_addr, dma_addr, size) We also keep the old names as compatibility helpers, and guard against their definition to make backporting easier. Generated-by: Coccinelle SmPL Suggested-by: Ingo Molnar <mingo@kernel.org> Signed-off-by: Luis R. Rodriguez <mcgrof@suse.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: airlied@linux.ie Cc: akpm@linux-foundation.org Cc: benh@kernel.crashing.org Cc: bhelgaas@google.com Cc: bp@suse.de Cc: dan.j.williams@intel.com Cc: daniel.vetter@ffwll.ch Cc: dhowells@redhat.com Cc: julia.lawall@lip6.fr Cc: konrad.wilk@oracle.com Cc: linux-fbdev@vger.kernel.org Cc: linux-pci@vger.kernel.org Cc: luto@amacapital.net Cc: mst@redhat.com Cc: tomi.valkeinen@ti.com Cc: toshi.kani@hp.com Cc: vinod.koul@intel.com Cc: xen-devel@lists.xensource.com Link: http://lkml.kernel.org/r/1453516462-4844-1-git-send-email-mcgrof@do-not-panic.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-02-01[media] coda: fix first encoded frame payloadPhilipp Zabel1-1/+1
During the recent vb2_buffer restructuring, the calculation of the buffer payload reported to userspace was accidentally broken for the first encoded frame, counting only the length of the headers. This patch re-adds the length of the actual frame data. Fixes: 2d7007153f0c ("[media] media: videobuf2: Restructure vb2_buffer") Reported-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Jan Luebbe <jlu@pengutronix.de> Cc: <stable@vger.kernel.org> # for v4.4 and up Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
2015-12-23[media] coda: relax coda_jpeg_check_buffer for trailing bytesPhilipp Zabel1-1/+1
coda_jpeg_check_buffer only cares about the buffer length and contents, so change the parameter type back from v4l2_vb2_buffer to just the vb2_buffer. Instead of just checking the first and last bytes for the SOI and EOI markers, relax the EOI marker check a bit and allow up to 32 trailing bytes after the EOI marker as hardware generated JPEGs sometimes contain some alignment overhead. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.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-10-01[media] media: videobuf2: Restructure vb2_bufferJunghak Sung1-65/+68
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-10-01[media] media: videobuf2: Replace videobuf2-core with videobuf2-v4l2Junghak Sung1-1/+1
Make videobuf2-v4l2 as a wrapper of videobuf2-core for v4l2-use. And replace videobuf2-core.h with videobuf2-v4l2.h. This renaming change should be accompanied by the modifications of all device drivers that include videobuf2-core.h. It can be done with just running this shell script. replace() { str1=$1 str2=$2 dir=$3 for file in $(find $dir -name *.h -o -name *.c -o -name Makefile) do echo $file sed "s/$str1/$str2/g" $file > $file.out mv $file.out $file done } replace "videobuf2-core" "videobuf2-v4l2" "include/media/" replace "videobuf2-core" "videobuf2-v4l2" "drivers/media/" replace "videobuf2-core" "videobuf2-v4l2" "drivers/usb/gadget/" replace "videobuf2-core" "videobuf2-v4l2" "drivers/staging/media/" 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>