Commit Graph

1065293 Commits

Author SHA1 Message Date
Yu Qiaowei
9a9d2d4903 video: rockchip: rga3: update register print
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ic707e77ac4eb3757e7299c9fe27ab2bd4bfef55e
2022-03-12 16:02:31 +08:00
Yu Qiaowei
c7123b7112 video: rockchip: rga3: Fix 1106 RGA2 CSC output exception
Default configuration Y_clip[0,255] UV_clip[0,255].

Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I2134fa5fc179a6e86d73b11a632236b6859cc056
2022-03-12 16:02:31 +08:00
Yu Qiaowei
e3e16782ac video: rockchip: rga3: support early interruption
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I4cbd31d9088b789dffc215ce891cfcaa08a8b0bf
2022-03-12 16:02:31 +08:00
Yu Qiaowei
43375c377b video: rockchip: rga3: RGA2 support OSD
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ib649bbdf4b7b41b9bb93323b9004ca5e17577ec5
2022-03-12 16:02:31 +08:00
Yu Qiaowei
4bb8b324f2 video: rockchip: rga3: RGA2 support YUV HDS/VDS
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I03f909f4d52bb8c5bd6c0607064f9075a4865cd7
2022-03-12 16:02:31 +08:00
Yu Qiaowei
06622a5859 video: rockchip: rga3: support Yin_Yout mode
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ia94e4e58575eabcc122390ad126a1c5d9e6f468e
2022-03-12 16:02:31 +08:00
Yu Qiaowei
943b11ebfa video: rockchip: rga3: RGA2 Support mosaic
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: Ib79b211c76bc0f547e597a9dbeb94726b3766983
2022-03-12 16:02:31 +08:00
Yu Qiaowei
e95866de6e video: rockchip: rga3: Support to judge the hardware information of 1106
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I42f77a95d18e9e16e08194c1011114fe69a2ede4
2022-03-12 16:02:31 +08:00
Chen Shunqing
64faa64356 media: rockchip: hdmirx: set phy to low power mode
Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: I28c90d43029c1c0d71e4c7686a84fc086be8742f
2022-03-12 15:20:49 +08:00
Chen Shunqing
75dd861649 media: rockchip: hdmirx: fix interlaced resolution ficker
Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: I6b0b71fc846d98d02a6c79e88768315f11216418
2022-03-12 15:20:24 +08:00
Chen Shunqing
b3bfa85987 media: rockchip: hdmirx: workaround get error timing
1. Get timing from hdmirx ctrl.
2. If the timing is error, get timing from dma.
3. If get timing error from dma, re-execute hotplug process.

Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: Iae43386a8d45cb0a9338a1c8b32a122b6b377ca2
2022-03-12 15:19:53 +08:00
Jianwei Fan
a056012edf media: i2c: dw9714: sync from kernel-4.19
kernel 4.19 drivers/media/i2c/dw9714.c ends
commit 6e50af3b41 ("media: move rk_vcm_head.h from
drivers/media/i2c/ to include/uapi/linux/")

Signed-off-by: Jianwei Fan <jianwei.fan@rock-chips.com>
Change-Id: If329076cf39aa01d9a7b7ab4326e09ba0578c90f
2022-03-12 15:15:47 +08:00
Zefa Chen
9f87ca55e4 media: rockchip: cif fix errors in rgb24 data format
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
Change-Id: I0766997860f06dc25e604c2ea8425049a987fdc5
2022-03-12 14:39:29 +08:00
Herman Chen
b5267d2417 video: rockchip: mpp: rkvenc2: Fix async msg issue
H.264 encoder will send the task request and wait result in async way.
The task process will be like:
send task 1
send task 2
wait task 1
send task 3
wait task 2
Then the msgs struct will carry the latest task rather than the task in
the pending queue. And free the wrong task structure.

Error log:
[  387.742800][ T1983] list_add corruption. prev->next should be next (ffffff8114ced948), but was ffffff8152228028. (prev=ffffff8152228028).
[  387.742819][ T1983] ------------[ cut here ]------------
[  387.742822][ T1983] kernel BUG at lib/list_debug.c:28!
[  387.742827][ T1983] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
[  387.762394][ T1983] Modules linked in: rk_vcodec
[  387.762403][ T1983] CPU: 5 PID: 1983 Comm: mpp_h264e_1982 Not tainted 5.10.66 #103
[  387.762404][ T1983] Hardware name: Rockchip RK3588 EVB1 LP4 V10 Board (DT)
[  387.762408][ T1983] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--)
[  387.762415][ T1983] pc : __list_add_valid+0x94/0x98
[  387.762417][ T1983] lr : __list_add_valid+0x94/0x98
[  387.762419][ T1983] sp : ffffffc018f2bce0
[  387.762421][ T1983] x29: ffffffc018f2bce0 x28: ffffff8114ced948
[  387.762424][ T1983] x27: ffffff8152228028 x26: ffffff8152228028
[  387.762427][ T1983] x25: ffffff8114ced880 x24: ffffff817888a080
[  387.762429][ T1983] x23: ffffff8152228000 x22: ffffff817888a080
[  387.762432][ T1983] x21: ffffffc018f2bd58 x20: ffffff8114ced880
[  387.762435][ T1983] x19: ffffffc018f2bd58 x18: ffffffc018ecd040
[  387.762437][ T1983] x17: 0000000000000000 x16: 00000000000000d8
[  387.762440][ T1983] x15: 0000000000000004 x14: 0000000000003fff
[  387.762443][ T1983] x13: ffffffc011f0cf78 x12: 0000000000000003
[  387.762445][ T1983] x11: 00000000ffffbfff x10: 00000000ffffffff
[  387.762448][ T1983] x9 : 07e69d051dac6800 x8 : 07e69d051dac6800
[  387.762451][ T1983] x7 : 727028202e383230 x6 : ffffffc0120ee318
[  387.762454][ T1983] x5 : ffffffffffffffff x4 : 0000000000000000
[  387.762457][ T1983] x3 : ffffffc011bc4854 x2 : 0000000000000000
[  387.762459][ T1983] x1 : 0000000000000001 x0 : 0000000000000075
[  387.762462][ T1983] Call trace:
[  387.762465][ T1983]  __list_add_valid+0x94/0x98
[  387.762507][ T1983]  mpp_msgs_trigger+0x15c/0x1f0 [rk_vcodec]
[  387.762542][ T1983]  mpp_dev_ioctl+0x4b8/0x5d8 [rk_vcodec]
[  387.762563][ T1983]  __arm64_sys_ioctl+0x94/0xd0
[  387.764333][ T1983]  el0_svc_common+0xc0/0x23c
[  387.764335][ T1983]  do_el0_svc+0x28/0x88
[  387.764339][ T1983]  el0_svc+0x14/0x24
[  387.764342][ T1983]  el0_sync_handler+0x88/0xec
[  387.764344][ T1983]  el0_sync+0x1a8/0x1c0
[  387.764349][ T1983]
[  387.764349][ T1983] PC: 0xffffffc01059b608:

Signed-off-by: Herman Chen <herman.chen@rock-chips.com>
Change-Id: Id55b3b66726a526bca68594ab9a86cc58c265945
2022-03-12 14:38:30 +08:00
Addy Ke
2094d714b6 arm64: dts: rockchip: rk3588-toybrick-x0: enable can2
Signed-off-by: Addy Ke <addy.ke@rock-chips.com>
Change-Id: Ie5cedd3055d7c64cf5b3a6f50684fe38a25f5ff5
2022-03-11 16:08:36 +08:00
Tao Huang
37d4a8872f soc: rockchip: ramdisk: Add Rockchip RAM disk support
Support use reserved RAM memory as a block device.

Change-Id: I64367a2cb67467425a0e4c6753fa5af0a245405d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
2022-03-11 16:03:08 +08:00
Wang Jie
0b9a0e19a7 dt-bindings: usb: add et7303 document
Change-Id: I3001058b835e367595924cd8b00b415bcaeee670
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2022-03-11 15:09:21 +08:00
Wang Jie
fb2fd67ed8 usb: typec: tcpm: add et7303 driver
Change-Id: I2339e9ece6c00d5a18eac01224cb623468d1771c
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2022-03-11 15:09:10 +08:00
Andy Yan
6a13a81062 drm/rockchip: vop2: Support skip reference fb
It support skip reference fb at vop driver by
adding add skip-ref-fb at vop dt node.

Change-Id: I7a0a91d905ba4907f8f0720e1997e9ee9c5c65c7
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2022-03-11 14:28:38 +08:00
Cai YiWei
f6cafa7cbd media: rockchip: isp: isp32 add vsm
Change-Id: I456f06ef23c54196ddb4904675696a82dc74864c
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-11 14:18:01 +08:00
Cai YiWei
2fa9233522 media: rockchip: isp: scale up and down for some stream
Change-Id: Ie6f48cf197e5be0c4fbb63e641dde4299920d97a
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-11 14:17:38 +08:00
Cai YiWei
8b0728ec75 media: rockchip: isp: add luma stream for isp32
Change-Id: If20dfa24389b3df7f2ef0ad918cc649d9c560807
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-11 14:17:17 +08:00
Cai YiWei
8dd3e56958 media: rockchip: isp: isp32 mi switch according to output buf
Change-Id: I2d4ce521e00dc9907c60472538d2b9b7300e4539
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-11 14:16:48 +08:00
William Wu
3e84aecb52 usb: host: xhci-plat: build depends on ARCH_ROCKCHIP
When build with rv1106_defconfig, and enable at least the
following configs manually:

CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PLATFORM=y

size drivers/usb/host/xhci-plat.o

before:
   text    data     bss     dec     hex filename
   5570     376       4    5950    173e drivers/usb/host/xhci-plat.o

after:
   text    data     bss     dec     hex filename
   2898     376       4    3278     cce drivers/usb/host/xhci-plat.o

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ica505b973d1f4ebdc18d814a3992ab51999be980
2022-03-11 11:45:36 +08:00
Zhang Yubing
f283539a10 drm/rockchip: vop2: support use video port default parent
When video port output image under 4K@60Hz(dclk less than 600MHz),
The dclk parent use hdmi0 phy pll or hdmi1 phy pll. In some cases
the hdmi0 phy pll or hdmi1 phy pll is not enough for all output
interface. For example, hdmi0 and hdmi0 connect to video port0 and
dp connect to video port1. In this case, It need the video port1
need use default dclk parent.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Icdf050bb1e7a9f36022f5dd196358136c1d9242c
2022-03-11 11:34:59 +08:00
Algea Cao
817db0024a drm/rockchip: dw_hdmi: Enable split mode only when two HDMI are enabled
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Ib62c7f3b9ccfb03f61311fb704d9d897afaa50f2
2022-03-11 11:34:12 +08:00
Cai YiWei
40e63cc682 media: rockchip: isp: build depends on CPU config
Change-Id: I20ed687a3b52b04bb826ef8c8405217c3f1f19d0
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-11 11:18:47 +08:00
Finley Xiao
0f3739e0b7 MALI: bifrost: Kconfig: Don't select PM_DEVFREQ and DEVFREQ_THERMAL
If use savedefconfig to update defconfig, PM_DEVFREQ and DEVFREQ_THERMAL
will be removed, and dmc and opp_select also depend on PM_DEVFREQ,
enable them default.

Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: Ied5ac8e70fe195294df2752160ce6e56360f2db8
2022-03-11 11:00:00 +08:00
Finley Xiao
115afc3bb5 arm64: configs: rockchip_linux_defconfig: enable PM_DEVFREQ and DEVFREQ_THERMAL
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I62a248c07662339676c43c30535b745ee846a332
2022-03-11 11:00:00 +08:00
Finley Xiao
9303bebb7e arm64: configs: rockchip_defconfig: enable PM_DEVFREQ and DEVFREQ_THERMAL
Signed-off-by: Finley Xiao <finley.xiao@rock-chips.com>
Change-Id: I44fb16f6f0053249e497406c46cd9e89fc5c1315
2022-03-11 11:00:00 +08:00
William Wu
1e5e39bebf phy: rockchip: inno-usb2: build depends on CPU config
When build with rv1106_defconfig, and enable the following
configs manually:

CONFIG_EXTCON=y
CONFIG_USB_SUPPORT=y
CONFIG_PHY_ROCKCHIP_INNO_USB2=y

size drivers/phy/rockchip/phy-rockchip-inno-usb2.o

before:
   text    data     bss     dec     hex filename
   65118     204       4   65326    ff2e drivers/phy/rockchip/phy-rockchip-inno-usb2.o

after:
   text    data     bss     dec     hex filename
   13780     204       4   13988    36a4 drivers/phy/rockchip/phy-rockchip-inno-usb2.o

Signed-off-by: William Wu <william.wu@rock-chips.com>
Change-Id: Ia8900c17800a4ae9ae04e91f46d71986eda242c0
2022-03-11 10:57:05 +08:00
Cai YiWei
ead9f87f94 ARM: dts: rockchip: add isp nodes for rv1106
Change-Id: I93e20fccdd7269efac7e22eb7a83bbfea3ea22c3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-11 10:32:47 +08:00
Sugar Zhang
4cfa4a1773 ARM: dts: rockchip: Add basic support rv1106/3 evb board
Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: I3f53c934dcd0cfb814bcd217c788a0c60319faaf
2022-03-11 10:16:37 +08:00
Yu Qiaowei
549c087dbd video: rockchip: rga3: Update RGA2 register
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I587db82cbf8148c274024a203f7646f7f218111c
2022-03-11 10:08:18 +08:00
Yu Qiaowei
afbf0cd0e4 video: rockchip: rga3: Code style of rga2_reg_info.c
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I17819439fe0d65c475b56b063be300e86e5ae048
2022-03-11 10:08:18 +08:00
Wang Jie
b1302e6a83 usb: typec: tcpm: add pd handler lock
Quickly plug and unplug the Type-C device with DP function test, there
is a low probability of unplugging the Type-C dongle, DP work cannot
acquire the mutex(port->lock), and it will always be stuck in the
tcpm_unregister_altmodes() function during the rest port process, causing
the Type-C device to be inserted again to fail to be detected or the reboot
system to be stuck. The exception process is as follows:
(1) Thread#1: unplug the Type-C device to trigger cc status changes interrupt, in the
    tcpm_pd_event_handler() function, first acquire the mutex(port->lock),
    then start state_machine work, and finally release the mutex(port->lock);
tcpm_cc_change()
  -->tcpm_pd_event_handler()
    -->mutex_lock(&port->lock)  /* step 1 */
    -->_tcpm_cc_change(port, cc1, cc2) /* step 2 */
      -->tcpm_set_state(port, SRC_UNATTACHED, 0)
        -->kthread_queue_work(port->wq, &port->state_machine) /* step 3 */
    --> mutex_unlock(&port->lock)  /* step 4 */

(2) Thread#2: before the execution of "step 2" is completed, DP work calls
    the callback function registered by the tcpm framework to initiate a VDM
    Message, such as Enter Mode Message, in the tcpm_queue_vdm_unlocked()
    acquires the mutex(port->lock) fails and goes to sleep;
dp_altmode_work()
  --> typec_altmode_enter(dp->alt)
    --> tcpm_altmode_enter()
      --> tcpm_queue_vdm_unlocked()
        --> mutex_lock(&port->lock) /* dp work enter sleep */

(3) After step 4, tcpm_queue_vdm_unlocked() did not acquire for the mutex
    (port->lock), but was preempted by the state_machine work to enter the reset
    port process. In the reset port process, call the tcpm_unregister_altmodes()
    function to release altmode and cancel dp work. Because tcpm_queue_vdm_unlocked()
    did not acquire the mutex(port->lock), causing it to be stuck in cancel dp work.
tcpm_state_machine_work()
  -->mutex_lock(&port->lock)
  -->tcpm_reset_port(port)
    -->tcpm_unregister_altmodes(port)
      ......
      --> dp_altmode_remove()
        --> cancel_work_sync(&dp->work) /* always stuck in cancel dp work */
  ......

Therefore, after adding a new mutex to wait for the tcpm_pd_event_handler() function
to complete the processing, if the port is in the disconnect state, there is no need
to acquire the mutex(port->lock) in the tcpm_queue_vdm_unlocked() function.

Change-Id: I364a035568ddc35ef7242b42f6d6d0ee3f5586fd
Signed-off-by: Wang Jie <dave.wang@rock-chips.com>
2022-03-10 20:55:51 +08:00
Andy Yan
aacefe9c74 drm/rockchip: vop2: A workaround for PD_CLUSTER0 off
The internal PD of VOP2 on rk3588 take effect immediately
for power up and take effect by vsync for power down.

And the PD_CLUSTER0 is a parent PD of PD_CLUSTER1/2/3,
we may have this use case:
Cluster0 is attached to VP0 for HDMI output,
Cluster1 is attached to VP1 for MIPI DSI,

When we enable Cluster1 on VP1, we should enable PD_CLUSTER0 as
it is the parent PD, event though HDMI is plugout, VP1 is disabled,
the PD of Cluster0 should keep power on.

When system go to suspend:
(1) Power down PD of Cluster1 before VP1 standby(the power down is take
    effect by vsync)
(2) Power down PD of Cluster0

But we have problem at step (2), Cluster0 is attached to VP0. bus VP0
is in standby mode, as it is never used or hdmi plugout. So there is
no vsync, the power down will never take effect.

According to IC designer: We must power down all internal PD of VOP
before we power down the global PD_VOP.

So we get this workaround:
We we found a VP is in standby mode when we want power down a PD is
attached to it, we release the VP from standby mode, than it will
run a default timing and generate vsync. Than we can power down the
PD by this vsync. After all this is done, we standby the VP at last.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Ib9be8628f07d783c6bc3b7678c5eebfc63aabe1c
2022-03-10 20:20:16 +08:00
Andy Yan
c9c9555075 drm/rockchip: vop2: Fix PD_ESMART usage on rk3588
PD_ESMART is shared between Esmart1/2/3, Esmart0 has
no PD

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: I5d11ec065f6226e130c93469b1757e4c4fe82067
2022-03-10 20:17:11 +08:00
Andy Yan
e5cb1f01cd drm/rockchip: vop2: Disable aclk of video port when it unused
To reduce some power consumption.

Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Iebe8d071380ed998579942aeab7662a6ffda3cb0
2022-03-10 20:04:48 +08:00
Guochun Huang
073fa994fa drm/rockchip: dsi2: add user-split-mode property
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: I507034edb7a91b776cb66aa7e3aedcc22521467c
2022-03-10 20:00:48 +08:00
Cai YiWei
3549b11f93 media: rockchip: isp: add get isp information api
Change-Id: I774cc2d215e1b57a427fbf9f3f7bdcf0ea7a0391
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Cai YiWei
6b70848540 media: rockchip: isp: add cgc config
Change-Id: I235207147a7c4bd14c195d5bb53dec5992a1c3c3
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Cai YiWei
8a1aeac9b2 media: rockchip: isp: isp32 support raw data compression
Change-Id: I62b7a39982ba661034856cce79fb873104f2c4ba
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Cai YiWei
c76be98cdc media: rockchip: isp: isp32 support mirror and flip
Change-Id: I8e067cddee9bb314d97e2fd09b62886e8f9b222d
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Cai YiWei
5409c91052 media: rockchip: isp: isp32 bls2 remove to awb
Change-Id: Ieea6a4fd4ee796c5a02a46dbf9e7650d2a345170
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Cai YiWei
8bffb2d344 media: rockchip: isp: add isp32 for rv1106
Change-Id: I3f02927df17cb04868d868f8c3a72079a99fea77
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Cai YiWei
68dc2bca0c media: rockchip: isp: fix mp uyvy format error for isp30
mainpath is bytes per line for Y_LLENGTH but
selfpath is pixels per line.

Change-Id: I3321f01ee3466bae99e65a6ac10ffbe0acdeed71
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Cai YiWei
0dc12b0118 media: rockchip: isp: add version to querycap
Change-Id: Idb3fc5e57d5ecf0ea8dfe82bc7072998f2472940
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
2022-03-10 19:54:46 +08:00
Wang Panzhenzhuan
02275b5be1 arm64: dts: rockchip: rk3566-evb2: enable csi2_dphy0 for gc8034
For ov5695 has been stop production, so replace
 ov5695 module config with gc8034

Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I06aa7d18a82f11a98e6c8bee40a1dd9d5ae60e66
2022-03-10 19:41:16 +08:00
Sugar Zhang
d49247b9e3 ARM: configs: rv1106: Disable NET_VENDOR
- CONFIG_NET_VENDOR_GOOGLE
- CONFIG_NET_VENDOR_PENSANDO
- CONFIG_NET_VENDOR_XILINX

Signed-off-by: Sugar Zhang <sugar.zhang@rock-chips.com>
Change-Id: Ia6c75f1759ba6507049d14f78cd72ab9238dc4fb
2022-03-10 18:21:12 +08:00