]> rtime.felk.cvut.cz Git - zynq/linux.git/commit
platform: xilinx: Add mem to mem Multi-Scaler driver (XM2MSC)
authorSuresh Gupta <suresh.gupta@xilinx.com>
Mon, 17 Sep 2018 12:20:03 +0000 (17:50 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Mon, 17 Sep 2018 13:11:59 +0000 (15:11 +0200)
commit484cdb2d9f7105aebcd6667344220598ba3e4b93
treef49ef760ab4462a935ee9b14fbf3680b2ba9a3b7
parentbadb5ef5f9eb17490722ca1a7a6cb00665f8e8e7
platform: xilinx: Add mem to mem Multi-Scaler driver (XM2MSC)

XM2MSC is a Scaler which consists of maximum 8 memory to memory
path/Channel, which can perform scaling and color space conversion of
supported formats in Hardware. Each channel can be programmed to
different scaling ratio and color space conversion.

We create a different video device for each Channel supported in HW,
which internally creates mem2mem driver context for each open video
device.

Mem2mem driver based primarily on the example vim2m test driver.
Each mem2mem context allocates a buffer for Input and output values
which it will use to configure the HW channel when all opened channels
start stream. Driver supports only V4L2_MEMORY_DMABUF buffers for now.

Different video devices are required to create different mem2mem context
to configure HW, based on the different information received via v4l2
ioctls for the source and destination queues. In this way all supported
channel can be configure with different scaling ratio and csc values.

The driver's device_run() mem2mem op will start the IP only when each
opened video device start stream on.

When all channels parsed completely by HW (and the DMAs on all the
output ports done), an interrupt is generated which we use to notify
that the source and destination buffers for all channels are done.

The opening of the same video device is not allowed, and the device run
starts the IP only when all opened devices start stream on. To reprogram
parameter of any one of the channels, all channel need to stream off,
and stream on after adding new values.

The rest of the driver is quite similar to other mem2mem drivers, we use
the multiplane v4l2 ioctls as the HW support multiplanar formats.

Signed-off-by: Suresh Gupta <suresh.gupta@xilinx.com>
Reviewed-by: Vishal Sagar <vishal.sagar@xlinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/media/platform/xilinx/Kconfig
drivers/media/platform/xilinx/Makefile
drivers/media/platform/xilinx/xilinx-multi-scaler-coeff.h [new file with mode: 0644]
drivers/media/platform/xilinx/xilinx-multi-scaler.c [new file with mode: 0644]