When ddc-i2c-bus property is used, a NULL pointer dereference is reported:
[ 31.041669] Unable to handle kernel NULL pointer dereference at virtual address 00000008
[ 31.041671] pgd = 4d3c16f6
[ 31.041673] [00000008] *pgd=00000000
[ 31.041678] Internal error: Oops: 5 [#1] SMP ARM
[ 31.041711] Hardware name: Rockchip (Device Tree)
[ 31.041718] PC is at i2c_transfer+0x8/0xe4
[ 31.041721] LR is at drm_scdc_read+0x54/0x84
[ 31.041723] pc : [<c073273c>] lr : [<c05926c4>] psr: 280f0013
[ 31.041725] sp : edffdad0 ip : 5ccb5511 fp : 00000058
[ 31.041727] r10: 00000780 r9 : edf91608 r8 : c11b0f48
[ 31.041728] r7 : 00000438 r6 : 00000000 r5 : 00000000 r4 : 00000000
[ 31.041730] r3 : edffdae7 r2 : 00000002 r1 : edffdaec r0 : 00000000
[ 31.041908] [<c073273c>] (i2c_transfer) from [<c05926c4>] (drm_scdc_read+0x54/0x84)
[ 31.041913] [<c05926c4>] (drm_scdc_read) from [<c0592858>] (drm_scdc_set_scrambling+0x30/0xbc)
[ 31.041919] [<c0592858>] (drm_scdc_set_scrambling) from [<c05cc0f4>] (dw_hdmi_update_power+0x1440/0x1610)
[ 31.041926] [<c05cc0f4>] (dw_hdmi_update_power) from [<c05cc574>] (dw_hdmi_bridge_enable+0x2c/0x70)
[ 31.041932] [<c05cc574>] (dw_hdmi_bridge_enable) from [<c05aed48>] (drm_bridge_enable+0x24/0x34)
[ 31.041938] [<c05aed48>] (drm_bridge_enable) from [<c0591060>] (drm_atomic_helper_commit_modeset_enables+0x114/0x220)
[ 31.041943] [<c0591060>] (drm_atomic_helper_commit_modeset_enables) from [<c05c3fe0>] (rockchip_atomic_helper_commit_tail_rpm+0x28/0x64)
hdmi->i2c may not be set when ddc-i2c-bus property is used in device tree.
Fix this by using hdmi->ddc as the i2c adapter when calling drm_scdc_*().
Also report that SCDC is not supported when there is no DDC bus.
Fixes: 264fce6cc2 ("drm/bridge: dw-hdmi: Add SCDC and TMDS Scrambling support")
Signed-off-by: Jonas Karlman <jonas@kwiboo.se>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Reviewed-by: Neil Armstrong <narmstrong@baylibre.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Link: https://patchwork.freedesktop.org/patch/msgid/VE1PR03MB59031814B5BCAB2152923BDAAC210@VE1PR03MB5903.eurprd03.prod.outlook.com
Change-Id: I5b2cbb57848e51bcba5266a40f4bd509e0cba3bb
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Signed-off-by: Shunqing Chen <csq@rock-chips.com>
tips:
in rk3328, avsd and vdpu share the same interrupt number,
so, when each one hardware done, avsd and vdpu irq will response.
this is a normal log when meet the case.
Change-Id: I9fea220a64d7310805194d9f71c24db0cef1491e
Signed-off-by: Ding Wei <leo.ding@rock-chips.com>
According to test, 1/4 frame will cost a wait for 4ms, 1/8 frame
cost a wait for 1~2ms, I think 1~2ms is enough for a config done
write.
Change-Id: I6ba46a8a2cb97434998376e85e5b5fc7a53a9616
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
When system boot with boot logo on, drm_crtc_atomit_enable
won't be called, so vcstate->vdisplay can't be initialized.
So we get vdisplay/vtotatal by crtc.state->adjusted_mode.
Fixes: bd11b0fed8 ("drm/rockchip: vop2: wait for frame start by vcnt")
Change-Id: I39a1d62095347fe6e5d3c48ff7b1e08a20366f9c
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This make cpu can dump fb data allocated by ION.
Change-Id: I639e7cbbe6957d2bb02e4577805343cdbf5f5bf7
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Imitate the behaviors of drm_gem_map_detach() and drm_gem_map_dma_buf().
Graphics performance of rk3399 device using ion without this modification,
was quite poor.
Change-Id: Ia0b8e2f3026a61ee4addee9c1715291886fa1c99
Signed-off-by: Zhen Chen <chenzhen@rock-chips.com>
For RV1126, phy_calibrate will run in dwc3 reset irq function and lead
to dead lock. Besides, there is no critical area resources. So we should
remove mutex lock in phy calibrate for Rockchip platform.
Signed-off-by: Ren Jianing <jianing.ren@rock-chips.com>
Change-Id: Ic205959d96e7a6831aa9426738c1fd06deee1a22
if the GATE pin does not control the external PMOS to reduce the conduction
resistance, the VCC_SYS can be shutdown int power off mode.
Signed-off-by: Weixin Zhou <zwx@rock-chips.com>
Change-Id: I7312d19d608f7e7a015fca6f2b954d2b851af47d
1. Fix that when fd is used in A+B->C mode, the fd of
pat is not release.
2. Modify that the pat import from the application is
only copy to pat or src1.
Signed-off-by: Yu Qiaowei <cerf.yu@rock-chips.com>
Change-Id: I360459ba85fdaad5536a3317b5f415298be87d6b
The actually writeback format of 24bit RGB(without alpha)
is BGR888, the TRM description is wrong.
Change-Id: I7897eba9024efc7f95bda57743ff6c4d8533eeb0
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
This is needed for rk3566-rk817-eink-w6
Signed-off-by: Wang Panzhenzhuan <randy.wang@rock-chips.com>
Change-Id: I4362a200b7eada146b387d08a5d2bcc58c69f47f
Only do the i2c configs at the first time or after entering suspend
mode, and add mutex protect during suspend and resume.
Signed-off-by: Wenping Zhang <wenping.zhang@rock-chips.com>
Change-Id: Id3e16da88c526332238682421976a43c5974c936
When clear standby bit, the vop post will start scan out
with the old timing immediately(no need config done bit).
Sometime the old timing is verery different with the
current timing we want config(switch from 4K to 720P),
this may cause problems at some point.
So we clear standby after a new timing config done.
Change-Id: Id621bea6a622c151d3e339b102c6791a6244ac08
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Sometimes isr is disabled, wait for frame start
by poll vcnt is more safe.
Change-Id: I0f3d63e1d51a623d22eedef05920bcff5d63a75d
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>