Mark yao
eb5cb6aa9a
drm/rockchip: vop: add a series of vop support
...
Vop Full framework now has following vops:
IP version chipname
3.1 rk3288
3.2 rk3368
3.4 rk3366
3.5 rk3399 big
3.6 rk3399 lit
3.7 rk3228
3.8 rk3328
The above IP version is from H/W define, some of vop support get
the IP version from VERSION_INFO register, some are not.
hardcode the IP version for each vop to identify them.
major version: used for IP structure, Vop full framework is 3,
vop little framework is 2.
minor version: on same structure, newer design vop will bigger
then old one.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Reviewed-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Tested-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patchwork.freedesktop.org/patch/msgid/1501049971-6131-1-git-send-email-mark.yao@rock-chips.com
2017-07-31 08:44:06 +08:00
Mark yao
9a61c54b9b
drm/rockchip: vop: group vop registers
...
Grouping the vop registers facilitates make register
definition clearer, and also is useful for different vop
reuse the same group register.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Reviewed-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Tested-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patchwork.freedesktop.org/patch/msgid/1501221986-29722-1-git-send-email-mark.yao@rock-chips.com
2017-07-31 08:44:03 +08:00
Mark yao
ac6560dfc8
drm/rockchip: vop: move line_flag_num to interrupt registers
...
In the hardware design process, the design of line flags
register is associated with the interrupt register,
placing the line flags in the interrupt definition is
more reasonable, and it would make multi-vop define easilier.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Tested-by: Heiko Stuebner <heiko@sntech.de >
Link: https://patchwork.freedesktop.org/patch/msgid/1501049960-6006-1-git-send-email-mark.yao@rock-chips.com
2017-07-31 08:44:00 +08:00
Mark yao
9548e1b49a
drm/rockchip: vop: move write_relaxed flags to vop register
...
Since the drm atomic framework, only a small part of the vop
register needs sync write, Currently seems only following registers
need sync write:
cfg_done, standby and interrupt related register.
All ctrl registers are using the sync write method that is
inefficient, hardcode the write_relaxed flags to vop registers,
then can only do synchronize write for those actual needed register.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Tested-by: Heiko Stuebner <heiko@sntech.de >
Reviewed-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1501049953-5946-1-git-send-email-mark.yao@rock-chips.com
2017-07-31 08:43:57 +08:00
Mark yao
60b7ae7fa2
drm/rockchip: vop: initialize registers directly
...
At present we are using init_table to initialize some
registers, but the Register init table use un-document define,
it is unreadable, and sometimes we only want to update tiny
bits, init table method is not friendly, it's diffcult to
reuse for difference chips.
To make it clean, initialize registers directly, and drops
init_table mechanism out.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Tested-by: Heiko Stuebner <heiko@sntech.de >
Reviewed-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Link: https://patchwork.freedesktop.org/patch/msgid/1501049946-5877-1-git-send-email-mark.yao@rock-chips.com
2017-07-31 08:43:48 +08:00
Noralf Trønnes
8cfd4f5de4
drm/rockchip: Use .dumb_map_offset and .dumb_destroy defaults
...
This driver can use the drm_driver.dumb_destroy and
drm_driver.dumb_map_offset defaults, so no need to set them.
Cc: Mark Yao <mark.yao@rock-chips.com >
Signed-off-by: Noralf Trønnes <noralf@tronnes.org >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/1500837417-40580-25-git-send-email-noralf@tronnes.org
2017-07-29 14:00:35 +02:00
Maxime Ripard
81a099ac49
drm/atomic: implement drm_atomic_helper_commit_tail for runtime_pm users
...
The current drm_atomic_helper_commit_tail helper works only if the CRTC is
accessible, and documents an alternative implementation that is supposed to
be used if that happens.
That implementation is then duplicated by some drivers. Instead of
documenting it, let's implement an helper that all the relevant users can
use directly.
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: https://patchwork.freedesktop.org/patch/msgid/a8f92dc70048bab746e94dadd1c23200626aff60.1500555652.git-series.maxime.ripard@free-electrons.com
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2017-07-26 13:45:08 +02:00
Rob Herring
4bf99144d2
drm: Convert to using %pOF instead of full_name
...
Now that we have a custom printf format specifier, convert users of
full_name to use %pOF instead. This is preparation to remove storing
of the full path string for each node.
Signed-off-by: Rob Herring <robh@kernel.org >
Cc: Russell King <linux@armlinux.org.uk >
Cc: David Airlie <airlied@linux.ie >
Cc: Daniel Vetter <daniel.vetter@intel.com >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Sean Paul <seanpaul@chromium.org >
Cc: Inki Dae <inki.dae@samsung.com >
Cc: Joonyoung Shim <jy0922.shim@samsung.com >
Cc: Seung-Woo Kim <sw0312.kim@samsung.com >
Cc: Kyungmin Park <kyungmin.park@samsung.com >
Cc: Kukjin Kim <kgene@kernel.org >
Cc: Krzysztof Kozlowski <krzk@kernel.org >
Cc: Javier Martinez Canillas <javier@osg.samsung.com >
Cc: Xinliang Liu <z.liuxinliang@hisilicon.com >
Cc: Rongrong Zou <zourongrong@gmail.com >
Cc: Xinwei Kong <kong.kongxinwei@hisilicon.com >
Cc: Chen Feng <puck.chen@hisilicon.com >
Cc: CK Hu <ck.hu@mediatek.com >
Cc: Philipp Zabel <p.zabel@pengutronix.de >
Cc: Matthias Brugger <matthias.bgg@gmail.com >
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Carlo Caione <carlo@caione.org >
Cc: Kevin Hilman <khilman@baylibre.com >
Cc: Thierry Reding <thierry.reding@gmail.com >
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Cc: Mark Yao <mark.yao@rock-chips.com >
Cc: Heiko Stuebner <heiko@sntech.de >
Cc: Maxime Ripard <maxime.ripard@free-electrons.com >
Cc: Chen-Yu Tsai <wens@csie.org >
Cc: Jyri Sarha <jsarha@ti.com >
Cc: Tomi Valkeinen <tomi.valkeinen@ti.com >
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-mediatek@lists.infradead.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-renesas-soc@vger.kernel.org
Cc: linux-rockchip@lists.infradead.org
Partially-Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com >
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de >
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com >
[seanpaul changed subject prefix and fixed conflict in stm/ltdc.c]
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2017-07-26 13:45:06 +02:00
Daniel Vetter
af05559854
Merge airlied/drm-next into drm-misc-next
...
I need this to be able to apply the deferred fbdev setup patches, I
need the relevant prep work that landed through the drm-intel tree.
Also squash in conflict fixup from Laurent Pinchart.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
2017-07-26 13:43:33 +02:00
Arnd Bergmann
b9670ca20a
drm/rockchip: fix Kconfig dependencies
...
A bug that I had fixed earlier just came back, with CONFIG_EXTCON=m,
the rockchip drm driver will fail to link:
drivers/gpu/drm/rockchip/cdn-dp-core.o: In function `cdn_dp_get_port_lanes':
cdn-dp-core.c:(.text.cdn_dp_get_port_lanes+0x30): undefined reference to `extcon_get_state'
cdn-dp-core.c:(.text.cdn_dp_get_port_lanes+0x6c): undefined reference to `extcon_get_property'
drivers/gpu/drm/rockchip/cdn-dp-core.o: In function `cdn_dp_check_sink_connection':
cdn-dp-core.c:(.text.cdn_dp_check_sink_connection+0x80): undefined reference to `extcon_get_state'
drivers/gpu/drm/rockchip/cdn-dp-core.o: In function `cdn_dp_enable':
cdn-dp-core.c:(.text.cdn_dp_enable+0x748): undefined reference to `extcon_get_property'
The problem is that that the sub-drivers are now all linked into the
main rockchip drm module, which breaks all the Kconfig dependencies
that are specified in the options for those sub-drivers.
This clarifies the dependency to ensure that we can only turn on the DP
driver when EXTCON is reachable. As the 'select' statements can now
cause additional options to become built-in when they should be
loadable modules, I'm moving those into the main driver config option.
The dependency on DRM_ROCKCHIP can be reduced into a single 'if'
statement here for brevity, but this has no functional effect.
Fixes: b6705157b2
("drm/rockchip: add extcon dependency for DP")
Fixes: 8820b68bd3
("drm/rockchip: Refactor the component match logic.")
Link: https://patchwork.kernel.org/patch/9648761/
Acked-by: Guenter Roeck <groeck@chromium.org >
Tested-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20170721211214.3386387-1-arnd@arndb.de
2017-07-24 09:53:09 +08:00
Shashank Sharma
0c1f528cb1
drm: handle HDMI 2.0 VICs in AVI info-frames
...
HDMI 1.4b support the CEA video modes as per range of CEA-861-D (VIC 1-64).
For any other mode, the VIC filed in AVI infoframes should be 0.
HDMI 2.0 sinks, support video modes range as per CEA-861-F spec, which is
extended to (VIC 1-107).
This patch adds a bool input variable, which indicates if the connected
sink is a HDMI 2.0 sink or not. This will make sure that we don't pass a
HDMI 2.0 VIC to a HDMI 1.4 sink.
This patch touches all drm drivers, who are callers of this function
drm_hdmi_avi_infoframe_from_display_mode but to make sure there is
no change in current behavior, is_hdmi2 is kept as false.
In case of I915 driver, this patch:
- checks if the connected display is HDMI 2.0.
- HDMI infoframes carry one of this two type of information:
- VIC for 4K modes for HDMI 1.4 sinks
- S3D information for S3D modes
As CEA-861-F has already defined VICs for 4K videomodes, this
patch doesn't allow sending HDMI infoframes for HDMI 2.0 sinks,
until the mode is 3D.
Cc: Ville Syrjala <ville.syrjala@linux.intel.com >
Cc: Jose Abreu <jose.abreu@synopsys.com >
Cc: Andrzej Hajda <a.hajda@samsung.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Daniel Vetter <daniel.vetter@intel.com >
PS: This patch touches a few lines in few files, which were
already above 80 char, so checkpatch gives 80 char warning again.
- gpu/drm/omapdrm/omap_encoder.c
- gpu/drm/i915/intel_sdvo.c
V2: Rebase, Added r-b from Andrzej
V3: Addressed review comment from Ville:
- Do not send VICs in both AVI-IF and HDMI-IF
send only one of it.
V4: Rebase
V5: Added r-b from Neil.
Addressed review comments from Ville
- Do not block HDMI vendor IF, instead check for VIC while
handling AVI infoframes
V6: Rebase
V7: Rebase
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com >
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com >
Signed-off-by: Shashank Sharma <shashank.sharma@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1499960000-9232-2-git-send-email-shashank.sharma@intel.com
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
2017-07-14 21:23:54 +03:00
Maarten Lankhorst
e741f2b182
drm/rockchip: Use for_each_oldnew_plane_in_state in vop_crtc_atomic_flush
...
for_each_obj_in_state is about to be removed, so use the new atomic
iterator macros.
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Cc: Mark Yao <mark.yao@rock-chips.com >
Cc: Heiko Stuebner <heiko@sntech.de >
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Link: http://patchwork.freedesktop.org/patch/msgid/20170712081344.25495-10-maarten.lankhorst@linux.intel.com
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Acked-by: Mark Yao <mark.yao@rock-chips.com >
2017-07-13 09:53:43 +02:00
Gustavo A. R. Silva
6f6e0b217a
drm/rockchip: fix NULL check on devm_kzalloc() return value
...
The right variable to check here is port, not dp.
This issue was detected using Coccinelle and the following semantic patch:
@@
expression x;
identifier fld;
@@
* x = devm_kzalloc(...);
... when != x == NULL
x->fld
Signed-off-by: Gustavo A. R. Silva <garsilva@embeddedor.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/20170706215833.GA25411@embeddedgus
2017-07-10 14:13:00 -04:00
Laurent Pinchart
64581714b5
drm: Convert atomic drivers from CRTC .disable() to .atomic_disable()
...
The CRTC .disable() helper operation is deprecated for atomic drivers,
the new .atomic_disable() helper operation being preferred. Convert all
atomic drivers to .atomic_disable() to avoid cargo-cult use of
.disable() in new drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com > # for sun4i
Acked-by: Philipp Zabel <p.zabel@pengutronix.de > # for mediatek
Acked-by: Alexey Brodkin <abrodkin@synopsys.com > # for arcpgu
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com > # for atmel-hlcdc
Tested-by: Philippe Cornu <philippe.cornu@st.com > # for stm
Acked-by: Philippe Cornu <philippe.cornu@st.com > # for stm
Acked-by: Vincent Abriou <vincent.abriou@st.com > # for sti
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com > # for vmwgfx
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/20170630093646.7928-3-laurent.pinchart+renesas@ideasonboard.com
2017-06-30 14:53:15 +02:00
Laurent Pinchart
0b20a0f8c3
drm: Add old state pointer to CRTC .enable() helper function
...
The old state is useful for drivers that need to perform operations at
enable time that depend on the transition between the old and new
states.
While at it, rename the operation to .atomic_enable() to be consistent
with .atomic_disable(), as the .enable() operation is used by atomic
helpers only.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com > # for sun4i
Acked-by: Philipp Zabel <p.zabel@pengutronix.de > # for imx-drm and mediatek
Acked-by: Alexey Brodkin <abrodkin@synopsys.com > # for arcpgu
Acked-by: Boris Brezillon <boris.brezillon@free-electrons.com > # for atmel-hlcdc
Acked-by: Liviu Dudau <Liviu.Dudau@arm.com > # for hdlcd and mali-dp
Acked-by: Stefan Agner <stefan@agner.ch > # for fsl-dcu
Tested-by: Philippe Cornu <philippe.cornu@st.com > # for stm
Acked-by: Philippe Cornu <philippe.cornu@st.com > # for stm
Acked-by: Vincent Abriou <vincent.abriou@st.com > # for sti
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com > # for vmwgfx
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/20170630093646.7928-2-laurent.pinchart+renesas@ideasonboard.com
2017-06-30 14:53:14 +02:00
Sean Paul
b740e76936
Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next
...
Required for Daniel's drm_vblank_cleanup cleanup
2017-06-27 09:18:17 -04:00
Daniel Vetter
3f5857fc62
drm/rockchip: Drop drm_vblank_cleanup
...
Either not relevant (in the load error paths) or done better already
(in the unload code, by calling drm_atomic_helper_shutdown). Drop it.
Cc: Mark Yao <mark.yao@rock-chips.com >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
Link: http://patchwork.freedesktop.org/patch/msgid/20170621082850.13224-9-daniel.vetter@ffwll.ch
2017-06-26 11:03:50 +02:00
Mark Yao
8814b40bf6
drm/rockchip: dw_hdmi: introduce the pclk for grf
...
For RK3399's GRF module, if we want to operate the graphic related grf
registers, we need to enable the pclk_vio_grf which supply power for VIO
GRF IOs, so it's better to introduce an optional grf clock in driver.
Signed-off-by: Yakir Yang <ykk@rock-chips.com >
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Acked-by: Rob Herring <robh@kernel.org >
2017-06-23 08:52:03 +08:00
Mark Yao
5e3bc6d1ab
drm/rockchip: dw_hdmi: introduce the VPLL clock setting
...
For RK3399 HDMI, there is an external clock need for HDMI PHY,
and it should keep the same clock rate with VOP DCLK.
VPLL have supported the clock for HDMI PHY, but there is no
clock divider bewteen VPLL and HDMI PHY. So we need to set the
VPLL rate manually in HDMI driver.
Signed-off-by: Yakir Yang <ykk@rock-chips.com >
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Acked-by: Rob Herring <robh@kernel.org >
2017-06-23 08:52:03 +08:00
Mark Yao
6445e394c5
drm/rockchip: dw_hdmi: add RK3399 HDMI support
...
RK3399 and RK3288 shared the same HDMI IP controller, only some light
difference with GRF configure.
Signed-off-by: Yakir Yang <ykk@rock-chips.com >
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Acked-by: Rob Herring <robh@kernel.org >
2017-06-23 08:52:03 +08:00
Thierry Reding
5a1535b110
drm/rockchip: Remove unnecessary NULL check
...
The expression &private->fbdev_helper can never be NULL, so the check is
completely unnecessary.
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Thierry Reding <treding@nvidia.com >
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Link: http://patchwork.freedesktop.org/patch/msgid/20170329144401.1804-12-thierry.reding@gmail.com
2017-06-21 15:38:32 +02:00
Sean Paul
b15cdca5b5
Merge remote-tracking branch 'airlied/drm-next' into drm-misc-next-fixes
...
Backmerging airlied/drm-next
2017-06-20 11:50:41 -04:00
Sean Paul
d4e0045c4e
Merge remote-tracking branch 'origin/master' into drm-misc-next-fixes
...
Backmerge 4.12-rc6 into -next-fixes. -next-fixes will contain find patches
for 4.13 merge window
2017-06-19 13:39:28 -04:00
Dave Airlie
925344ccc9
BackMerge tag 'v4.12-rc5' into drm-next
...
Linux 4.12-rc5 for nouveau fixes
2017-06-16 13:58:27 +10:00
Jose Abreu
b0febde779
drm/bridge/synopsys: dw-hdmi: Use bridge->mode_valid() callback
...
Now that we have a callback to check if bridge supports a given mode
we can use it in Synopsys Designware HDMI bridge so that we restrict
the number of probbed modes to the ones we can actually display.
Also, there is no need to use mode_fixup() callback as mode_valid()
will handle the mode validation.
NOTE: I also had to change the pdata declaration of mode_valid
custom callback so that the passed modes are const. I also changed
in the platforms I found. Not even compiled it though.
Signed-off-by: Jose Abreu <joabreu@synopsys.com >
Acked-by: Neil Armstrong <narmstrong@baylibre.com >
Acked-by: Philipp Zabel <p.zabel@pengutronix.de >
Cc: Carlos Palminha <palminha@synopsys.com >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Archit Taneja <architt@codeaurora.org >
Cc: Andrzej Hajda <a.hajda@samsung.com >
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com >
Cc: David Airlie <airlied@linux.ie >
Cc: Philipp Zabel <p.zabel@pengutronix.de >
Cc: Carlo Caione <carlo@caione.org >
Cc: Kevin Hilman <khilman@baylibre.com >
Cc: Mark Yao <mark.yao@rock-chips.com >
Cc: Heiko Stuebner <heiko@sntech.de >
Signed-off-by: Archit Taneja <architt@codeaurora.org >
Link: http://patchwork.freedesktop.org/patch/msgid/3d8d449e4d13d2535fa292c75f5fa931de4a4fa8.1495720737.git.joabreu@synopsys.com
2017-06-05 12:09:50 +05:30
Caesar Wang
2d7b56378d
drm/rockchip: gem: add the lacks lock and trivial changes
...
As the allocation and free buffer that need to add mutex lock for drm mm,
but it lacks the locking on error path in rockchip_gem_iommu_map().
Also, the trivial changes like The comment should be placed in the
kerneldoc and unused blank line.
Signed-off-by: Caesar Wang <wxt@rock-chips.com >
Reviewed-by: Mark Yao <mark.yao@rock-chips.com >
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1496196863-25738-1-git-send-email-wxt@rock-chips.com
2017-06-01 14:48:22 +08:00
Mark yao
efd11cc8fa
drm/rockchip: Correct vop out_mode configure
...
Force vop output mode on encoder driver seem not a good idea,
EDP, HDMI, DisplayPort all have 10bit input on rk3399,
On non-10bit vop, vop 8bit output bit[0-7] connect to the
encoder high 8bit [2-9].
So force RGB10 to RGB888 on vop driver would be better.
And another problem, EDP check crtc id on atomic_check,
but encoder maybe NULL, so out_mode configure would fail,
it cause edp no display.
Signed-off-by: Mark Yao <mark.yao@rock-chips.com >
Reviewed-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Link: http://patchwork.freedesktop.org/patch/msgid/1495885416-22216-1-git-send-email-mark.yao@rock-chips.com
2017-05-31 11:13:34 +08:00
Gustavo Padovan
2cbeb64f6c
drm/rockchip: use drm_for_each_connector_iter()
...
Drop legacy drm_for_each_connector() in favor of the race-free
drm_for_each_connector_iter()
Cc: Mark Yao <mark.yao@rock-chips.com >
Signed-off-by: Gustavo Padovan <gustavo.padovan@collabora.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/20170515134330.3275-1-gustavo@padovan.org
2017-05-26 02:04:54 -03:00
Jeffy Chen
aa5bfa405c
drm/rockchip: analogix_dp: Remove unused check and variables
...
Remove unused check and variables after:
drm/rockchip: Set line flag config register in vop_crtc_enable
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1493469547-2121-1-git-send-email-jeffy.chen@rock-chips.com
2017-05-02 14:44:28 -04:00
Jeffy Chen
459b086d87
drm/rockchip: Set line flag config register in vop_crtc_enable
...
We need to set vop config done after update line flag config, it's a
new requirement for chips newer than rk3368.
Since we would only use line flag irq for vact_end, let's move it to
vop_crtc_enable.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.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/1493276057-4516-1-git-send-email-jeffy.chen@rock-chips.com
2017-04-27 09:07:38 -04:00
Jeffy Chen
c1bb818887
drm/rockchip: Shutdown all crtcs when unbinding drm
...
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-12-git-send-email-jeffy.chen@rock-chips.com
2017-04-07 13:28:32 -04:00
Jeffy Chen
ccea91998c
drm/rockchip: Reorder drm bind/unbind sequence
...
Current drm bind/unbind sequence would cause some memory issues.
For example we should not cleanup iommu before cleanup mode config.
Reorder bind/unbind sequence, follow exynos drm.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
[seanpaul fixed spelling typo in commit subject]
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-11-git-send-email-jeffy.chen@rock-chips.com
2017-04-07 13:28:32 -04:00
Jeffy Chen
b7ac7b5b6b
drm/rockchip: analogix_dp: Disable clock when unbinding
...
The clock is enabled when binding cdn dp.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-10-git-send-email-jeffy.chen@rock-chips.com
2017-04-07 13:28:32 -04:00
Jeffy Chen
ec6e7767c9
drm/rockchip: vop: Unprepare clocks when unbinding
...
The clocks are prepared when binding vop.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-9-git-send-email-jeffy.chen@rock-chips.com
2017-04-07 13:28:32 -04:00
Jeffy Chen
5e570373c0
drm/rockchip: vop: Enable pm domain before vop_initial
...
We're trying to access vop registers here, so need to make sure
the pm domain is on.
Normally it should be enabled by the bootloader, but there's no
guarantee of it. And if we wanna do unbind/bind, it would also
cause the device to hang.
And this patch also does these:
1/ move vop_initial to the end of vop_bind for eaiser error handling.
2/ correct the err_put_pm_runtime of vop_enable.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-8-git-send-email-jeffy.chen@rock-chips.com
2017-04-07 13:28:32 -04:00
Jeffy Chen
88582f5646
drm/rockchip: cdn-dp: Don't unregister audio dev when unbinding
...
After snd_soc_unregister_codec, the dai link would remain bound to
the invalid codec. That would cause crashes after unbind dp driver.
Let's unregister audio codec when removing dp driver to prevent that.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-7-git-send-email-jeffy.chen@rock-chips.com
2017-04-07 13:28:32 -04:00
Jeffy Chen
54bd16780e
drm/rockchip: cdn-dp: Don't try to release firmware when not loaded
...
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1491481885-13775-6-git-send-email-jeffy.chen@rock-chips.com
2017-04-07 13:28:32 -04:00
Rob Herring
ebc9446135
drm: convert drivers to use drm_of_find_panel_or_bridge
...
Similar to the previous commit, convert drivers open coding OF graph
parsing to use drm_of_find_panel_or_bridge instead.
This changes some error messages to debug messages (in the graph core).
Graph connections are often "no connects" depending on the particular
board, so we want to avoid spurious messages. Plus the kernel is not a
DT validator.
Signed-off-by: Rob Herring <robh@kernel.org >
Reviewed-by: Archit Taneja <architt@codeaurora.org >
Tested-by: Philipp Zabel <p.zabel@pengutronix.de >
Acked-by: Maxime Ripard <maxime.ripard@free-electrons.com >
[seanpaul dropped rockchip changes since they're now obsolete]
Signed-off-by: Sean Paul <seanpaul@chromium.org >
2017-04-06 17:00:27 -04:00
Chris Zhong
395eaaae1d
drm/rockchip/dsi: correct the grf_switch_reg name
...
For the RK3399, the grf_switch_reg name should be RK3399_GRF_SOC_CON20,
not RK3399_GRF_SOC_CON19.
Signed-off-by: Chris Zhong <zyw@rock-chips.com >
Reviewed-by: Brian Norris <briannorris@chromium.org >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1490147691-4489-5-git-send-email-zyw@rock-chips.com
2017-03-24 14:48:58 -04:00
Chris Zhong
5bc07b1569
drm/rockchip/dsi: enable the grf clk before writing grf registers
...
For RK3399, the grf clk should be enabled before writing grf registers,
otherwise the register value can not be changed.
Signed-off-by: Chris Zhong <zyw@rock-chips.com >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1490147691-4489-4-git-send-email-zyw@rock-chips.com
2017-03-24 14:48:58 -04:00
Chris Zhong
25f0b12072
drm/rockchip/dsi: check phy_cfg_clk only for RK3399
...
For RK3399, the phy_cfg_clk is a required clock, if phy_cfg_clk is
disabled, MIPI phy can not work. Let's return a error if there is no
phy_cfg_clk in dts property, when the pdata match RK3399.
Signed-off-by: Chris Zhong <zyw@rock-chips.com >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1490147691-4489-2-git-send-email-zyw@rock-chips.com
2017-03-24 14:48:58 -04:00
Jeffy Chen
8820b68bd3
drm/rockchip: Refactor the component match logic.
...
Currently we are adding all components from the dts, if one of their
drivers been disabled, we would not be able to bring up others.
Refactor component match logic, follow exynos drm.
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com >
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com >
Acked-by: Mark Yao <mark.yao@rock-chips.com >
Tested-by: Heiko Stuebner <heiko@sntech.de >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1490152880-21855-1-git-send-email-jeffy.chen@rock-chips.com
2017-03-24 14:48:58 -04:00
Daniel Vetter
b70366e5d3
Merge tag 'doc-4.11-images' of git://git.lwn.net/linux into drm-misc-next
...
Pointer for Markus's image conversion work.
We need this so we can merge all the pretty drm graphs for 4.12.
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com >
2017-03-14 15:07:33 +01:00
Chris Zhong
9346ab7d72
drm/rockchip: cdn-dp: add more log for video config
...
In order to analyze some video config failed, add some useful
printouts.
Signed-off-by: Chris Zhong <zyw@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1488940077-22297-4-git-send-email-zyw@rock-chips.com
2017-03-13 15:59:35 -04:00
Chris Zhong
05c00c2f19
drm/rockchip: cdn-dp: Correct PHY register address
...
Correct some DP register address for PHY Configuration according to
latest datasheet.
Signed-off-by: Chris Zhong <zyw@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1488940077-22297-3-git-send-email-zyw@rock-chips.com
2017-03-13 15:59:26 -04:00
Chris Zhong
a68b5bb670
drm/rockchip: cdn-dp: return error code when clk_get_rate failed
...
The clk_get_rate return 0 if something goes wrong, so it can never be
less then zero, the ret should be set a error code, otherwise the
cdn_dp_clk_enable will return 0 when it failed at clk_get_rate.
In addition, clk_get_rate() returns an "unsigned long", so use
"unsigned long" instead of "u32" is better.
Signed-off-by: Chris Zhong <zyw@rock-chips.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: http://patchwork.freedesktop.org/patch/msgid/1488940077-22297-2-git-send-email-zyw@rock-chips.com
2017-03-13 15:59:10 -04:00
Kieran Bingham
2e6777e8d5
drm: bridge: dw-hdmi: Remove device type from platform data
...
The device type isn't used anymore now that workarounds and PHY-specific
operations are performed based on version information read at runtime.
Remove it.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com >
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com >
Tested-by: Neil Armstrong <narmstrong@baylibre.com >
Reviewed-by: Jose Abreu <joabreu@synopsys.com >
Signed-off-by: Archit Taneja <architt@codeaurora.org >
Link: http://patchwork.freedesktop.org/patch/msgid/20170303172007.26541-9-laurent.pinchart+renesas@ideasonboard.com
2017-03-10 15:36:38 +05:30
Sean Paul
6cca3869c5
drm/rockchip: Fix link error when CONFIG_DRM_ANALOGIX_DP undefined
...
Fixes the following link error when CONFIG_DRM_ANALOGIX_DP is not defined:
ERROR: "analogix_dp_start_crc" [drivers/gpu/drm/rockchip/rockchipdrm.ko] undefined!
ERROR: "analogix_dp_stop_crc" [drivers/gpu/drm/rockchip/rockchipdrm.ko] undefined!
Fixes: 3190e58daf
("drm/rockchip: Implement CRC debugfs API")
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Mark Yao <mark.yao@rock-chips.com >
Cc: Sean Paul <seanpaul@chromium.org >
Cc: Heiko Stuebner <heiko@sntech.de >
Cc: dri-devel@lists.freedesktop.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
2017-03-06 18:18:03 -05:00
Tomeu Vizoso
3190e58daf
drm/rockchip: Implement CRC debugfs API
...
Implement the .set_crc_source() callback and call the DP helpers
accordingly to start and stop CRC capture.
This is only done if this CRTC is currently using the eDP connector.
v3: Remove superfluous check on rockchip_crtc_state->output_type
v6: Remove superfluous variable
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.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/20170303133936.14964-5-tomeu.vizoso@collabora.com
2017-03-06 12:14:27 -05:00
Chris Zhong
80a9a059d4
drm/rockchip/dsi: add dw-mipi power domain support
...
Reference the power domain incase dw-mipi power down when
in use.
Signed-off-by: Chris Zhong <zyw@rock-chips.com >
Reviewed-by: Sean Paul <seanpaul@chromium.org >
Signed-off-by: Sean Paul <seanpaul@chromium.org >
Link: https://patchwork.freedesktop.org/patch/msgid/1487577744-2855-8-git-send-email-zyw@rock-chips.com
2017-03-01 14:49:03 -05:00