aboutsummaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/armada/armada_crtc.c
AgeCommit message (Collapse)AuthorFilesLines
2019-01-24drm: Split out drm_probe_helper.hDaniel Vetter1-1/+1
Having the probe helper stuff (which pretty much everyone needs) in the drm_crtc_helper.h file (which atomic drivers should never need) is confusing. Split them out. To make sure I actually achieved the goal here I went through all drivers. And indeed, all atomic drivers are now free of drm_crtc_helper.h includes. v2: Make it compile. There was so much compile fail on arm drivers that I figured I'll better not include any of the acks on v1. v3: Massive rebase because i915 has lost a lot of drmP.h includes, but not all: Through drm_crtc_helper.h > drm_modeset_helper.h -> drmP.h there was still one, which this patch largely removes. Which means rolling out lots more includes all over. This will also conflict with ongoing drmP.h cleanup by others I expect. v3: Rebase on top of atomic bochs. v4: Review from Laurent for bridge/rcar/omap/shmob/core bits: - (re)move some of the added includes, use the better include files in other places (all suggested from Laurent adopted unchanged). - sort alphabetically v5: Actually try to sort them, and while at it, sort all the ones I touch. v6: Rebase onto i915 changes. v7: Rebase once more. Acked-by: Harry Wentland <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Cc: Sam Ravnborg <[email protected]> Cc: Jani Nikula <[email protected]> Cc: Laurent Pinchart <[email protected]> Acked-by: Rodrigo Vivi <[email protected]> Acked-by: Benjamin Gaignard <[email protected]> Acked-by: Jani Nikula <[email protected]> Acked-by: Neil Armstrong <[email protected]> Acked-by: Oleksandr Andrushchenko <[email protected]> Acked-by: CK Hu <[email protected]> Acked-by: Alex Deucher <[email protected]> Acked-by: Sam Ravnborg <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Liviu Dudau <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2019-01-15drm: armada: Cleanup drm_display_mode print strShayenne Moura1-7/+1
This patch adjust the print string of drm_display_mode object to remove drm_mode_object dependency in armada files. Signed-off-by: Shayenne Moura <[email protected]> Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/dddd98f1a6687a37444d315adc4cbd8a692a8131.1547214023.git.shayenneluzmoura@gmail.com
2018-07-30drm/armada: remove unnecessary armada_plane structureRussell King1-3/+3
We no longer require a private armada_plane structure, so eliminate it, and use the drm_plane structure directly. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: update planes after the dumb frame is completeRussell King1-19/+27
Write out the plane updates after the dumb frame has completed, but just before the blank period. This allows all the plane updates to be performed in a flicker-free non-tearing manner. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: switch overlay plane to atomic modesetRussell King1-89/+0
Switch the overlay plane away from the transitional helpers and legacy methods, and use atomic helpers instead to implement the legacy set_plane ioctl methods. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: switch primary plane to atomic modesetRussell King1-115/+1
Switch the primary plane away from the transitional helpers, and use the atomic helpers instead to implement the legacy set_plane ioctl call for this plane. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: switch legacy modeset to atomic modesetRussell King1-102/+1
Switch the legacy set_config() method to use the atomic modeset helper, which allows us to get rid of the legacy dpms, prepare, commit, mode_set, mode_set_base and disable helper methods. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: enable atomic modeset supportRussell King1-4/+3
Enable atomic modeset helpers, and internal DRM use of atomic modeset with armada-drm. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: implement atomic_enable()/atomic_disable() methodsRussell King1-0/+71
Implement the atomic_enable()/atomic_disable() methods used by the atomic modeset helpers. atomic_disable() will need some transitional code during conversion to ensure proper ordering is maintained. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: unhook dpms state from armada_drm_crtc_update()Russell King1-6/+5
Explicitly pass in the desired enable/disable state into armada_drm_crtc_update() rather than having it use the DPMS state stored in our crtc structure. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: push responsibility for clock management to backendRussell King1-13/+6
Push responsibility for managing the clock during DPMS down into the variant backend, rather than the CRTC layer having knowledge of its state. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: handle atomic modeset crtc eventsRussell King1-0/+33
Prepare handling for atomic modeset CRTC events. Currently, using the transition helpers, CRTC events do not exist, but once we switch to proper atomic modeset, they have to be handled. We queue an event for the next vblank in two places: - armada_drm_crtc_atomic_flush() provided we aren't doing an atomic modeset. - armada_drm_crtc_commit() if we are committing a modeset. This ensures that the event is sent at the correct time (after all updates have been written to the hardware and after the following vblank.) Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: clean up SPU_ADV_REGRussell King1-7/+4
Rather than writing all bits of SPU_ADV_REG on modeset, only write what we need to change, and initialise the register in the variant initialisation. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: update debug in armada_drm_crtc_mode_set_nofb()Russell King1-10/+9
Update debug to use KMS level, and print the mode using the standard format for mode lines, but print the adjusted CRTC parameters as that's what we will be programming for. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move sync signal polarity to mode_set_nofb() methodRussell King1-25/+22
For atomic modeset, we need to set the sync signal polarities from the CRTC state structure rather than the legacy mode structure stored in CRTC. In any case, we should update this from our mode_set_nofb() method, rather than the commit() method. Move it there, and ensure that armada_drm_crtc_update() will not overwrite these bits. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: remove crtc YUV colourspace propertiesRussell King1-118/+0
Remove the unused CRTC colourspace properties - userspace does not make use of these. In any case, these are not a property of the CRTC, since they demonstrably only affect the video (overlay) plane, irrespective of the format of the graphics (primary) plane. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move primary plane to separate fileRussell King1-271/+2
Split out the primary plane support; this is now entirely separate from the CRTC support. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: use old_state for update tracking in atomic_update()Russell King1-56/+60
Rather than tracking the register state, we can now check the previous state and decide which registers need updating from that since the old plane state indicates the previous state which was programmed into the hardware. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: remove temporary crtc stateRussell King1-6/+6
Now that we have the CRTC using the atomic modeset transitional helper, there is no need to build a temporary crtc state anymore - we can use the CRTC atomic state directly. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: convert overlay plane to atomic stateRussell King1-76/+3
The overlay plane support updates asynchronously to the request, but the drm_plane_helper_update() transitional helper waits for a vblank event before releasing the framebuffer. Using the transitional helper would make the call block, which would introduce a performance regression. Convert the overlay plane update to use the atomic state structures and methods for the plane, but implement our own legacy update method rather than the transitional helper. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: convert page_flip to use primary plane atomic_update()Russell King1-26/+55
page_flip requests happen asynchronously, so we can't wait on the vblank event before returning to userspace, as the transitional plane update helper would do. Craft our own implementation that keeps the asynchronous behaviour of this request, while making use of the atomic infrastructure for the primary plane update. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: convert primary plane to atomic stateRussell King1-155/+153
Convert the primary plane as a whole to use its atomic state and the transitional helpers. The CRTC is also switched to use the transitional helpers for mode_set() and mode_set_base(). Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: merge armada_drm_gra_plane_regs() into only callerRussell King1-31/+24
armada_drm_gra_plane_regs() is now only ever called from within armada_drm_primary_update_state(), so merge it into this function. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: use core of primary update_plane for mode setRussell King1-78/+59
Use the core of the update_plane method to configure the primary plane within mode_set() rather than duplicating this code. This moves us closer to the same code structure that the atomic modeset transitional helpers will use. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: move mode set vblank handling and disable/enableRussell King1-21/+20
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 <[email protected]>
2018-07-30drm/armada: add rectangle helpersRussell King1-5/+3
Add helpers to convert rectangle width/height and x/y to register values. Signed-off-by: Russell King <[email protected]>
2018-07-30drm/armada: clean up armada_drm_crtc_page_flip()Russell King1-12/+0
drm_mode_page_flip_ioctl() already takes care of checking the framebuffer format, and also assigns primary->fb after a successful call to this handler. These are both redundant, and can be removed. Signed-off-by: Russell King <[email protected]>
2018-07-09drm/armada: fix irq handlingRussell King1-2/+10
Add the missing locks to the IRQ enable/disable paths, and fix a comment in the interrupt handler: reading the ISR clears down the status bits, but does not reset the interrupt so it can signal again. That seems to require a write. Signed-off-by: Russell King <[email protected]>
2018-03-05drm: Don't pass clip to drm_atomic_helper_check_plane_state()Ville Syrjälä1-6/+2
Move the plane clip rectangle handling into drm_atomic_helper_check_plane_state(). Drivers no longer have to worry about such mundane details. v2: Convert armada, rcar, and sun4i as well v3: Resolve simple_kms_helper conflict Cc: Liviu Dudau <[email protected]> Cc: Brian Starkey <[email protected]> Cc: Mali DP Maintainers <[email protected]> Cc: Daniel Vetter <[email protected]> Cc: Gustavo Padovan <[email protected]> Cc: Sean Paul <[email protected]> Cc: Philipp Zabel <[email protected]> Cc: CK Hu <[email protected]> Cc: Neil Armstrong <[email protected]> Cc: Rob Clark <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: Laurent Pinchart <[email protected]> Cc: Sandy Huang <[email protected]> Cc: "Heiko Stübner" <[email protected]> Cc: Maxime Ripard <[email protected]> Cc: Thierry Reding <[email protected]> Cc: VMware Graphics <[email protected]> Cc: Sinclair Yeh <[email protected]> Cc: Thomas Hellstrom <[email protected]> Cc: Shawn Guo <[email protected]> Cc: Archit Taneja <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: Russell King <[email protected]> Suggested-by: Daniel Vetter <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Thierry Reding <[email protected]> Reviewed-by: Archit Taneja <[email protected]> #msm Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Acked-by: Liviu Dudau <[email protected]> #hdlcd,malidp Acked-by: Philipp Zabel <[email protected]> #imx,mtk Reviewed-by: Laurent Pinchart <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> #vmwgfx Acked-by: Neil Armstrong <[email protected]> #meson Acked-by: Shawn Guo <[email protected]> #zte
2018-03-05drm/armada: Use drm_mode_get_hv_timing() to populate plane clip rectangleVille Syrjälä1-4/+5
Use drm_mode_get_hv_timing() to fill out the plane clip rectangle. Since armada isn't atomic we'll use crtc->enabled and crtc->mode instead of the stuff under crtc_state. Once everyone agrees on how the clip rectangle gets set up we can move the code into drm_atomic_helper_check_plane_state(). Cc: Dave Airlie <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Dave Airlie <[email protected]>
2018-03-05drm/armada: Construct a temporary crtc state for plane checksVille Syrjälä1-1/+5
As armada isn't an atomic driver trying to pass a non-populated crtc->state to drm_atomic_helper_check_plane_state() will end in tears. Construct a temporary crtc state a la drm_plane_helper_check_update() and pass that instead. For now we just really need crtc_state->enable to be there. Cc: Dave Airlie <[email protected]> Cc: Russell King <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Reviewed-by: Daniel Vetter <[email protected]> Acked-by: Dave Airlie <[email protected]>
2018-01-05Merge branch 'drm-armada-devel-4.15' of ↵Dave Airlie1-120/+314
git://git.armlinux.org.uk/~rmk/linux-arm into drm-next This series builds upon the set of fixes previously submitted to move Armada DRM closer to atomic modeset. We're nowhere near yet, but this series helps to get us closer by unifying some of the differences between the primary and overlay planes. New features added allows userspace to disable the primary plane if overlay is full screen and there's nothing obscuring the colorkey - this saves having to fetch an entire buffer containing nothing but colorkey when displaying full screen video. [airlied: fixup for atomic plane helper rename: a01cb8ba3f6282934cff65e89ab36b18b14cbe27 Author: Ville Syrjälä <[email protected]> Date: Wed Nov 1 22:16:19 2017 +0200 drm: Move drm_plane_helper_check_state() into drm_atomic_helper.c ] * 'drm-armada-devel-4.15' of git://git.armlinux.org.uk/~rmk/linux-arm: (29 commits) drm/armada: expand overlay trace entry drm/armada: implement primary plane update drm/armada: extract register generation from armada_drm_primary_set() drm/armada: wait for previous work when moving overlay window drm/armada: move overlay plane register update generation drm/armada: re-organise overlay register update generation drm/armada: disable planes at next blanking period drm/armada: avoid work allocation drm/armada: allow armada_drm_plane_work_queue() to silently fail drm/armada: use drm_plane_helper_check_state() drm/armada: only enable HSMOOTH if scaling horizontally drm/armada: move writes of LCD_SPU_SRAM_PARA1 under lock drm/armada: move regs into armada_plane_work drm/armada: move event sending into armada_plane_work drm/armada: move fb retirement into armada_plane_work drm/armada: move overlay plane work out from under spinlock drm/armada: clear plane enable bit when disabling drm/armada: clean up armada_drm_crtc_plane_disable() drm/armada: allow the primary plane to be disabled drm/armada: wait and cancel any pending frame work at disable ...
2017-12-08drm/armada: implement primary plane updateRussell King1-1/+117
Implement primary plane update without having to go through a modeset to achieve that; the hardware does not require such complexity. This means we treat the primary plane as any other, allowing the format, size, position and scaling to be updated via the normal plane ioctls. This also allows us to seemlessly disable and re-enable the primary plane when (eg) displaying full-frame video without any graphic clipping the overlaid video - which saves wasting memory bandwidth needlessly verifying that the colorkey is indeed filling the entire primary plane. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: extract register generation from armada_drm_primary_set()Russell King1-9/+16
Extract the register generation from armada_drm_primary_set(), so that it can be re-used. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: disable planes at next blanking periodRussell King1-15/+44
Disable planes at the next blanking period rather than immediately. In order to achieve this, we need to delay the clearing of dcrtc->plane until after the next blanking period, so move that into a separate work function. To avoid races, we also need to move its assignment in the overlay code. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: avoid work allocationRussell King1-11/+13
Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: allow armada_drm_plane_work_queue() to silently failRussell King1-3/+1
Avoid printing an error message when armada_drm_plane_work_queue() is unable to get the vblank (eg, because we're doing a modeset.) Continue to report the failure to the caller, so the caller can handle this. Move the error message into armada_ovl_plane_update(). Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: only enable HSMOOTH if scaling horizontallyRussell King1-2/+3
Only enable the HSMOOTH control bit if we are scaling horizontally, otherwise it makes no sense to enable the horizontal scaler. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: move writes of LCD_SPU_SRAM_PARA1 under lockRussell King1-4/+6
Move writes of LCD_SPU_SRAM_PARA1 under the irq lock, so that we can add this to the frame updates at interrupt time when disabling a plane. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: move regs into armada_plane_workRussell King1-25/+17
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 <[email protected]>
2017-12-08drm/armada: move event sending into armada_plane_workRussell King1-14/+13
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 <[email protected]>
2017-12-08drm/armada: move fb retirement into armada_plane_workRussell King1-5/+7
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 <[email protected]>
2017-12-08drm/armada: move overlay plane work out from under spinlockRussell King1-1/+1
Move the overlay plane work out from under the spinlock so that both the primary and overlay planes run their work in the same context. This is necessary so that we can use frame works with the overlay plane. However, we must update the CRTC registers under the spinlock, so fix up the overlay code for that. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: clear plane enable bit when disablingRussell King1-4/+6
Clear the plane enable bit in the software state within armada_drm_plane_disable() when disabling either the primary or overlay planes. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: clean up armada_drm_crtc_plane_disable()Russell King1-12/+9
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 <[email protected]>
2017-12-08drm/armada: allow the primary plane to be disabledRussell King1-44/+55
Add our own hook to allow the primary plane to be disabled. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: wait and cancel any pending frame work at disableRussell King1-6/+22
Wait for a second, and if we time out, cancel any pending work when disabling the primary plane. This ensures that any pending work is completed or cleaned up prior to the disable taking effect. Signed-off-by: Russell King <[email protected]>
2017-12-08drm/armada: add work cancel callbackRussell King1-7/+16
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 <[email protected]>
2017-12-08drm/armada: store plane in armada_plane_workRussell King1-16/+11
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 <[email protected]>
2017-12-08drm/armada: add a common frame work allocatorRussell King1-7/+17
Add and use a common frame work allocator, initialising the frame work to a sane state. Signed-off-by: Russell King <[email protected]>