summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
AgeCommit message (Collapse)AuthorFilesLines
2016-08-25Merge branch 'for-next' of git://people.freedesktop.org/~seanpaul/dogwood ↵Dave Airlie1-32/+166
into drm-next This pull request contains the following rockchip drm changes: - Introduce support for rk3399 vop/crtc - Add PSR framework to the rockchip driver - Implement PSR in the rockchip analogix edp driver - Fix panel on/off in analogix to avoid damaging panels - Some miscellaneous fixes to clean up logs and code readability * 'for-next' of git://people.freedesktop.org/~seanpaul/dogwood: drm/rockchip: analogix_dp: drop unnecessary probe deferral "error" print drm/rockchip: Enable vblank without event drm/rockchip: Improve analogix-dp psr handling drm/rockchip: A couple small fixes to psr drm/rockchip: Use a spinlock to protect psr state drm/rockchip: Don't use a delayed worker for psr state changes drm/rockchip: Convert psr_list_mutex to spinlock and use it drm/rockchip: analogix_dp: implement PSR function drm/bridge: analogix_dp: add the PSR function support drm/rockchip: add an common abstracted PSR driver drm/rockchip: vop: export line flag function drm/bridge: analogix_dp: Ensure the panel is properly prepared/unprepared dt-bindings: add compatible strings for big/little rockchip vops dt-bindings: sort Rockchip vop compatible by chip's number drm/rockchip: vop: add rk3399 vop support drm/rockchip: vop: introduce VOP_REG_MASK drm/rockchip: sort registers define by chip's number
2016-08-23drm/rockchip: Enable vblank without eventSean Paul1-5/+10
vblank should be enabled regardless of whether an event is expected back. This is especially important for a cursor plane. Reviewed-by: Yakir Yang <ykk@rock-chips.com> Tested-by: Yakir Yang <ykk@rock-chip.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-08-23drm/rockchip: add an common abstracted PSR driverYakir Yang1-0/+6
The PSR driver have exported four symbols for specific device driver, and it's safe to call them in interrupt context: - rockchip_drm_psr_register() - rockchip_drm_psr_unregister() - rockchip_drm_psr_enable() - rockchip_drm_psr_disable() - rockchip_drm_psr_flush() Encoder driver should call the register/unregister interfaces to hook itself into common PSR driver, encoder have implement the 'psr_set' callback which use the set PSR state in hardware side. Crtc driver would call the enable/disable interfaces when vblank is enable/disable, after that the common PSR driver would call the encoder registered callback to set the PSR state. Fb driver would call the flush interface in 'fb->dirty' callback, this helper function would force all PSR enabled encoders to exit from PSR for 3 seconds. Signed-off-by: Yakir Yang <ykk@rock-chips.com> [seanpaul removed leftover psr_enabled/psr_work kruft from drm_vop.c] Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-08-23drm/rockchip: vop: export line flag functionYakir Yang1-0/+117
VOP have integrated a hardware counter which indicate the exact display line that vop is scanning. And if we're interested in a specific line, we can set the line number to vop line_flag register, and then vop would generate a line_flag interrupt for it. For example eDP PSR function is interested in the vertical blanking period, then driver could set the line number to zero. This patch have exported a symbol that allow other driver to listen the line flag event with given timeout limit: - rockchip_drm_wait_line_flag() Signed-off-by: Yakir Yang <ykk@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-08-23drm/rockchip: vop: add rk3399 vop supportMark Yao1-5/+10
There are two VOP in rk3399 chip, respectively VOP_BIG and VOP_LIT. most registers layout of this two vop is same, their framework are both VOP_FULL, the Major differences of this two is that: VOP_BIG max output resolution is 4096x2160. VOP_LIT max output resolution is 2560x1600 VOP_BIG support four windows. VOP_LIT only support two windows. RK3399 vop register layout is similar with rk3288, so some feature can reuse with rk3288. Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-08-23drm/rockchip: vop: introduce VOP_REG_MASKMark Yao1-22/+23
Some new vop register support mask, bit[16-31] is mask, bit[0-15] is value, the mask is correspond to the value. Signed-off-by: Mark Yao <mark.yao@rock-chips.com> [seanpaul masked 'v' per tfiga's review comments] Reviewed-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org>
2016-08-23drm/rockchip: Don't continue trying to enable crtc on failureSean Paul1-14/+17
If vop_enable fails, don't continue on, it causes system hangs. Reviewed-by: Yakir Yank <ykk@rock-chips.com> Tested-by: Yakir Yank <ykk@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1471302749-2811-1-git-send-email-seanpaul@chromium.org
2016-08-19drm: Allow drivers to modify plane_state in prepare_fb/cleanup_fbChris Wilson1-2/+2
The drivers have to modify the atomic plane state during the prepare_fb callback so they track allocations, reservations and dependencies for this atomic operation involving this fb. In particular, how else do we set the plane->fence from the framebuffer! Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20160818180017.20508-1-chris@chris-wilson.co.uk
2016-08-18drm/rockchip: Use DRM_DEV_ERROR in vopSean Paul1-10/+14
Since we can have multiple vops, use DRM_DEV_ERROR to make logs easier to process. Acked-by: Mark Yao <mark.yao@rockchip.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1471021254-2563-3-git-send-email-seanpaul@chromium.org
2016-08-08drm/rockchip: Use drm_plane_helper_check_state()Ville Syrjälä1-20/+5
Replace the use of drm_plane_helper_check_update() with drm_plane_helper_check_state() since we have a plane state. Rockchip looks to handling plane clipping rather well already (unlikje most arm drm drivers) so there are no function changes here. Cc: Yao <mark.yao@rock-chips.com> Cc: linux-rockchip@lists.infradead.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1469549224-1860-8-git-send-email-ville.syrjala@linux.intel.com
2016-08-08drm/rockchip: Use drm_plane_state.{src, dst}Ville Syrjälä1-6/+4
Replace the private drm_rects in vop_plane_state with the ones now living in drm_plane_state. Cc: Yao <mark.yao@rock-chips.com> Cc: linux-rockchip@lists.infradead.org Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Acked-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1469549224-1860-7-git-send-email-ville.syrjala@linux.intel.com
2016-07-19drm/rockchip: allocate correct crtc state structure on resetJohn Keeping1-1/+12
Because we are using a custom crtc_state structure, we must override the reset helper to allocate the correct amount of memory. Cc: stable@vger.kernel.org Fixes: 4e257d9eee23 ("drm/rockchip: get rid of rockchip_drm_crtc_mode_config") Signed-off-by: John Keeping <john@metanate.com> Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Reviewed-by: Sean Paul <seanpaul@chromium.org>
2016-07-19drm/rockchip: vop: correct the source size of uv scale factor settingMark Yao1-2/+2
When the input color format is YUV, we need to do some external scale for CBCR. Like, * In YUV420 data format: cbcr_xscale = dst_w / src_w * 2; cbcr_yscale = dst_h / src_h * 2; * In YUV422 data format: cbcr_xscale = dst_w / src_w * 2; cbcr_yscale = dst_h / src_h; * In YUV444 data format cbcr_xscale = dst_w / src_w; cbcr_yscale = dst_h / src_h; Signed-off-by: Yakir Yang <ykk@rock-chips.com>
2016-07-19drm/rockchip: fix "should it be static?" warningsJohn Keeping1-2/+2
Combined with the previous commit, this fixes all of the sparse warnings in drm/rockchip. Signed-off-by: John Keeping <john@metanate.com>
2016-06-17drm: Deal with rotation in drm_plane_helper_check_update()Ville Syrjälä1-0/+1
drm_plane_helper_check_update() needs to account for the plane rotation for correct clipping/scaling calculations. Do so. There was an earlier attempt [1] to add this into intel_check_primary_plane() but I requested that it'd be put into the helper instead. An updated patch never materialized AFAICS, so I went ahead and cooked one up myself. v2: Deal with new drm_plane_helper_check_update() callers [1] https://patchwork.freedesktop.org/patch/65177/ Cc: Nabendu Maiti <nabendu.bikash.maiti@intel.com> Cc: Noralf Trønnes <noralf@tronnes.org> Cc: CK Hu <ck.hu@mediatek.com> Cc: Mark Yao <mark.yao@rock-chips.com> Cc: Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1466172790-10025-1-git-send-email-ville.syrjala@linux.intel.com
2016-06-10drm/rockchip: Nuke pending event handling in precloseDaniel Vetter1-20/+0
This is now handled by the core, drivers can totally ignore lifetime issues of drm events. Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Mark yao <mark.yao@rock-chips.com> Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-11-git-send-email-daniel.vetter@ffwll.ch
2016-06-10drm/rockchip: convert to helper nonblocking atomic commitDaniel Vetter1-2/+18
With the various bits fixed rockchip now has an atomic compliant handling/signalling of crtc_state->event, which means we can just switch over to the new nonblocking helpers and remove some code. v2: Fixes from Tomeu. v3: Send out vblank events correctly when shutting down a crtc for good. This is part of the atomic interface contract. v4: Properly protect vop->event. v5: Add more WARN_ON to check vop->event isn't clobbered. Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Mark yao <mark.yao@rock-chips.com> Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2016-06-10drm/rockchip: Fix crtc_state->event signallingDaniel Vetter1-6/+18
It's not permissible to look at plane->state from interrupt context, since doing that would need the irq handler to acquire the plane->mutex lock. The other problem is that if we pipeline updates using the new nonblocking atomic helpers new state gets commit before the irq handler fires, resulting in a lost event. Fix both issues by caching the necessary values in vop_win, protected by dev->event_lock. Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Mark yao <mark.yao@rock-chips.com> Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-19-git-send-email-daniel.vetter@ffwll.ch
2016-06-10drm/rockchip: Disarm vop->is_enabledDaniel Vetter1-6/+0
With atomic helpers there's no need to track the enabled state of a pipe any more, because atomic helpers track this accurately already. Just disable the early returns, since the debug checks might be useful. v2: Don't call drm_helper_disable_unused_functions, it blows up without this check. At least explains why rockchip still needed this old legacy-style state tracing - to work around issues from calling other legacy style functions! Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Mark yao <mark.yao@rock-chips.com> Tested-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1465388359-8070-18-git-send-email-daniel.vetter@ffwll.ch
2016-06-03drm/fence: add fence to drm_pending_eventGustavo Padovan1-1/+1
Now a drm_pending_event can either send a real drm_event or signal a fence, or both. It allow us to signal via fences when the buffer is displayed on the screen. Which in turn means that the previous buffer is not in use anymore and can be freed or sent back to another driver for processing. v2: Comments from Daniel Vetter - call fence_signal in drm_send_event_locked() - remove unneeded !e->event check v3: Remove drm_pending_event->destroy to fix a leak when e->file_priv is not set. Reviewed-by: Sean Paul <seanpaul@chromium.org> Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.co.uk> (v2) [danvet: fix one e->destroy in arcpgu due to rebasing.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1464818821-5736-13-git-send-email-daniel.vetter@ffwll.ch
2016-05-17drm: Drop plane argument from __drm_atomic_helper_plane_destroy_stateDaniel Vetter1-1/+1
It's unused, and really this helper should only look at the state structure and nothing else. v2: Fix commit message (Laurent). v3: Rebase onto mtk driver merge. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Eric Anholt <eric@anholt.net> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Cc: Inki Dae <inki.dae@samsung.com> Cc: Tomi Valkeinen <tomi.valkeinen@ti.com> Cc: Mark Yao <mark.yao@rock-chips.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1462804451-15318-2-git-send-email-daniel.vetter@ffwll.ch
2016-05-17drm: Drop crtc argument from __drm_atomic_helper_crtc_destroy_stateDaniel Vetter1-1/+1
It's unused, and really this helper should only look at the state structure and nothing else. v2: Rebase on top of rockchip changes v3: Drop unrelated hunk, spotted by Laurent. v4: Rebase onto mtk driver merge. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Thierry Reding <thierry.reding@gmail.com> Cc: Eric Anholt <eric@anholt.net> Cc: Mark Yao <mark.yao@rock-chips.com> Acked-by: Thierry Reding <thierry.reding@gmail.com> Acked-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1462804451-15318-1-git-send-email-daniel.vetter@ffwll.ch
2016-05-03drm/rockchip: vop: Initialize vskiplines to zeroMark Yao1-1/+1
There is a path that use vskiplines with non-initialize. That would cause vop abnormal behavior. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-03drm/rockchip: vop: fix iommu crash with async atomicMark Yao1-0/+18
After async atomic_commit callback, drm_atomic_clean_old_fb will clean all old fb, but because async, the old fb may be also on the vop hardware, dma will access the old fb buffer, clean old fb will cause iommu page fault. Reference the fb and unreference it when the fb actuall swap out from vop hardware. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2016-05-03drm/rockchip: get rid of rockchip_drm_crtc_mode_configMark Yao1-34/+41
We need to take care of the vop status when use rockchip_drm_crtc_mode_config, if vop is disabled, the function would failed, that is terrible. Save output_type and output_mode into rockchip_crtc_state, it's nice to make them into atomic. Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Tested-by: John Keeping <john@metanate.com>
2016-03-28drm/rockchip: vop: Fix vop crtc cleanupDouglas Anderson1-3/+24
This fixes a few problems in the vop crtc cleanup (handling error paths and cleanup upon exit): * The vop_create_crtc() error path had an unsafe version of the iterator used for iterating over all planes (though it was destroying planes in the iterator so should have used the safe version) * vop_destroy_crtc() - wasn't calling vop_plane_destroy(), which made slub_debug unhappy, at least if we ended up running this due to a deferred probe. * In vop_create_crtc() if we were missing the "port" device tree node we would fail but not return an error (found by code inspection). Fix these problems. Signed-off-by: Douglas Anderson <dianders@chromium.org>
2016-03-28drm/rockchip: vop: Disable planes when disabling CRTCTomeu Vizoso1-0/+15
When a VOP is re-enabled, it will start scanning right away the framebuffers that were configured from the last time, even if those have been destroyed already. To prevent the VOP from trying to access freed memory, disable all its windows when the CRTC is being disabled, then each window will get a valid framebuffer address before it's enabled again. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Link: http://lkml.kernel.org/g/CAAObsKAv+05ih5U+=4kic_NsjGMhfxYheHR8xXXmacZs+p5SHw@mail.gmail.com
2016-03-28drm/rockchip: vop: Don't reject empty modesetsTomeu Vizoso1-3/+0
So that when DRM_IOCTL_MODE_SETCRTC is called without a FB nor mode, the CRTC gets disabled. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Link: http://lkml.kernel.org/g/CAAObsKAv+05ih5U+=4kic_NsjGMhfxYheHR8xXXmacZs+p5SHw@mail.gmail.com
2016-03-28drm/rockchip: cancel pending vblanks on closeJohn Keeping1-0/+20
When closing the DRM device while a vblank is pending, we access file_priv after it has been free'd, which gives: Unable to handle kernel NULL pointer dereference at virtual address 00000000 ... PC is at __list_add+0x5c/0xe8 LR is at send_vblank_event+0x54/0x1f0 ... [<c02952e8>] (__list_add) from [<c031a7b4>] (send_vblank_event+0x54/0x1f0) [<c031a760>] (send_vblank_event) from [<c031a9c0>] (drm_send_vblank_event+0x70/0x78) [<c031a950>] (drm_send_vblank_event) from [<c031a9f8>] (drm_crtc_send_vblank_event+0x30/0x34) [<c031a9c8>] (drm_crtc_send_vblank_event) from [<c0339ad8>] (vop_isr+0x224/0x28c) [<c03398b4>] (vop_isr) from [<c0081780>] (handle_irq_event_percpu+0x12c/0x3e4) This can be triggered somewhat reliably with: modetest -M rockchip -v -s ... Add a preclose hook to the driver so that we can discard any pending vblank events when the device is closed. Signed-off-by: John Keeping <john@metanate.com>
2016-03-28drm/rockchip: vop: fix crtc size in plane checkJohn Keeping1-6/+8
If the geometry of a crtc is changing in an atomic update then we must validate the plane size against the new state of the crtc and not the current size, otherwise if the crtc size is increasing the plane will be cropped at the previous size and will not fill the screen. Signed-off-by: John Keeping <john@metanate.com>
2016-01-18drm/rockchip: vop: fix mask when updating interruptsJohn Keeping1-7/+9
Commit dbb3d94 (drm/rockchip: vop: move interrupt registers into vop_data) introduced new macros for updating the interrupt control registers but these always use the mask from the register definition without refining it for the particular bits that are being changed. This means that whenever we enable/disable a particular interrupt we end up disabling all of the others as a side effect. Signed-off-by: John Keeping <john@metanate.com>
2016-01-06drm: rockchip: Support Synopsys DW MIPI DSIChris Zhong1-0/+3
Add support for Synopsys DesignWare MIPI DSI controller which is embedded in the rk3288 SoCs. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Acked-by: Mark Yao <mark.yao@rock-chips.com>
2016-01-06drm/rockchip: return a true clock rate to adjusted_modeChris Zhong1-0/+5
Since the mipi dsi driver need to use the clock of vop to make the calculation of Blanking. But sometimes the clock driver can not set a accurate clock_rate for vop, get it by clk_round_rate before mode_set, so we can get the true value. Signed-off-by: Chris Zhong <zyw@rock-chips.com> Acked-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-31drm/rockchip: vop: export vop_component_ops to modulesStephen Rothwell1-0/+1
Fixes: a67719d18229 ("drm/rockchip: vop: spilt register related into rockchip_reg_vop.c") Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au> Acked-by: Mark Yao <mark.yao@rock-chips.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
2015-12-28drm/rockchip: vop: spilt scale regstersMark Yao1-15/+31
There are two version scale control register found on vop, scale full version found on rk3288, support extension registers. and scale little version found on rk3036, only support common scale. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: vop: spilt register related into rockchip_reg_vop.cMark Yao1-323/+2
No functional updates. Spilt register related into another file would be nice to multi vop driver, Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: vop: move interrupt registers into vop_dataMark Yao1-12/+69
Move interrupt registers into vop_data, so it can use at multi-vop driver Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: vop: merge vop cfg_done into vop_dataMark Yao1-5/+8
Move cfg_done register into vop_data, so it can use at multi-vop driver Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: direct config connecter gate and out_modeMark Yao1-21/+18
Both connecter gate and out_mode are not conflict with mode set configure. Direct setting connecter gate and out_mode, that allow connector do rockchip_drm_crtc_mode_config after mode set. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: Optimization vop mode setMark Yao1-16/+35
Rk3288 vop timing registers is immediately register, when configure timing on display active time, will cause tearing. use dclk reset is not a good idea to avoid this tearing. we can avoid tearing by using standby register. Vop standby register will take effect at end of current frame, and go back to work immediately when exit standby. So we can use standby register to protect this context. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: Convert to support atomic APIMark Yao1-395/+262
Rockchip vop not support hw vblank counter, needed check the committed register if it's really take effect. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: vop: replace dpms with enable/disableMark Yao1-33/+4
For vop, power by enable/disable is more suitable then legacy dpms function, and enable/disable more closely to the new atomic API. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-28drm/rockchip: Use new vblank api drm_crtc_vblank_*Mark Yao1-13/+11
No functional update, drm_vblank_* is the legacy version of drm_crtc_vblank_*. and use new api make driver more clean. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-11drm: Pass 'name' to drm_universal_plane_init()Ville Syrjälä1-2/+2
Done with coccinelle for the most part. It choked on msm/mdp/mdp5/mdp5_plane.c like so: "BAD:!!!!! enum drm_plane_type type;" No idea how to deal with that, so I just fixed that up by hand. Also it thinks '...' is part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder in its place and got rid of it with sed afterwards. I didn't convert drm_plane_init() since passing the varargs through would mean either cpp macros or va_list, and I figured we don't care about these legacy functions enough to warrant the extra pain. @@ typedef uint32_t; identifier dev, plane, possible_crtcs, funcs, formats, format_count, type; @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, unsigned long possible_crtcs, const struct drm_plane_funcs *funcs, const uint32_t *formats, unsigned int format_count, enum drm_plane_type type + ,const char *name, int DOTDOTDOT ) { ... } @@ identifier dev, plane, possible_crtcs, funcs, formats, format_count, type; @@ int drm_universal_plane_init(struct drm_device *dev, struct drm_plane *plane, unsigned long possible_crtcs, const struct drm_plane_funcs *funcs, const uint32_t *formats, unsigned int format_count, enum drm_plane_type type + ,const char *name, int DOTDOTDOT ); @@ expression E1, E2, E3, E4, E5, E6, E7; @@ drm_universal_plane_init(E1, E2, E3, E4, E5, E6, E7 + ,NULL ) v2: Split crtc and plane changes apart Pass NUL for no-name instead of "" Leave drm_plane_init() alone v3: Add ', or NULL...' to @name kernel doc (Jani) Annotate the function with __printf() attribute (Jani) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449670795-2853-1-git-send-email-ville.syrjala@linux.intel.com
2015-12-11drm: Pass 'name' to drm_crtc_init_with_planes()Ville Syrjälä1-1/+1
Done with coccinelle for the most part. However, it thinks '...' is part of the semantic patch, so I put an 'int DOTDOTDOT' placeholder in its place and got rid of it with sed afterwards. I didn't convert drm_crtc_init() since passing the varargs through would mean either cpp macros or va_list, and I figured we don't care about these legacy functions enough to warrant the extra pain. @@ identifier dev, crtc, primary, cursor, funcs; @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, struct drm_plane *primary, struct drm_plane *cursor, const struct drm_crtc_funcs *funcs + ,const char *name, int DOTDOTDOT ) { ... } @@ identifier dev, crtc, primary, cursor, funcs; @@ int drm_crtc_init_with_planes(struct drm_device *dev, struct drm_crtc *crtc, struct drm_plane *primary, struct drm_plane *cursor, const struct drm_crtc_funcs *funcs + ,const char *name, int DOTDOTDOT ); @@ expression E1, E2, E3, E4, E5; @@ drm_crtc_init_with_planes(E1, E2, E3, E4, E5 + ,NULL ) v2: Split crtc and plane changes apart Pass NULL for no-name instead of "" Leave drm_crtc_init() alone v3: Add ', or NULL...' to @name kernel doc (Jani) Annotate the function with __printf() attribute (Jani) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/1449670771-2751-1-git-send-email-ville.syrjala@linux.intel.com
2015-12-02drm/rockchip: Use CRTC vblank event interfaceDaniel Stone1-1/+1
Passing -1 as the pipe for vblank events now triggers a WARN_ON, but had previously made multi-screen unusable anyway. Pass the correct pipe to the event-send function, and use the new API to make this a bit easier for us. Fixes WARN present since cc1ef118fc for every pageflip event sent: [ 209.549969] ------------[ cut here ]------------ [ 209.554592] WARNING: CPU: 3 PID: 238 at drivers/gpu/drm/drm_irq.c:924 drm_vblank_count_and_time+0x80/0x88 [drm]() [ 209.564832] Modules linked in: [...] [ 209.612401] CPU: 3 PID: 238 Comm: irq/41-ff940000 Tainted: G W 4.3.0-rc6+ #71 [ 209.620647] Hardware name: Rockchip (Device Tree) [ 209.625348] [<c001bb80>] (unwind_backtrace) from [<c001615c>] (show_stack+0x20/0x24) [ 209.633079] [<c001615c>] (show_stack) from [<c02b2c50>] (dump_stack+0x8c/0x9c) [ 209.640289] [<c02b2c50>] (dump_stack) from [<c0052e88>] (warn_slowpath_common+0x94/0xc4) [ 209.648364] [<c0052e88>] (warn_slowpath_common) from [<c0052f74>] (warn_slowpath_null+0x2c/0x34) [ 209.657139] [<c0052f74>] (warn_slowpath_null) from [<bf17dc30>] (drm_vblank_count_and_time+0x80/0x88 [drm]) [ 209.666875] [<bf17dc30>] (drm_vblank_count_and_time [drm]) from [<bf17e484>] (drm_send_vblank_event+0x74/0x7c [drm]) [ 209.677385] [<bf17e484>] (drm_send_vblank_event [drm]) from [<bf4c1144>] (vop_win_state_complete+0x4c/0x70 [rockchip_drm_vop]) [ 209.688757] [<bf4c1144>] (vop_win_state_complete [rockchip_drm_vop]) from [<bf4c3bdc>] (vop_isr_thread+0x170/0x1d4 [rockchip_drm_vop]) [ 209.700822] [<bf4c3bdc>] (vop_isr_thread [rockchip_drm_vop]) from [<c00ab93c>] (irq_thread_fn+0x2c/0x50) [ 209.710284] [<c00ab93c>] (irq_thread_fn) from [<c00abcac>] (irq_thread+0x13c/0x188) [ 209.717927] [<c00abcac>] (irq_thread) from [<c00723c8>] (kthread+0xec/0x104) [ 209.724965] [<c00723c8>] (kthread) from [<c0011638>] (ret_from_fork+0x14/0x3c) [ 209.732171] ---[ end trace 0690bc604f5d535d ]--- Signed-off-by: Daniel Stone <daniels@collabora.com> Cc: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Cc: Thierry Reding <treding@nvidia.com> Cc: Heiko Stuebner <heiko@sntech.de> Tested-By: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Tested-by: Heiko Stuebner <heiko@sntech.de> Reviewed-by: Thierry Reding <treding@nvidia.com>
2015-12-02drm/rockchip: Fix module autoload for OF platform driverLuis de Bethencourt1-0/+1
This platform driver has a OF device ID table but the OF module alias information is not created so module autoloading won't work. Signed-off-by: Luis de Bethencourt <luisbg@osg.samsung.com>
2015-12-02drm/rockchip: vop: fix window origin calculationDominik Behr1-2/+2
VOP_WINx_DSP_ST does not require subtracting 1 from the values written to it. It actually causes the screen to be shifted by one pixel. Signed-off-by: Mark Yao <mark.yao@rock-chips.com> Tested-by: Yakir Yang <ykk@rock-chips.com> Reviewed-by: Heiko Stuebner <heiko@sntech.de> Tested-by: Heiko Stuebner <heiko@sntech.de> Signed-off-by: Dominik Behr <dbehr@chromium.org> Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
2015-12-01drm/rockchip: vop: Correct enabled clocks during setupSjoerd Simons1-22/+14
When doing the initial setup both the hclk and the aclk need to be enabled otherwise the board will simply hang. This only occurs when building the vop driver as a module, when its built-in the initial setup happens to run before the clock framework shuts of unused clocks (including the aclk). While there also switch to doing prepare and enable in one step rather then separate steps to reduce the amount of code required. Signed-off-by: Sjoerd Simons <sjoerd.simons@collabora.co.uk> Acked-by: Mark Yao <mark.yao@rock-chips.com> Tested-by: Yakir Yang <ykk@rock-chips.com> Tested-by: Romain Perier <romain.perier@gmail.com>
2015-08-26drm/rockchip: vop: support plane scaleMark Yao1-2/+196
Win_full support 1/8 to 8 scale down/up engine, support all format scale. Signed-off-by: Mark Yao <mark.yao@rock-chips.com>