Move the mode set vblank handling and controller enable/disable to the
prepare() and commit() callbacks. This will be needed when we move to
mode_set_nofb() as we should not enable the controller without the
plane coordinates and location having been properly updated.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Move the overlay plane register update generation to a separate function
as this is independent of the legacy or atomic update.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Move the register update structure out of the overlay private structure
into armada_plane_work, as this is common to both the primary and
overlay planes.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Move the sending of events into the armada_plane_work structure, and
combine the processing in armada_drm_plane_work_call().
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Both the primary and overlay planes retire framebuffers in a similar
manner; this can be consolidated by moving the retirement up to the
armada_plane_work layer.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Merge armada_drm_primary_disable() into armada_drm_crtc_plane_disable()
and rename to armada_drm_plane_disable(). Use this to simplify
armada_ovl_plane_disable().
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Add a work cancel callback, so that work items can add functionality to
clean themselves up when they are cancelled.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Store the plane in the armada_plane_work structure rather than passing
it around; it doesn't get used very much in the work structures, so
passing it around is a needless expense.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
armada_drm_plane_work_cancel()'s returned work structure is never used
or referenced, so it's pointless returning it. It's also pointless
because the caller doesn't have a clue what kind of work structure it
is.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
The UV swap code was not always programming things correctly when
the source origin box has been offset. Fix this.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
The vblank hooks in struct drm_driver are deprecated and only meant for
legacy drivers. For modern drivers with DRIVER_MODESET flag, the hooks
in struct drm_crtc_funcs should be used instead. As the result,
functions armada_drm_crtc_enable[disable]_irq() can be static, although
they are moved around a bit to save forward declaration.
The armada_crtc pointer array in struct armada_private is still kept in
there, because armada_debugfs.c still have reference to it.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
Cc: Russell King <linux@armlinux.org.uk>
Acked-by: Russell King <rmk+kernel@armlinux.org.uk>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1486458995-31018-7-git-send-email-shawnguo@kernel.org
Move more of the Armada plane state (source size, and displayed size and
position) into a state structure inside struct armada_plane.
Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
Convert the overlay plane to use the generic armada plane worker
infrastructure which is shared with the primary plane.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Add a plane work implementation, and move the CRTC framebuffer flip
work to it for the primary plane. The idea is to have a common
plane work implementation for both the primary and overlay planes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Both the CRTC and overlay frames have their own wait queues. It would
make more sense if these were part of the plane - the primary plane for
the CRTC and overlay plane for the overlay.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Introduce a generic armada_plane struct which will eventually be used
for both the primary and overlay planes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Our vblank event code belongs in armada_crtc.c rather than the core of
the driver. Move it there.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Now that the transition of TDA998x to the component helpers is complete,
remove the non-componentised support from the Armada DRM driver. All
outputs are expected to use the component helpers from now on.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Register the CRTC with the port node so that the DRM OF helpers can
find the appropriate CRTC. This is important so that encoders can
identify their corresponding possible CRTCs.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the variant pointer into the armada_crtc structure, and update for
the resulting changes.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Move the variant initialisation entirely to the CRTC init function -
the variant support is really about the CRTC properties than the whole
system, and we want to treat each CRTC individually when we support DT.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Use the number of CRTCs registered to size the vblank arrays rather than
our own count. Number CRTCs using this as well. This permits us to
register CRTCs as components in the near future rather than as part of a
single device.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This patch adds ARGB hardware cursor support to the DRM driver for the
Marvell Armada SoCs. ARGB cursors are supported at either 32x64 or
64x32 resolutions.
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
This patch adds support for the pair of LCD controllers on the Marvell
Armada 510 SoCs. This driver supports:
- multiple contiguous scanout buffers for video and graphics
- shm backed cacheable buffer objects for X pixmaps for Vivante GPU
acceleration
- dual lcd0 and lcd1 crt operation
- video overlay on each LCD crt via DRM planes
- page flipping of the main scanout buffers
- DRM prime for buffer export/import
This driver is trivial to extend to other Armada SoCs.
Included in this commit is the core driver with no output support; output
support is platform and encoder driver dependent.
Tested-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Reviewed-by: Rob Clark <robdclark@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>