summaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/coda.h
Commit message (Collapse)AuthorAgeFilesLines
* [media] coda: move coda driver into its own directoryPhilipp Zabel2014-08-211-447/+0
| | | | | | | | | | 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>
* [media] coda: Add encoder/decoder support for CODA960Philipp Zabel2014-07-221-3/+112
| | | | | | | | | | | | | | | | | | | | | This patch adds support for the CODA960 VPU in Freescale i.MX6 SoCs. It enables h.264 and MPEG4 encoding and decoding support. Besides the usual register shifting, the CODA960 gains frame memory control and GDI registers that are set up for linear mapping right now, needs ENC_PIC_SRC_INDEX to be set beyond the number of internal buffers for some reason, and has subsampling buffers that need to be set up. Also, the work buffer size is increased to 80 KiB. The CODA960 firmware spins if there is not enough input data in the bitstream buffer. To make it continue, buffers need to be copied into the bitstream as soon as they are queued. As the bitstream fifo is written into from two places, it must be protected with a mutex. For that, using a threaded interrupt handler is necessary. 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 CODA7541 decoding supportPhilipp Zabel2013-07-311-0/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch enables decoding of h.264 and mpeg4 streams on CODA7541. Queued output buffers are immediately copied into the bitstream ringbuffer. A device_run can be scheduled whenever there is either enough compressed bitstream data, or the CODA is in stream end mode. Each successful device_run, data is read from the bitstream ringbuffer and a frame is decoded into a free internal framebuffer. Depending on reordering, a possibly previously decoded frame is marked as display frame, and at the same time the display frame from the previous run is copied out into a capture buffer by the rotator hardware. The dequeued capture buffers are counted to send the EOS signal to userspace with the last frame. When userspace sends the decoder stop command or enqueues an empty output buffer, the stream end flag is set to allow decoding the remaining frames in the bitstream ringbuffer. The enum_fmt/try_fmt functions return fixed capture buffer sizes while the output queue is streaming, to allow better autonegotiation in userspace. A per-context buffer mutex is used to lock the picture run against buffer dequeueing: if a job gets queued, then streamoff dequeues the last buffer, and then device_run is called, bail out. For that the interrupt handler has to be threaded. 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 bitstream ringbuffer handling for decoderPhilipp Zabel2013-07-261-0/+3
| | | | | | | | | Add a bitstream ringbuffer using kfifo. Queued source buffers are to be copied into the bitstream ringbuffer immediately and marked as done, if possible. 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: update CODA7541 to firmware 1.4.50Philipp Zabel2013-07-261-0/+9
| | | | | | | | | | | | | | This patch splits the global workbuf into a global tempbuf and a per-context workbuf, adds the codec mode aux register, and restores the work buffer pointer on commands. With the new firmware, there is only a single set of read/write pointers which need to be restored between context switches. This allows more than four active contexts at the same time. All auxiliary buffers are now allocated through a helper function to avoid code duplication. 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: dynamic IRAM setup for encoderPhilipp Zabel2013-07-261-2/+9
| | | | | | | | | This sets up IRAM areas used as temporary memory for the different hardware units depending on the frame size. 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: per-product list of codecs instead of list of formatsPhilipp Zabel2013-06-081-1/+2
| | | | | | | | | | | | | | | | | | | This patch adds a list of supported codecs per device type which is used to determine the allowed pixel formats and maximum frame sizes depending on the possible codecs. It allows frame sizes larger than 720 x 576 on CODA7 and adds support for the YVU420 (planar YUV 4:2:0 with switched Cb and Cr) format. Other uncompressed formats that could be added in the future are the chroma interleaved NV12 and NV21 formats and the multiplanar variants YUV420M, YVU420M, NV12M, and NV21M. Further, rawstreamon is renamed to streamon_out and compstreamon is renamed to streamon_cap in preparation for decoding support. The maximum encoded frame buffer size is increased to 1 MiB. Instead of tracking inst_type and codec across S_FMT calls, set the codec and inst_type in start_streaming. 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@redhat.com>
* [media] coda: fix ENC_SEQ_OPTION for CODA7Philipp Zabel2013-06-031-6/+2
| | | | | | | | | GAMMA_OFFSET is different between CodaDx6 and CODA7. Also, this is a bitfield. 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@redhat.com>
* [media] media: coda: add horizontal / vertical flipping supportPhilipp Zabel2012-09-261-0/+9
| | | | | | | | | The hardware can also rotate in 90° steps, but there is no corresponding V4L2_CID defined yet. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] media: coda: fix IRAM/AXI handling for i.MX53Philipp Zabel2012-09-261-4/+17
| | | | | | | | | | | This uses the ARCH_MXC specific iram_alloc API to allocate a work buffer in the SoC's on-chip SRAM and sets up the AXI_SRAM_USE register. In the future, the allocation will be converted to use the genalloc API. Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de> Tested-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
* [media] rename drivers/media/video as .../platformMauro Carvalho Chehab2012-08-151-0/+216
The remaining drivers are mostly platform drivers. Name the dir to reflect it. It makes sense to latter break it into a few other dirs. Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>