Hyun Kwon [Fri, 4 Oct 2013 02:10:45 +0000 (19:10 -0700)]
drm: xilinx: drv: Add xilinx_drm_format()
Add xilinx_drm_format() which converts the xilinx video format to
the drm format. Replace the previously defined osd video format
with this function / formats. This function can be used by other
sub-drivers.
Remove unused the xilinx_drm_plane_formats variable.
The plane format is detected based on the pipeline configuration,
instead of using static variables.
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
Laurent Pinchart [Tue, 21 May 2013 16:08:09 +0000 (18:08 +0200)]
v4l: xilinx: Add Video Remapper driver
The remapper is a non-configurable IP core that remaps the video bus
data lines. The driver includes a list of mappings and exposes them
through the get and set media bus format operations.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
Laurent Pinchart [Wed, 15 May 2013 14:36:19 +0000 (16:36 +0200)]
v4l: xilinx: Add Xilinx Video IP core
Xilinx Zynq platforms have no hardwired camera interface. Users create
camera pipelines in the FPGA fabric to suit their particular needs, by
instantiating video IP cores from a large library.
The Xilinx Video IP core is a framework that models a video pipeline
described in the device tree and expose the pipeline to userspace
through the media controller and V4L2 APIs.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
Laurent Pinchart [Fri, 17 May 2013 10:31:04 +0000 (12:31 +0200)]
v4l: of: Add v4l2_of_parse_link() function
The function fills a link data structure with the device node and port
number at both the local and remote ends of a link defined by one of its
endpoint nodes.
Laurent Pinchart [Fri, 17 May 2013 10:31:04 +0000 (12:31 +0200)]
v4l: of: Drop endpoint node reference in v4l2_of_get_remote_port()
The v4l2_of_get_remote_port() function acquires a reference to an
endpoint node through a phandle and then returns the node's parent,
without dropping the reference to the endpoint node. Fix it.
Laurent Pinchart [Fri, 17 May 2013 10:31:04 +0000 (12:31 +0200)]
v4l: of: Return an int in v4l2_of_parse_endpoint()
When CONFIG_OF is not defined the v4l2_of_parse_endpoint() function is
defined as a stub that returns -ENOSYS. Make the real function return an
integer as well to be able to differentiate between the two cases.
v4l: of: Drop acquired reference to node when getting next endpoint
The of_get_child_by_name() function takes a reference to the node it
returns. Make sure to drop it when looking for the ports node in
v4l2_of_get_next_endpoint().
v4l: async: Make it safe to unregister unregistered notifier
Calling v4l2_async_notifier_unregister() on a notifier that hasn't been
registered leads to a crash. To simplify drivers, make it safe to
unregister a notifier that has not been registered.
V4L: Merge struct v4l2_async_subdev_list with struct v4l2_subdev
By integrating the v4l2-async API internals a bit more with
the core overall the v4l2-async code becomes a bit simpler
and easier to follow. Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
V4L: Rename subdev field of struct v4l2_async_notifier
This is a purely cosmetic change. Since the 'subdev' member
points to an array of subdevs make it more explicit by
renaming to the plural form. Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
Add support for matching by device_node pointer. This allows
the notifier user to simply pass a list of device_node pointers
corresponding to sub-devices.
V4L: Rename v4l2_async_bus_* to v4l2_async_match_*
enum v4l2_async_bus_type also selects a method subdevs are matched
in the notification handlers, rename it to v4l2_async_match_type
so V4L2_ASYNC_MATCH_OF entry can be further added for matching by
device tree node pointer. Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
V4L: Drop bus_type check in v4l2-async match functions
These match_* functions are internal callbacks and are always
invoked only after checking asd->bus_type. So drop redundant
checks in match_i2c() and match_platform() functions. Acked-and-tested-by: Lad, Prabhakar <prabhakar.csengg@gmail.com> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Hans Verkuil <hans.verkuil@cisco.com> Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
This patch adds a Xilixn DRM driver which uses Xilinx crtc/encoder/connector
supports. This patch completes the DRM KMS framework interfaces with
Xilinx DRM driver specific functions / other helper functions(CMA).
Now CMA helper functions are used to allocate framebuffers,
and CONFIG_CMA_SIZE_MBYTES must be configured properly to ensure
the enough amount of configure memory for framebuffers.
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
The crtc is supposed to read a pixel data from framebuffers, and
propagates data to the encoders. It also provides some event such as
vblank/pageflip. In this implementation, this patches manages
cresample, rgb2yuv, and vtc, and a crtc gets a one private plane to use.
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
This patch adds an encoder support of Xilinx DRM KMS. The encoder is
supposed to be in charge of encoding the pixel data in certain video formats.
For now, adv7511 HDMI transmitter is the only hardware used for
Xilinx DRM KMS, and this patch has some dependency on adv7511 drm driver.
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
This patch adds a connector support of Xilinx DRM KMS.
For now, adv7511 HDMI transmitter is the only hardware that manages
connections with display devices, and this patch has dependency on adv7511
drm driver.
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
This patch adds a plane support of Xilinx DRM KMS driver.
This enables the multi-plane rendering support of the hardware pipeline.
To enable multi-plane support, the hardware composer such as OSD should be
configured properly in the hardware pipeline, and additional dma IPs may
be needed. Otherwise, only the single plane is available,
and a single plane is not exposed to user.
For current implementation, this patch depends on VDMA through dmaengine API,
and an osd sub-driver(xilinx_osd.c/h).
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
drm: xilinx: Add a Video Timing Controller(VTC) driver
This patch adds a Video Timing Controller driver. This IP provides
the video timings such as active, sync,, to video IPs.
The clock source for such as si570 should be connected to this IP.
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
This patch adds an OSD driver. The OSD supports alpha blending and
compositing, and such features enables the muti-plane rendering of
the display pipelines.
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
Add a chroma resampler driver as a sub-driver of Xilinx DRM KMS dirver.
This IP provides the chroma sub-sampling between YCrCb formats
(4:4:4, 4:2:2, and 4:2:0).
Signed-off-by: Hyun Kwon <hyunk@xilinx.com> Acked-by: Michal Simek <michal.simek@xilinx.com>
Hyun Kwon [Wed, 2 Oct 2013 22:48:06 +0000 (15:48 -0700)]
dma: xilinx: vdma: Add xilinx_vdma_chan_reset() function
As interrupts are enabled in xilinx_vdma_chan_probe(),
interrupts should be re-enabled anytime when a vdma channle gets reset.
Add xilinx_vdma_chan_reset() which resets a vdma channel by calling
xilinx_vdma_reset(), and re-enables interrupts.
Laurent Pinchart [Tue, 18 Jun 2013 00:53:03 +0000 (02:53 +0200)]
dma: xilinx: vdma: Poll the status register when starting/stopping
After setting or clearing the run/stop bit in the control register, the
DMA engine run status is reflected by the halted bit in the status
register. Fix the driver to poll the halted bit instead of polling the
run/stop bit.
Laurent Pinchart [Thu, 23 May 2013 11:53:35 +0000 (13:53 +0200)]
dma: xilinx: vdma: Support queuing multiple transactions
Create a xilinx_vdma_tx_descriptor structure and use it model DMA
transactions. A transaction can contain several segments, and multiple
transactions can be prepared and submitted without waiting for the
previous transactions to complete.
Replace the active descriptors list with an active descriptor pointer,
and add a new complete descriptors list to store complete descriptors
that need to be handed back to the client.
dma: xilinx: vdma: Split xilinx_vdma_free_chan_resources() function
The xilinx_vdma_free_chan_resources() function frees both the
descriptors and the descriptors pool. Split the descriptors freeing code
into a separate function to increase code reuse.
Laurent Pinchart [Thu, 23 May 2013 11:48:17 +0000 (13:48 +0200)]
dma: xilinx: vdma: Configure the hardware when starting the transfer
Set the XILINX_VDMA_REG_HSIZE and XILINX_VDMA_REG_FRMDLY_STRIDE
registers when starting the transfer, not when preparing the request.
This is needed to allow several requests to be prepared and submitted
for execution.
The function pointer is currently stored in the channel structure
start_transfer field and called indirectly. As the start_transfer field
always points to the same function, remove it and call
xilinx_vdma_start_transfer() directly.
dma: xilinx: vdma: Remove initialized channels when channel probe fails
If a channel fails to probe correctly when need to clean up the already
initialized channels. Check the return value of xilinx_vdma_chan_probe()
and call xilinx_vdma_chan_remove() on all previously initialized
channels in case of failure.
dma: xilinx: vdma: Handle reset timeouts when probing channel
Make the vdma_init() function return a proper error code, and propagate
it to the caller of xilinx_vdma_chan_probe() when vdma_init() fails.
This fixes returning an uninitialized error value to the probe function.
Laurent Pinchart [Mon, 20 May 2013 23:03:23 +0000 (01:03 +0200)]
dma: xilinx: vdma: Don't reconfigure channel after reset
VDMA users usually don't supply channel configuration parameter when
requesting a reset. The driver would then reconfigure the channel with
random parameters. Avoid this by returning immediately after resetting
the channel. Users will reconfigure it afterwards anyway.
Soren Brinkmann [Tue, 29 Oct 2013 22:51:48 +0000 (15:51 -0700)]
clocksource/cadence_ttc: Adjust interval in clock notifier
The clockevent has to be reprogrammed if the timer's input
clock frequency changes and the timer is in periodic mode, in order to
maintain the correct timer interval.
Soren Brinkmann [Tue, 29 Oct 2013 21:10:40 +0000 (14:10 -0700)]
clocksource/cadence_ttc: Store timer frequency in driver data
It is not allowed to call clk_get_rate() from interrupt context. To
avoid such calls the timer input frequency is stored in the driver's
data struct which makes it accessible to the driver in any context.
The clocksource's clock notifier tried to keep the clocksource frequency
adjusted when the input clock changed. The approach included rather
heavy operations and results in a deadlock on current kernels (the
clocksource is unregistered and re-registered with the new frequency).
Removing the notifier keeps the system operational on cost of timing
being off.