summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda/coda-common.c
Commit message (Collapse)AuthorAgeFilesLines
* [media] coda: Improve runtime PM supportUlf Hansson2014-09-261-34/+21Star
| | | | | | | | | | | | | | For several reasons it's good practice to leave devices in runtime PM active state while those have been probed. In this cases we also want to prevent the device from going inactive, until the firmware has been completely installed, especially when using a PM domain. Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org> 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>
* [media] coda: checkpatch cleanupPhilipp Zabel2014-08-211-11/+23
| | | | | | | | | | This patch breaks most long lines, concatenates broken up text strings, and adds or removes parentheses where needed to make checkpatch happy. The long codec list lines and a few 81-wide lines remain. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: disable old cropping ioctlsPhilipp Zabel2014-08-211-0/+5
| | | | | | | | | | | Since we neither support composing on the OUTPUT side, nor cropping on the CAPTURE side, disable VIDIOC_CROPCAP and VIDIOC_G/S_CROP altogether. This silences a GStreamer warning when GStreamer tries to obtain the pixel aspect ratio using VIDIOC_CROPCAP. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: set capture frame size with output S_FMTPhilipp Zabel2014-08-211-1/+11
| | | | | | | | | | | This patch makes coda_s_fmt_vid_out propagate the output frame size to the capture side. The GStreamer v4l2videodec only ever calls S_FMT on the output side and then expects G_FMT on the capture side to return a valid format. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: fix coda_s_fmt_vid_outPhilipp Zabel2014-08-211-1/+3
| | | | | | | | Set the context color space when s_fmt succeeded, not when it failed. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: fix timestamp list handlingPhilipp Zabel2014-08-211-0/+2
| | | | | | | | | | | | Lock modification of the timestamp list with bitstream_mutex and do not try to remove a timestamp element if the list is empty. This can happen if the userspace feeds us garbage or multiple encoded frames in a single buffer. Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: improve allocation error messagesPhilipp Zabel2014-08-211-1/+5
| | | | | | | | | Produce some error messages when internal buffer allocation fails, for example because the CMA region is too small. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: add an intermediate debug levelPhilipp Zabel2014-08-211-3/+3
| | | | | | | | | Dumping all register accesses drowns other debugging messages in the log. Add a less verbose debug level. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: increase max vertical frame size to 1088Philipp Zabel2014-08-211-7/+6Star
| | | | | | | | | | | This patch increases the maximum vertical frame size reported by enum_fmt and accepted by try_fmt/s_fmt from 1080 to 1088. Since for 16x16-pixel macroblocks 1080p will be rounded up to this anyway, we may as well admit that we support it. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: allow running coda without iram on mx6dlPhilipp Zabel2014-08-211-7/+7
| | | | | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: skip calling coda_find_codec in encoder try_fmt_vid_outPhilipp Zabel2014-08-211-5/+6
| | | | | | | | | We know that it will return NULL in this case, so we can just as well skip it altogether. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: dequeue buffers on streamoffPhilipp Zabel2014-08-211-0/+8
| | | | | | | | | This is needed to decrease the q->owned_by_drv_count to zero before __vb2_queue_cancel is called, to avoid the WARN_ON therein. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: dequeue buffers if start_streaming failsPhilipp Zabel2014-08-211-8/+26
| | | | | | Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: request BIT processor interrupt by namePhilipp Zabel2014-08-211-1/+3
| | | | | | | | | Request the main coda interrupt using its name, "bit", if available. Fall back to requesting the first interrupt for backwards compatibility. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: move BIT specific functions into separate filePhilipp Zabel2014-08-211-1818/+13Star
| | | | | | | | | This patch moves the BIT processor specific coda_context_ops, the firmware upload and other related functions from coda-common.c into coda-bit.c. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: move H.264 helper function into separate filePhilipp Zabel2014-08-211-22/+0Star
| | | | | | | | | Currently there is only the coda_h264_padding function, but we will have to add more H.264 specific helpers later. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: move per-instance buffer allocation and cleanupPhilipp Zabel2014-08-211-10/+21
| | | | | | | | | | This patch moves the context buffer allocation into the context start_streaming callbacks. The context buffer and internal framebuffer cleanup is moved into the context release callback. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: add coda_bit_stream_set_flag helperPhilipp Zabel2014-08-211-33/+19Star
| | | | | | | | | This adds a helper function to consolidate three occurences where the bitstream parameter stream end flag is set during operation. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: move BIT processor command execution out of pic_run_workPhilipp Zabel2014-08-211-8/+13
| | | | | | | | | In preparation for the split, move the AXI_SRAM_USE register access and the PIC_RUN command execution out of pic_run_work into prepare_encode/decode. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: add context opsPhilipp Zabel2014-08-211-35/+50
| | | | | | | | | | | Add a struct coda_context_ops that encapsulates context specific operations. This will simplify adding JPEG support in the future and helps to avoid exporting all functions individually when they move out of the main code file. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: move defines, enums, and structs into shared headerPhilipp Zabel2014-08-211-190/+3Star
| | | | | | | | These will have to be shared between multiple code files. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
* [media] coda: move coda driver into its own directoryPhilipp Zabel2014-08-211-0/+3999
The coda driver has grown significantly and will continue to grow. Move the coda driver into its own directory so it can be split. Rename coda.h to coda_regs.h as it contains the register defines. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>