Commit Graph

75432 Commits

Author SHA1 Message Date
Guochun Huang
ecc6097c8d drm/bridge: Add support for Maxim MAX96776
The deserializers convert a singleor dual-link GMSL2
serial input to embedded DisplayPort (eDP), enabling
display of high-resolution RGB888 video.

Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: Ief4d5a8ca9ed42c5954c8fc1403da58bebee4730
2022-08-10 10:19:57 +08:00
Jianqun Xu
60a150e070 drm/rockchip: Set both the DMA mask and the coherent DMA mask earlier
Set both the DMA mask and the coherent DMA mask before drm master to
binder the components.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Ia7ba80e4fddaf957e775e10348bacbf0568102bd
2022-08-09 15:28:23 +08:00
Guochun Huang
62e31fd34f drm/bridge: maxim-max96755f: Fix possible irq unbalanced
Change-Id: Id1295c0eec38526215ac104706e435c3cf94faae
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2022-08-08 17:26:47 +08:00
Zhang Yubing
7c699c81b4 drm/rockchip: vop2: set black background as default config for rk3588
For RK3588, the reset value of background is 0xa0080200, which
will enable background and output a grey image. But the reset
value is just valid in first frame and disable in follow frames.
If the panel backlight is valid before follow frames. The screen
may flick a grey image. To avoid this phenomenon appear, setting
black background after reset vop.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Iadf805a26d84c1dc49cb64a637588c43ecd32977
2022-08-05 20:53:38 +08:00
Wyon Bi
bf78aaf1e6 drm/bridge: maxim-max96745: Add video status check
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I8563e1c8c885034b7c1cb61389ce8cc97c8114c3
2022-08-05 08:17:17 +00:00
Wyon Bi
176a78c0ce drm/bridge: maxim-max96745: Fix possible irq unbalanced
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Id26d457f36fb2451fae7223c3876388bb8ab9adc
2022-08-05 08:15:17 +00:00
Wyon Bi
416f7f52af drm/bridge: maxim-max96752f: Add video status check
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I3880a68f9a6ec2aef2b82a568d4f40dd39feeaa0
2022-08-05 08:15:17 +00:00
Wyon Bi
be3554a423 drm/rockchip: dw_dp: Find possible connector from encoder
Fixes: de30a9e538 ("drm/rockchip: dw-dp: Support dp show uboot logo")
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Ib0e95ad4eaa88c7fd84f393d8c2dcceb4962a1b9
2022-08-05 08:15:17 +00:00
Nickey Yang
ebcd655cc2 drm/rockchip: dsi: add rv1126 support
Signed-off-by: Nickey Yang <nickey.yang@rock-chips.com>
Change-Id: Ic3a8df6294aea290c7966f107333cc46f6fd63ba
2022-08-04 17:46:31 +08:00
Damon Ding
d185ae34d0 drm/rockchip: dsi2: encoder->crtc maybe NULL
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I4f22a95f33ee012c47e2715aef0d66ec0b209b30
2022-08-04 16:15:33 +08:00
Zhang Yubing
0b955c148d drm/rockchip: vop2: close esmart pd when disable vop
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Ic12297df5e47e31e5eb3472a89030b158477ed60
2022-08-04 16:11:30 +08:00
Zhang Yubing
d1fe482eec drm/rockchop: vop2: set extend clk vp mask
When a extend clk is used before enter kernel, it need set the vp
mask to mark that it have been used by a video port

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: Ie6f0419621e8b250adca1783355318d4a9a2412d
2022-08-03 18:24:13 +08:00
Damon Ding
d636553315 drm/rockchip: vop2: fix the logic of disabling right splice win
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Iead8956b50c79caa0f587ac49276dfd8158c0c30
2022-08-03 14:23:36 +08:00
Damon Ding
ed60e70287 drm/rockchip: vop2: no need to standby splice_vp when disabling vp0 in 8k mode
Fixes: fa631748f8 ("drm/rockchip: vop2: Disable right VP and win in splice mode")
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ibcb8dd40840f72c0e8665f183458a7deeb488270
2022-08-03 14:23:36 +08:00
Damon Ding
21600b1b0e drm/rockchip: vop2: not allow to enable splice mode when vp1 active
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I4794e5db46c637edd4dcec5aa75698b0d38fd9dc
2022-08-03 14:23:36 +08:00
Damon Ding
558f320197 drm/rockchip: vop: add vop_vp_id definition
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I6f8665c38c3999e679f3c6b7ff5297aef902bc31
2022-08-03 14:23:36 +08:00
Wyon Bi
0c71219bf3 drm/bridge: analogix_dp: Fix TX lane count & rate setup
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Idca54fe6c1bd4317da6c4bb65e87df3d4aa07c6c
2022-08-02 17:22:03 +08:00
Wyon Bi
38fbb24eeb drm/bridge: maxim-max96745: Check training state
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I6f68dc0b155cd6e8a5ac314449ffe0f263f64046
2022-08-02 08:34:46 +00:00
Wyon Bi
66fee6290f drm/bridge: analogix_dp: Support max_link_rate limit
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I704987e5a20402b451d0d8a0a0d7e0ae1649be25
2022-08-02 08:34:16 +00:00
Zhang Yubing
2703184e9d drm/rockchp: dw-dp: set a suitable hsync limit value
In actual test, the min hsync value is 9, So it just need filter
the display mode whose hsync value is less than 9.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I06bc52c1f8b45894ee9813c8d014e6a9e3f48df6
2022-08-01 16:45:41 +08:00
Algea Cao
a40352070e drm/rockchip: dw_hdmi: Fixed ID error when disable HDMI
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Change-Id: Iad2a8486d798b6a4ea0f1a0b41755ffcb4a554b7
2022-07-28 21:11:54 +08:00
Damon Ding
4b8c0aef05 drm/rockchip: vop2: add plane mask assignment rule for rk3566
There are 3 planes and 3 mirror plane for rk3566. If both
exist in one vp, the mirror planes should be removed in
plane_mask drm_property.

Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I15b776224ebfbaa19a0d9d3dca56828a980e0c54
2022-07-28 18:27:35 +08:00
Damon Ding
787097d01b drm/rockchip: logo: modify debug messages in get_framebuffer_by_node()
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I395019d6a908d5b06d4c5f75aa1b888408b5dff4
2022-07-28 18:27:35 +08:00
Sandy Huang
ce5a779a19 drm/rockchip: vop2: gamma maybe enable at uboot
gamma maybe enable at uboot, so we read dsp_lut state to adjust gamma
state is more correct.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Ie8893e6136009874c140933b10a77d532e019aa1
2022-07-28 14:26:04 +08:00
Sandy Huang
5aa1d0e08f drm/rockchip: vop2: fix double config done at one frame time
Maybe appear the following case:
-> set gamma
-> config done
-> atomic commit
   --> update win format
   --> update win address
   ---> here maybe meet vop hardware frame start, and triggle some config take affect.
   ---> as only some config take affect, this maybe lead to iommu pagefault.
   --> update win size
   --> update win other parameters
-> config done

so we add vop2_wait_for_fs_by_done_bit_status() to make sure the first config done take
effect and then to do next frame config.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: I6ec67b374b3afd2bed4a57aa1e7b729964df1736
2022-07-27 18:16:29 +08:00
Tao Huang
1701545271 drm/rockchip: vop2: Remove unnecessary check
Fix the following smatch warnings:

rockchip_drm_vop2.c:2892 rk3568_crtc_load_lut() warn: we tested 'vp->gamma_lut_active' before and it was 'true'
rockchip_drm_vop2.c:6995 vop2_setup_hdr10() warn: we tested 'vp->hdr_out' before and it was 'true'
rockchip_drm_vop2.c:7512 vop2_setup_dly_for_vp() warn: we tested 'vp->hdr_in' before and it was 'true'

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I239658d19924b12843efdee8edf89962df1dae0b
2022-07-27 15:32:40 +08:00
Tao Huang
4df9208b4e drm/rockchip: drv: Fix drm_atomic_helper_duplicate_state() error check
Use IS_ERR() instead of checking for a NULL pointer when calling for
drm_atomic_helper_duplicate_state() failures.
drm_atomic_helper_duplicate_state() return an ERR_PTR()-encoded error
code on failure.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I95388698239a7e1bd2bfbedd2bd921bbf52372f0
2022-07-27 11:18:50 +08:00
Andy Yan
a9c9e4c45a drm/rockchip: vop2: Adjust wait critical time zone policy when there are two pending vp
Current policy:

If there are two pending config done vp, and one of them is
at critical time zone, wait for the one which has long time
to vsync.

This may lead a very long wait, for example: VP0 is 3840 x 2160,
VP2 is 1920 x 1080, they are all have pending cfg done bits,
and the vcnt of VP0 is 1367, the vcnt of VP2 is 995, VP2 is
at the critical time zone, we will wait VP0 vsync(almost half frame time)
according to this policy. This lead a very long wait.

The new policy:

If there are two pending config done vp, and one of them is
at critical time zone, compare the left vcnt time of the
two vp:

if (first_vp_left_time > second_vp_left_time) {
	if ((first_vp_left_time - second_vp_left_time) > first_vp_safe_time)
		wait_vp = second_done_vp;
	else
		wait_vp = first_done_vp;
} else {
	if ((second_vp_left_time - first_vp_left_time) > second_vp_safe_time)
               wait_vp = first_done_vp;
	else
		wait_vp = second_done_vp;
}

Change-Id: I7154ad716841c6c28947ddfecc845c7271cc507a
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2022-07-27 09:56:15 +08:00
Andy Yan
21b6402519 drm/rockchip: vop2: Set vpstate->color_key to uint64_t
color_key is passed by atomic_set_property with a uint64_t val.

Change-Id: Idc66dc1632f3c00f353d05016aa79f362506fef5
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
2022-07-26 19:35:56 +08:00
Zhang Yubing
8f36a88f84 drm/rockchip: Add dw hdcp2 controller driver
Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I0ac6ee46e0f97714f76fbf613a2400627343546d
2022-07-26 14:51:41 +08:00
Tao Huang
00a0a68f4e MALI: midgard: Fix compile warning when !CONFIG_DEBUG_FS
In file included from drivers/gpu/arm/midgard/backend/gpu/mali_kbase_mmu_hw_direct.c:22:
 drivers/gpu/arm/midgard/mali_kbase.h:600:9: warning: 'kbase_io_history_term' macro redefined [-Wmacro-redefined]
 #define kbase_io_history_term CSTD_NOP
         ^
 drivers/gpu/arm/midgard/rename.h:139:9: note: previous definition is here
 #define kbase_io_history_term midgard_kbase_io_history_term
         ^

In file included from drivers/gpu/arm/midgard/mali_kbase_core_linux.c:42:
 drivers/gpu/arm/midgard/mali_kbase_regs_history_debugfs.h:46:9: warning: 'kbasep_regs_history_debugfs_init' macro redefined [-Wmacro-redefined]
 #define kbasep_regs_history_debugfs_init CSTD_NOP
         ^
 drivers/gpu/arm/midgard/rename.h:326:9: note: previous definition is here
 #define kbasep_regs_history_debugfs_init midgard_kbasep_regs_history_debugfs_init
         ^

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I8de63444cdb8d5cf265f3d6a80ab0ad69bec3754
2022-07-26 14:49:34 +08:00
Guochun Huang
f98f2ffc40 drm/rockchip: dsi2: enable soft_te, when use gpio irq to triggle new fs
Change-Id: I08c2e945c3d974194e72a2743e9f5d80f4a3e09c
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
2022-07-26 10:48:45 +08:00
Sandy Huang
c07f31cc8c drm/rockchip: vop2: add support soft te for mipi cmd mode
some product will use gpio to instead of TE, so we add soft TE for all vp.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
Change-Id: Idb2d8b6a63c17308519761ae986f853b2baf0bc4
2022-07-26 10:48:45 +08:00
Jianqun Xu
b8105eeb84 drm/rockchip: gem: partial sync use sg_phys instead of sg_dma_address
The sg_phys() always return the physical address of a scattergather, but
the sg_dma_address() return the iova address, for a device without iommu
that is a bad address.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: I83641c6af324bbaca3d27ea14de41cfca729e258
2022-07-25 14:48:59 +08:00
Guochun Huang
3611136b7f drm/bridge: maxim-max96755f: Add lock irq handler
Signed-off-by: Guochun Huang <hero.huang@rock-chips.com>
Change-Id: Ieebaeadf9b051963dcba4a589a983e6188ef285d
2022-07-25 10:27:30 +08:00
Wyon Bi
9a01bbc010 drm/bridge: maxim-max96745: Add extcon support
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I3efe31517b2da16531b4afa7884247d6ce54504e
2022-07-25 10:27:30 +08:00
Wyon Bi
d9a61536e3 drm/bridge: maxim-max96745: Add lock irq handler
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: Id359495f13ccc7fda85ed7777cb72933433bda20
2022-07-25 10:27:30 +08:00
Damon Ding
b93ccf0a10 drm/rockchip: vop: win may not support color_key
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I05571f7a8d204b79d3724f45717446010cc38c5e
2022-07-21 19:04:31 +08:00
Damon Ding
6616f0235c drm/rockchip: vop: add win2 color_key support for px30
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I8204f52275179d8d65102c8fd71f214e9449ea5a
2022-07-21 19:04:20 +08:00
Andy Yan
f5502856e3 drm/rockchip: vop2: A workaround for PD_ESMART on/off
Signed-off-by: Andy Yan <andy.yan@rock-chips.com>
Change-Id: Ic7a23c62da91b5e996a9c790ea6ff48ca4e0bf2c
2022-07-20 18:44:58 +08:00
Zhang Yubing
e16a4b0a15 drm/rockchip: vop2: filter display mode by vop aclk
When the pixelclk is more than 600MHz but aclk is equal or
less than 500MHz, it will cause error. So filter the display
mode whose pixelclk is more than 600Mhz when the aclk is
equal or less than 500MHz.

Signed-off-by: Zhang Yubing <yubing.zhang@rock-chips.com>
Change-Id: I04216b661ddfdf8aa5d6de9b14e430ecbf8c4d22
2022-07-20 18:26:15 +08:00
Damon Ding
9eee000945 drm/rockchip: vop: invert dclk on rv1106 to modify signal quality
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: I6d01aaaaead8ea3a45abec75f03dbab140c49da2
2022-07-19 17:00:07 +08:00
Damon Ding
36bede602e drm/rockchip: vop: double dclk when interface is BT656 on rv1106
Signed-off-by: Damon Ding <damon.ding@rock-chips.com>
Change-Id: Ia1fdfb2be84b1dc8b6e219cf1ae0a0692f42e09a
2022-07-19 16:55:43 +08:00
Chen Shunqing
fd903b0aeb drm/bridge: synopsys: dw-hdmi-qp: add cec enable config
HDMITX0/HDMITX1/HDMIRX cec only one can be enabled at the same time.

Signed-off-by: Chen Shunqing <csq@rock-chips.com>
Change-Id: I1e8e444aa375bf80e69c7856d0bcb90e7a76071d
2022-07-18 18:24:20 +08:00
Wyon Bi
4217dba0c3 drm/bridge: analogix_dp: Fix spelling mistake "PATTREN" -> "PATTERN"
Fixes: 304dbb104d ("drm/bridge: analogix_dp: Add DP Test Automation")
Signed-off-by: Wyon Bi <bivvy.bi@rock-chips.com>
Change-Id: I36c330443cffc2af66802d049655d400f62f849e
2022-07-18 09:57:02 +08:00
Tao Huang
c7a43f0886 Merge tag 'ASB-2022-06-05_12-5.10' of https://android.googlesource.com/kernel/common
https://source.android.com/security/bulletin/2022-01-01
CVE-2022-24958
CVE-2022-20136
CVE-2022-23960
CVE-2022-20141
CVE-2021-4154
CVE-2022-20132

* tag 'ASB-2022-06-05_12-5.10': (1188 commits)
  BACKPORT: net/sched: cls_u32: fix netns refcount changes in u32_change()
  UPSTREAM: io_uring: always use original task when preparing req identity
  FROMLIST: remoteproc: Fix dma_mem leak after rproc_shutdown
  FROMLIST: dma-mapping: Add dma_release_coherent_memory to DMA API
  ANDROID: Update QCOM symbol list for __reset_control_get
  ANDROID: vendor_hooks: Add hooks for mutex
  BACKPORT: can: ems_usb: ems_usb_start_xmit(): fix double dev_kfree_skb() in error path
  BACKPORT: can: usb_8dev: usb_8dev_start_xmit(): fix double dev_kfree_skb() in error path
  ANDROID: GKI: Update symbols to symbol list
  ANDROID: oplus: Update the ABI xml and symbol list
  UPSTREAM: remoteproc: Fix count check in rproc_coredump_write()
  BACKPORT: esp: Fix possible buffer overflow in ESP transformation
  ANDROID: Fix the drain_all_pages default condition broken by a hook
  UPSTREAM: Revert "xfrm: xfrm_state_mtu should return at least 1280 for ipv6"
  UPSTREAM: xfrm: fix MTU regression
  ANDROID: signal: Add vendor hook for memory reaping
  FROMGIT: usb: gadget: uvc: allow for application to cleanly shutdown
  FROMGIT: usb: dwc3: gadget: increase tx fifo size for ss isoc endpoints
  UPSTREAM: usb: gadget: configfs: clear deactivation flag in configfs_composite_unbind()
  FROMGIT: usb: gadget: uvc: remove pause flag use
  ...

Change-Id: Idf3eea3b21dc69c8189161c0e24744336431913a

Conflicts:
	drivers/gpu/drm/rockchip/dw_hdmi-rockchip.c
	drivers/spi/spi-rockchip.c
	drivers/usb/gadget/function/f_uvc.c
	drivers/usb/gadget/function/uvc.h
	drivers/usb/gadget/function/uvc_configfs.c
	drivers/usb/gadget/function/uvc_queue.c
	drivers/usb/gadget/function/uvc_video.c
	sound/soc/rockchip/rockchip_i2s.c
2022-07-15 17:58:38 +08:00
Tao Huang
24cbee6672 Merge tag 'ASB-2022-04-05_12-5.10' of https://android.googlesource.com/kernel/common
https://source.android.com/security/bulletin/2022-04-01
CVE-2021-0707
CVE-2021-39800
CVE-2021-39801 (4.9 only)
CVE-2021-39802

* tag 'ASB-2022-04-05_12-5.10': (3832 commits)
  ANDROID: GKI: Update symbols to abi_gki_aarch64_oplus
  ANDROID: vendor_hooks: Reduce pointless modversions CRC churn
  UPSTREAM: locking/lockdep: Avoid potential access of invalid memory in lock_class
  ANDROID: mm: Fix implicit declaration of function 'isolate_lru_page'
  ANDROID: GKI: Update symbols to symbol list
  ANDROID: GKI: Update symbols to symbol list
  ANDROID: GKI: Add hook symbol to symbol list
  Revert "ANDROID: dm-bow: Protect Ranges fetched and erased from the RB tree"
  ANDROID: vendor_hooks: Add hooks to for free_unref_page_commit
  ANDROID: vendor_hooks: Add hooks to for alloc_contig_range
  ANDROID: GKI: Update symbols to symbol list
  ANDROID: vendor_hooks: Add hook in shrink_node_memcgs
  ANDROID: GKI: Add symbols to symbol list
  FROMGIT: iommu/iova: Improve 32-bit free space estimate
  ANDROID: export walk_page_range and swp_swap_info
  ANDROID: vendor_hooks: export shrink_slab
  ANDROID: usb: gadget: f_accessory: add compat_ioctl support
  UPSTREAM: sr9700: sanity check for packet length
  UPSTREAM: io_uring: return back safer resurrect
  UPSTREAM: Revert "xfrm: state and policy should fail if XFRMA_IF_ID 0"
  ...

Change-Id: Ic61ead530b99b10ffd535a358a48fe9bb8c33fd4

Conflicts:
	drivers/android/Kconfig
	drivers/gpu/drm/rockchip/dw-mipi-dsi-rockchip.c
	drivers/gpu/drm/rockchip/rockchip_vop_reg.c
	drivers/i2c/busses/i2c-rk3x.c
	drivers/media/i2c/imx258.c
	drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
	drivers/usb/dwc2/gadget.c
	drivers/usb/gadget/function/uvc.h
	lib/Kconfig.debug
2022-07-15 17:40:39 +08:00
Jianqun Xu
aab138a4a6 drm/rockchip: rockchip_drm_vop2 avoid division by zero
WARN on when the frame time is '0'.

Signed-off-by: Jianqun Xu <jay.xu@rock-chips.com>
Change-Id: Id949b5b9178f67b54622439e8f95c23236f6f1c9
2022-07-15 15:22:53 +08:00
Tao Huang
31d7384ebb drm/rockchip: cdn-dp-core: Fix cdn_dp_connector_mode_valid return type
mode_valid should return enum drm_mode_status.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: I5525403ad0d637dd41c3ac805d92d186332a8c5b
2022-07-15 14:50:34 +08:00
Tao Huang
5d64d87645 drm/rockchip: dsi2: Fix dw_mipi_dsi2_connector_mode_valid return type
Fix CFI violation:
Kernel panic - not syncing: CFI failure (target: dw_mipi_dsi2_connector_mode_valid+0x0/0x8)

mode_valid should return enum drm_mode_status.

Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Change-Id: Ic59e7dda400c7eb18c8b29d6889f4a88d277a780
2022-07-15 14:39:00 +08:00