Commit Graph

74520 Commits

Author SHA1 Message Date
Sandy Huang
a3d4f6e0df drm/rockchip: vop: add calculate current frame data size
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ie9c92c651b8c379c77aac941d03bf3f772ed7eea
2021-10-29 19:00:34 +08:00
Zhen Chen
a42b57181b MALI: rockchip: upgrade bifrost DDK to g7p1-01bet0, from g6p0-01eac0
Including modifications under drivers/base/ from the new DDK.

Resolve lots of conflicts.

Fix compilation errors when CONFIG_DEBUG_FS is disabled.

Change-Id: I69f9ac87d927441d0b92b8dac8b704922aeb6a0a
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-29 18:44:22 +08:00
Zhen Chen
8e59d03969 MALI: bifrost: fix a bug that makes vdd_gpu abnormally low
Change-Id: Ic0b785ead0da551e9e640c45b73f6686a1ec5cca
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-29 18:44:22 +08:00
Zhen Chen
404110b7de MALI: rockchip: upgrade bifrost DDK to g6p0-01eac0, from g2p0-01eac0
Include a new directory include/uapi/gpu/arm/bifrost/,
which includes some header files of bifrost device driver.
In the original part of g6, the path is include/uapi/gpu/arm/midgard/.
I changed the "midgard" to "bifrost", and modified the paths of the header files in .c files.

I resolved some conflicts between modifications form ARM and RK, manually.

In addition, introduce source files of protected_memory_allocator
that might be needed by bifrost_device_driver into build system.

Further more, to avoid errors when building in GKI mode,
add "WITH Linux-syscall-note" to SPDX tag of uapi headers.

Change-Id: I09d500a0fdbc5da352c81dc4fcfbffb5b7f907f5
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
2021-10-29 18:44:22 +08:00
Sandy Huang
cd2119c1ce drm/rockchip: vop2: add support rk3588 DSC
RK3588 can support DSC (Display Stream Compression) with the following
feature:

1. DSC 8K encoder for HDMI TX0/MIPI DSI2 Host0 interface
2. DSC 4K encoder for HDMI TX1/MIPI DSI2 Host1 interface
3. Conformance Standard: VESA DSC v1.1 and v1.2a
4. Data path: VOP VP -> DSC encoder -> DSI/HDMI controller -> phy -> panel

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ia395374102be0e1710bb2049d7407a6cc0d5f873
2021-10-29 17:12:50 +08:00
Andy Yan
aa3aee14d0 drm/rockchip: vop2: Add vop2 internal pd support for rk3588
There are 7 internal power domains on rk3588 vop:

Cluster0/1/2/3 each have one, and Cluster0 power domain act
as parent pd of Cluster1/2/3.

Esmart0/1/2/3 share on pd.

DSC_8K/DSC_4K each have one.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: If2c3c79980d2690761d12e64a486aca9be992e4b
2021-10-29 17:01:03 +08:00
Guochun Huang
cfd737a904 drm/rockchip: rk628: fix lvds default data format
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: Ib99e6e3d285b3693428523fdd11027d8862ee734
2021-10-29 16:00:57 +08:00
Sandy Huang
dd32d33d69 drm/rocckhip: vop: rename to NEXT_HDR feature
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I148ecf0f400c98e8c5e79716a6c69add3b21b6e5
2021-10-29 15:29:05 +08:00
Andy Yan
c4b5e35d90 drm/rockchip: vop2: Add splice mode for alpha
Used for 8K output on rk3588

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Ic5a5443f85c063fcf45a2c91a676766a773a0317
2021-10-27 16:11:32 +08:00
Andy Yan
b5502e21e2 drm/rockchip: vop2: Add splice support for HDR10
We need two HDR10 controllers in splice mode.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Ie4f98f64b3afa1a4bbf561d4dc061031febd22e5
2021-10-27 16:10:55 +08:00
Andy Yan
f001cec92f drm/rockchip: vop: Use __drm_atomic_helper_plane_reset instead of copying the logic
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I3219f6ee0eef49c59277c84ea6efc72ae4a90ef9
2021-10-27 15:49:52 +08:00
Andy Yan
339b80072b drm/rockchip: vop2: Use __drm_atomic_helper_plane_reset instead of copying the logic
A new helper function(__drm_atomic_helper_plane_reset) has been added
for linking a plane with its state and resetting the core
properties(alpha, rotation, etc.) to their default values.
Use that instead of duplicating the logic.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Ic9db9e9d6eee32796899fceba4df7cbf1eaaf5f6
2021-10-27 15:49:52 +08:00
Algea Cao
a7c8450f79 drm/rockchip: dw_hdmi: Call get yuv422 format interface in dw_hdmi-rockchip.c
To be compatible with GKI, dw-hdmi driver can't call interfaces in
rockchip-drm directly. In order for dp to be usable, get yuv422
format interface should define in rockchip-drm. So hdmi call
get yuv422 format interface in dw_hdmi-rockchip.c.

Fixes: dbd228a254 ("drm/bridge: synopsys: dw-hdmi: Get edid yuv422 info independently")
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Icc879ff4420357a6becba84371b9e3317583960b
2021-10-26 10:50:21 +08:00
Simon Xue
b3ed01278c drm/rockchip: assign drm device dma_mask to mask(64) from mask(32)
dma framework use dma_mask to check device if dma_capable, so set
dma_mask to mask(64) to compatible with platform that ddr capacity
larger than 4GB or physical address space beyond 32 bit.

Change-Id: I04cbe038402db6b48ef2b36a9494fc8eb8c98d6c
Signed-off-by: Simon Xue <xxm@rock-chips.com>
2021-10-22 17:51:31 +08:00
Algea Cao
fddab04238 drm/bridge: synopsys: dw-hdmi: Delete i2c adapter when hdmi bind failed
If hdmi i2c adapter is not deleted when hdmi bind failed, there
may be a crash when other device added. Because hdmi i2c memory
was freed but hdmi i2c still in the kobj list, its address may
be accessed when other device was added to the kobj list.

BUG: KASAN: use-after-free in __list_add_valid+0x3c/0xc8
Read of size 8 at addr ffffff80065930f8 by task swapper/0/1

CPU: 4 PID: 1 Comm: swapper/0 Not tainted 5.10.43 #294
Hardware name: Rockchip RK3399 EVB IND LPDDR4 Board edp (Android) (DT)
Call trace:
 dump_backtrace+0x0/0x2d0
 show_stack+0x18/0x28
 dump_stack_lvl+0xfc/0x138
 print_address_description.constprop.13+0x7c/0x31c
 kasan_report+0x1e8/0x250
 __asan_load8+0x9c/0xd8
 __list_add_valid+0x3c/0xc8
 kobject_add_internal+0xbc/0x400
 kobject_add+0x108/0x1a8
 device_add+0x1b8/0xc10
 device_link_add+0x63c/0x8c8
 _regulator_get+0x148/0x3a8
 _devm_regulator_get+0x50/0xc8
 devm_regulator_get+0x14/0x20
 panel_simple_probe+0x120/0x538
 panel_simple_platform_probe+0x60/0xf8
 platform_drv_probe+0x70/0xd0
 really_probe+0x148/0x558
 driver_probe_device+0x78/0xe8
 device_driver_attach+0x9c/0xa8
 __driver_attach+0x74/0x118
 bus_for_each_dev+0xec/0x160
 driver_attach+0x34/0x48
 bus_add_driver+0x244/0x2a0
 driver_register+0xc0/0x1e0
 __platform_driver_register+0x80/0x90
 panel_simple_init+0x24/0x4c
 do_one_initcall+0xa0/0x420
 kernel_init_freeable+0x2f0/0x374
 kernel_init+0x14/0x120

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ifc38263ce52f951f6dd0fb83ac1a76facd98445e
2021-10-22 16:51:50 +08:00
Algea Cao
7b772c40d3 drm/bridge: synopsys: dw-hdmi: Support dw-hdmi does not serve as a connector
If dw-hdmi is not used as the final output port, it is
only used as a bridge but not a connector.

Change-Id: Ie730f47d6075db74c0c54374849fd938c13f5ba8
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2021-10-21 19:00:09 +08:00
Algea Cao
dbd228a254 drm/bridge: synopsys: dw-hdmi: Get edid yuv422 info independently
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ibd340a273a16a5faa7ac1b548c81cc89914f442f
2021-10-20 10:40:27 +08:00
Algea Cao
1bd6270500 drm/rockchip: drv: Parse edid yuv422 info in rockchip driver
In drm_edid.c, yuv422 supported flag will be clean although EDID
indicates support for it. To be compatible with GKI, we can not
modify drm_edid.c. So we parse the information about yuv422 in EDID
in rockchip driver.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Iecae74173f6b1d87e0c1381e96b71365ea4a1fac
2021-10-20 10:40:20 +08:00
Shunqing Chen
466b01a904 drm/bridge: synopsys: dw-hdmi: fix the issue that can not display after force off
1. echo off > sys/class/drm/card0-HDMI-A-1/status
2. echo detect > sys/class/drm/card0-HDMI-A-1/status
HDMI is not displayed after executing the above commands.

Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: I46fc984b278f5186a22c279def82570603af5494
2021-10-19 14:12:52 +08:00
Zhang Yubing
e291ddfbcb drm/rockchip: cdn-dp: use delay work replace work
In tcpm displayport driver, drm_connector_oob_hotplug_event()
execute before dp_altmode_notify().

The dp_altmode_notify() call the mux set function, which
transfer phy info(lane count, pin assignments) to typec
phy.

The drm_connector_oob_hotplug_event() call oob_hotplug_event
function, which notify the cdn-dp driver hotplug event, and
the cdn-dp will start work to deal with the hotpug event,
which will user the phy info.

if here no delay time, The phy info use may be early than phy
info update, whick may cause the phy info mismatch.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Ic3394769f66bd3b7a621095e09978e4b15393b7e
2021-10-19 11:31:52 +08:00
Zhang Yubing
3a38a93376 drm/rockchip: cdn-dp: register dp sub_dev to support hotplug event
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Ia2c6eb883b8b6e5500d2eb7ef7439ac42ebc6e52
2021-10-19 11:31:28 +08:00
Zhang Yubing
43a103fe8b drm/rockchip: cdn-dp: remove the extcon function
We will use tcpm framework to detect dp hotplug event,
no longer extcon, so remove it.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: If51f1f44f38ec0ae135735ac1ec1632132271a56
2021-10-19 11:31:14 +08:00
Zhang Yubing
82a87fa40a drm/rockchip: Add support for out-of-band hotplug notification
Add a new drm_connector_oob_hotplug_event() function and
oob_hotplug_event drm_connector_funcs member.

On some hardware a hotplug event notification may come from outside the
display driver / device. An example of this is some USB Type-C setups
where the hardware muxes the DisplayPort data and aux-lines but does
not pass the altmode HPD status bit to the GPU's DP HPD pin.

In cases like this the new drm_connector_oob_hotplug_event() function can
be used to report these out-of-band events.

Avoid the conflict of GKI, the drm_connector_oob_hotplug_event() is be
completed in rockchip drm driver, not the drm framework.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I5b1428daa83b0fdb7cf88e95d0b8fde2548d43d8
2021-10-19 11:31:00 +08:00
Guochun Huang
5aa16e093b drm/rockchip/rk628: combtxphy: reducing DUAL LVDS power consumption
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I831dc7879f8f4656e9db63c629c37cc5709d3e35
2021-10-19 10:49:59 +08:00
Sandy Huang
e261251240 drm/rockchip/rk628: max input resolution is 4k yuv420
Change-Id: I154b72b9ce3e975e62e9f107346eb57451dbb76d
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-10-19 10:49:52 +08:00
Dingxian Wen
050ba7e86a drm: rockchip: rk628: the combrxphy cable mode wait for clk to stabilize
Signed-off-by: Dingxian Wen <shawn.wen@rock-chips.com>
Change-Id: I7502b8f71f4fcc376a925045adbe6148ebdc2d3f
2021-10-19 10:49:46 +08:00
Shunqing Chen
8ba551e60d drm: rockchip: rk628: post_process: recalculate dst clock
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Change-Id: I93388ba499f0d74c5f5c549decc83f3225ae1b82
2021-10-19 10:49:38 +08:00
Wyon Bi
358218bef5 drm/rockchip: Add rk628 display driver
Change-Id: I7be65c5ed58df2be2cf2cfe819feacf8a610e880
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
2021-10-19 10:36:14 +08:00
Tao Huang
270d97f40e drm/rockchip: vop2: make vop2_clk_init() static
Fix the following gcc warning:

drivers/gpu/drm/rockchip/rockchip_vop2_clk.c:304:5: warning:
no previous prototype for 'vop2_clk_init' [-Wmissing-prototypes]

Fixes: 95b6a39dab ("drm/rockchip: vop2: Add support for rk3588")
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ifc892f473a50a9e408e09648c7a6539ffda24039
2021-10-18 14:13:22 +08:00
Wyon Bi
6d06306c63 drm/rockchip: analogix_dp: Add of-alias id support
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: If7f2a6672c5450e0f2cfdd7c387f7fa045d54ba2
2021-10-18 11:20:58 +08:00
Wyon Bi
7e6860ead0 drm/rockchip: analogix_dp: Use formalized struct definition for grf field
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Iddfa5af6e8bfabb58b312661e3fb267008f27045
2021-10-18 11:20:58 +08:00
Sandy Huang
4281b208cb drm/rockchip: vop: add BCSH support function
Change-Id: I17bcd5a07b93b3c68aa892606f886bcd3a7673a0
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-10-15 16:45:51 +08:00
Andy Yan
95b6a39dab drm/rockchip: vop2: Add support for rk3588
RK3588 VOP:
4 Video Ports.
4 Cluster Windows.
4 Esmart Windows.

Can drive HDMI/eDP/DP/MIPI/BT1120/BT656 interface.

Support drive HDMI/DP 8k output in splice mode.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I37df329fcab729cd7fa1de47c4d5faf232bb265f
2021-10-15 16:39:03 +08:00
Algea Cao
7fbb80db46 drm/rockchip: dw_hdmi: Allow rk3399 hdmi output yuv420
Fixes: 4035588f0f ("drm/rockchip: dw-hdmi: Add ycbcr_420_allowed to hdmi plat data")
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: If88f499ff15ba599e6749eb94d86ba9b2c234b48
2021-10-14 18:48:43 +08:00
Guochun Huang
b4a8234b53 drm/bridge: dw-mipi-dsi: make video and cmd mode option
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I6be01c00ddfd10d49aef3f44cb07406f679007ad
2021-10-14 15:40:39 +08:00
Sandy Huang
bd3ab87c3e drm/rockchip: vop: add CRTC feature interaction with userspace
move alpha scale to crtc feature and add hdr10/dolby hdr info to
feature to interaction with userspace, and remove alpha_scale_prop from
rockchip_drm_drv.c

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ic56c7a53c890702ce4a70167ea9926aa32b29fa7
2021-09-30 10:11:49 +08:00
Sandy Huang
2bc4f70d30 drm/rockchip: vop2: add CRTC feature interaction with userspace
move alpha scale to crtc feature and add hdr10/dolby hdr info to feature
to interaction with userspace.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I492647a22b41bf43c3127bd56b2ed0b3b95284a2
2021-09-30 10:11:49 +08:00
Sandy Huang
a14c198318 drm/bridge: sii902x: add YUV422 input support
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I0b6cc2a12206eb1cdc9f6c292856196c94b85d90
2021-09-30 10:11:49 +08:00
Sandy Huang
a52fb7412a drm/rockchip: drv: add register rockchip rgb driver
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I6dd9d78f6c3899917650a04fc21a10e4a31d9193
2021-09-30 10:11:49 +08:00
Sandy Huang
fb49e5eef8 drm/rockchip: rgb: sync with develop-4.19
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ic6945e12dd65e52cd631117721724e4a466f4dd4
2021-09-30 10:11:49 +08:00
Andy Yan
1a24bcdd02 drm/rockchip: vop2: Reset used_layers to 0
used_layers should reset to 0 before count
port_mux.

And also fix the follow warning:
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:2538:26: warning: Value
stored to 'vp' during its initialization is never read
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c:2537:21: warning: Value
stored to 'layer' during its initialization is never read

Fixes: e013d2544c ("drm/rockchip: vop2: Assign plane for vp by
plane_mask")

Change-Id: I56b1576070392b7b262ef65b19cf14d1bfde0586
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-29 17:59:49 +08:00
Sandy Huang
da9fc4361f drm/rockchip: lvds: add loader protect
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I3fbbad4dfc5be934acf997d26e7c83e168b6af67
2021-09-29 15:19:13 +08:00
Wyon Bi
2ab2d84fc0 drm/panel: simple: Add 'panel-timing' support
Fixes: dd03e97b25 ("drm/panel: simple: Get panel-desc data from DT")
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: If018e3dc650def01708bcc0e2672af9506c858c5
2021-09-28 09:13:32 +08:00
Sandy Huang
b41d964692 drm/rockchip: vop2: externd rockchip_drm_crtc from drm_crtc
externd rockchip_drm_crtc from drm_crtc, so we can add more private
parameter for dump buffer function.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I9e0450cafe9d184ac4d9daad03749ade1302f249
2021-09-27 18:35:37 +08:00
Sandy Huang
681930bf2d drm/rockchip: vop: externd rockchip_drm_crtc from drm_crtc
externd rockchip_drm_crtc from drm_crtc, so we can add more private
parameter for dump buffer function.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I56ca9c08d7d2bb19de544d56c9bc883d5b880da1
2021-09-27 18:12:42 +08:00
Sandy Huang
c7098c10c2 drm/rockchip: add a debug node to dump buf from userspace
dump path: /data/
debug node: /d/dri/0/ff900000.vop/vop_dump/dump
dump cmd:
    echo dump    > dump to dump one frame
    echo dumpon  > dump to start vop keep dumping
    echo dumpoff > dump to stop keep dumping
    echo dumpn   > dump n is the number of dump times

Change-Id: Id5fefa428db1b5669ceae418cd8bddfa52e52f61
Signed-off-by: Shixiang Zheng <shixiang.zheng@rock-chips.com>
Signed-off-by: Sandy Huang <hjc@rock-chips.com>
2021-09-27 18:11:38 +08:00
Andy Yan
e013d2544c drm/rockchip: vop2: Assign plane for vp by plane_mask
Change-Id: I6cbd87a5c4ecab7a54f30f0a6bfdd8721f86cce9
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2021-09-27 18:09:28 +08:00
Algea Cao
054249037d drm/bridge: synopsys: dw-hdmi: Fix display err when system boot set hdmi properties
Linux system will set hdmi properties when system boot
When some properties such as quant_range was set, dw_hdmi_setup()
will be called. HDMI status may not be config correctly. So if HDMI
is not properly initialized, don't call dw_hdmi_setup() when
these properties was set.

Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: I6956e50161a4a5bd579f7174c73977d2e33da0c5
2021-09-27 17:29:24 +08:00
Andy Yan
585789020e drm/rockchip: vop2: configure half_block_en bit in all mode
First we thought the half_block_en bit in AFBCD_CTRL register
only work in afbc mode. But the fact is it control the line buffer
in all mode(afbc/tile/line), so we need configure it in the
all case.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Ib8cd5fbfd0a898eea738423685fbcdc0ab6d00ad
2021-09-24 17:27:27 +08:00
Andy Yan
240d8a3bd7 drm/rockchip: set output_if for rgb connector
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I6c832a1e7fd8cca69da5f6cfdd9681d72696d67a
2021-09-24 17:27:27 +08:00