media: xilinx: dma: Change vdma configuration to cyclic-mode

VDMA in non-cyclic mode doesn't work with fsync enabled. Fsync is needed to
synchronize the pipeline with external input. So VDMA is configured to cyclic
mode in this patch, with fsync enabled at synthesis. This patch is the only
way to run the pipeline with external input, and it will be revisited after
IP level investigation.

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
---
v3
- This patch is included
---
v4l: Sort YUV formats of v4l2_mbus_pixelcode

Move V4L2_MBUS_FMT_YUYV10_1X24_PADHI and V4L2_MBUS_FMT_YUYV12_1X24,
so that the enumeration is sorted correctly.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v2
- Add this patch
---
v4l: Add VUY8 24 bits bus format

Add VUY8 24 bits bus format, V4L2_MBUS_FMT_VUY8_1X24.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v2:
- Place in the sorted manner
- Add documentation
---
media: xilinx: vip: Add yuv444 and bayer formats

Add more video formats: yuv444 and bayer(rggb, grbg, gbrg, bggr).

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
---
v2
- Use V4L2_MBUS_FMT_VUY888_1X24 as its name is changed by previous patch
- Specify the bayer formats instead of having one
- Remove xvip_get_format() function from this patch
- Don't add input/output format property in the DT binding
---
media: xilinx: vip: Remove _TIMING_ from register definition

Remove _TIMING_ from register definitions. Change the names in xilinx-tpg.c
accordingly.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
---
v3
- Change the macro names for register 0x28 to XVIP_ENCODING_*
v2
- Sqaush the xilinx-tpg.c change into this patch
---
media: xilinx: dma: Add vidioc_enum_fmt_vid_cap callback

Add vidioc_enum_fmt_vid_cap callback to enumerate the proper format
to user.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
---
v3
- Add FIXME comment. This needs to be discussed through the mailing list
---
media: xilinx: dma: Fix alignments of xvip_dma_fops definition

Fix alignments of xvip_dma_fops definition.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[hack] media: xilinx: dma: Workaround for bytesperline

Workaround for bytesperline bug from mplayer. The version of mplayer
that was used for demo uses the bytes per line value from the driver.
Since mplayer doesn't change this value, mplayer uses the wrong bytes
per line value, for example, the default value (1920 * 4) for differnt
resolution (640x480).

The best way is to send a patch to mplayer the mailing list, and this
doesn't intend to be included in the kernel tree.
media: xilinx: vip: Add default min/max height/width definitions

Add default min/max height/width definitions, min = 32, max = 7680.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v2
- Add comments on default values
---
media: xilinx: vip: Add common sink/source pad IDs

Add common sink/source pad IDs. As commented, IP cores with multiple inputs or
outputs should define their own IDs instead of using these values.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v2
- This patch is split from previous default min/max width/height patch
---
media: xilinx: vip: Add xvip_set_format_size()

Add xvip_set_format_size() which set the format size.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
---
v3
- Make the fmt argument const
v2
- Change the prototype of xvip_set_format() as xvip_video_format is not needed
- Change the name from xvip_set_format() to xvip_set_format_size()
- Add documentation to the function description
---
media: xilinx: vip: Add xvip_enum_mbus_code()

media: xilinx: vip: Add xvip_enum_mbus_code(), which enumerate
the mbus code of a subdevice.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v2
- Add documentation in the function description
---
media: xilinx: vip: Add xvip_enum_frame_size()

Add xvip_enum_frame_size(), which enumerates the min/max frame size
of a subdevice.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v3
- Change the function description
v2
- Add documentation to function description
---
media: xilinx: vip: Add xvip_start()

Add xvip_start(), which starts the IP and enables the reg update.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v2
- Do read-update-write
---
media: xilinx: vip: Add xvip_stop()

Add xvip_stop(), which resets and stops the IP.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v2
- Do read-update-write
---
media: xilinx: vip: Add xvip_set_frame_size()

Add xvip_set_frame_size(), which sets the frame size of IP.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v3
- Fix the alignment
- Pass v4l2_mbus_framefmt in xvip_set_frame_size()
v2
- Change the function name to xvip_set_frame_size() from xvip_set_size()
---
media: xilinx: vip: Add enable/disable reg update functions

Add xvip_enable_reg_update() and xvip_disable_reg_update().
Sometimes drivers need to enable and disable register update for atomicity.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
media: xilinx: vip: Add xvip_print_version()

xvip_print_version() reads the version info from the standard register,
and print the version information (major, minor, revision) of IP.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
media: xilinx: vip: Add xvip_reset()

Add xvip_reset() so drivers can reset cores when needed.

Signed-off-by: Hyun Kwon <hyun.kwon@xilinx.com>
---
v3
- This patch is added
---
media: xilinx: vip: Add xvip_get_frame_size()

xvip_get_frame_size() reads the active size and returns the width and height.

Signed-off-by: Hyun Kwon <hyunk@xilinx.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
v3
- Use XVIP_ACTIVE_HSIZE_SHIFT for a line reading width for more readability
- Pass v4l2_mbus_framefmt as an argument in xvip_get_frame_size()
---