aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/platform/ti-vpe/vpdma_priv.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2016-11-22[media] media: ti-vpe: vpdma: RGB data type yield inverted dataBenoit Parrot1-20/+29
The VPDMA RGB data type definition have been updated to match with Errata i839. But some of the ARGB definition appeared to be wrong in the document also. As they would yield RGBA instead. They have been corrected based on experimentation. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-22[media] media: ti-vpe: vpdma: Corrected YUV422 data type labelBenoit Parrot1-3/+16
The YUV data type definition below are taken from both the TRM and i839 Errata information. Use the correct data type considering byte reordering of components. Added the 2 missing YUV422 variant. Also since the single use of "C" in the 422 case to mean "Cr" (i.e. V component). It was decided to explicitly label them CR to remove any confusion. Bear in mind that the type label refer to the memory packed order (LSB - MSB). Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-22[media] media: ti-vpe: vpdma: Add support for setting max width heightNikhil Devshatwar1-36/+4
Add a helper function to be able to set the maximum VPDMA transfer size to limit potential buffer overrun. Added enums for max_width and max_height fields of the outbound data descriptor. Changed vpdma_add_out_dtd to accept two more arguments for max width and height. Make use of different max width & height sets for different of capture module (i.e. slices). Signed-off-by: Nikhil Devshatwar <nikhil.nd@ti.com> Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-22[media] media: ti-vpe: vpdma: Fix bus error when vpdma is writing a descriptorBenoit Parrot1-2/+3
On DRA7 since l3_noc event are being reported it was found that when the write descriptor was being written it was consistently causing bus error events. The write address was improperly programmed. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2016-11-22[media] media: ti-vpe: vpdma: Add multi-instance and multi-client supportBenoit Parrot1-3/+12
The VPDMA (Video Port DMA) as found in devices such as DRA7xx is used for both the Video Processing Engine (VPE) and the Video Input Port (VIP). Some devices may have multiple VIP instances each with its own VPDMA engine. Within VIP two slices can use a single VPDMA engine simultaneously. So support for multi instances and multiple clients has been added to VPDMA. Needed modification to the existing helper functions were then reflected to VPE. Multi-clients registers offset have also been added in preparation. Signed-off-by: Benoit Parrot <bparrot@ti.com> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
2013-12-10[media] v4l: ti-vpe: Fix the data_type value for UYVY VPDMA formatArchit Taneja1-1/+1
The data_type value to be programmed in the data descriptors to fetch/write a UYVY buffer was not mentioned correctly in the older DRA7x documentation. This caused VPE to fail with UYVY color formats. Update the data_type value to fix functionality when UYVY format is used. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-28[media] v4l: ti-vpe: Add helpers for creating VPDMA descriptorsArchit Taneja1-0/+522
Create functions which the VPE driver can use to create a VPDMA descriptor and add it to a VPDMA descriptor list. These functions take a pointer to an existing list, and append the configuration/data/control descriptor header to the list. In the case of configuration descriptors, the creation of a payload block may be required(the payloads can hold VPE MMR values, or scaler coefficients). The allocation of the payload buffer and it's content is left to the VPE driver. However, the VPDMA library provides helper macros to create payload in the correct format. Add debug functions to dump the descriptors in a way such that it's easy to see the values of different fields in the descriptors. Signed-off-by: Archit Taneja <archit@ti.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
2013-10-28[media] v4l: ti-vpe: Create a vpdma helper libraryArchit Taneja1-0/+119
The primary function of VPDMA is to move data between external memory and internal processing modules(in our case, VPE) that source or sink data. VPDMA is capable of buffering this data and then delivering the data as demanded to the modules as programmed. The modules that source or sink data are referred to as clients or ports. A channel is setup inside the VPDMA to connect a specific memory buffer to a specific client. The VPDMA centralizes the DMA control functions and buffering required to allow all the clients to minimize the effect of long latency times. Add the following to the VPDMA helper: - A data struct which describe VPDMA channels. For now, these channels are the ones used only by VPE, the list of channels will increase when VIP(Video Input Port) also uses the VPDMA library. This channel information will be used to populate fields required by data descriptors. - Data structs which describe the different data types supported by VPDMA. This data type information will be used to populate fields required by data descriptors and used by the VPE driver to map a V4L2 format to the corresponding VPDMA data type. - Provide VPDMA register offset definitions, functions to read, write and modify VPDMA registers. - Functions to create and submit a VPDMA list. A list is a group of descriptors that makes up a set of DMA transfers that need to be completed. Each descriptor will either perform a DMA transaction to fetch input buffers and write to output buffers(data descriptors), or configure the MMRs of sub blocks of VPE(configuration descriptors), or provide control information to VPDMA (control descriptors). - Functions to allocate, map and unmap buffers needed for the descriptor list, payloads containing MMR values and scaler coefficients. These use the DMA mapping APIs to ensure exclusive access to VPDMA. - Functions to enable VPDMA interrupts. VPDMA can trigger an interrupt on the VPE interrupt line when a descriptor list is parsed completely and the DMA transactions are completed. This requires masking the events in VPDMA registers and configuring some top level VPE interrupt registers. - Enable some VPDMA specific parameters: frame start event(when to start DMA for a client) and line mode(whether each line fetched should be mirrored or not). - Function to load firmware required by VPDMA. VPDMA requires a firmware for it's internal list manager. We add the required request_firmware apis to fetch this firmware from user space. - Function to dump VPDMA registers. - A function to initialize and create a VPDMA instance, this will be called by the VPE driver with it's platform device pointer, this function will take care of loading VPDMA firmware and returning a vpdma_data instance back to the VPE driver. The VIP driver will also call the same init function to initialize it's own VPDMA instance. Signed-off-by: Archit Taneja <archit@ti.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Kamil Debski <k.debski@samsung.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>