From 923f3eaa06a1683fe052223df49f65fda58373b1 Mon Sep 17 00:00:00 2001 From: Damon Ding Date: Tue, 12 Dec 2023 19:03:26 +0800 Subject: [PATCH 1/4] dt-bindings: display: panel: add more properties with descriptions cherry-pick from patches of file in kernel-4.19: Documentation/devicetree/bindings/display/panel/simple-panel.txt bb34dd00f4b8 ("drm/panel: simple: support positive/negative driven supply") dab71decfd25 ("dt-bindings: panel: Document more property") 405fb0784947 ("drm/panel: simple: support transmit DSI packet") 968a5ee20099 ("drm/panel: simple: Add reset gpio") a966346935a1 ("drm/panel: simple: Get panel-desc data from DT") Change-Id: I8eeefd637640ddfa1848f74d1daea7d462f956eb Signed-off-by: Damon Ding --- .../bindings/display/panel/panel-simple.yaml | 74 +++++++++++++++++++ 1 file changed, 74 insertions(+) diff --git a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml index edb53ab0d9eb..8fcf8c02d63d 100644 --- a/Documentation/devicetree/bindings/display/panel/panel-simple.yaml +++ b/Documentation/devicetree/bindings/display/panel/panel-simple.yaml @@ -29,6 +29,10 @@ properties: # compatible must be listed in alphabetical order, ordered by compatible. # The description in the comment is mandatory for each compatible. + # common simple panel + - simple-panel + # common simple dsi panel + - simple-panel-dsi # Ampire AM-1280800N3TZQW-T00H 10.1" WQVGA TFT LCD panel - ampire,am-1280800n3tzqw-t00h # Ampire AM-480272H3TMQW-T01H 4.3" WQVGA TFT LCD panel @@ -288,6 +292,76 @@ properties: port: true power-supply: true + reset-gpios: + description: GPIO pin to reset the panel + + prepare-delay-ms: + description: | + the time (in milliseconds) that it takes for the panel to + become ready and start receiving video data + enable-delay-ms: + description: | + the time (in milliseconds) that it takes for the panel to + display the first valid frame after starting to receive + video data + disable-delay-ms: + description: | + the time (in milliseconds) that it takes for the panel to + turn the display off (no content is visible) + unprepare-delay-ms: + description: | + the time (in milliseconds) that it takes for the panel + to power itself down completely + reset-delay-ms: + description: | + the time (in milliseconds) that it takes for the panel to + reset itself completely + init-delay-ms: + description: | + the time (in milliseconds) that it takes for the panel to + send init command sequence after reset deassert + + width-mm: + description: width (in millimeters) of the panel's active display area + height-mm: + description: height (in millimeters) of the panel's active display area + + bpc: + description: bits per color/component + bus-format: + description: pixel data format on the wire + + dsi,lanes: + description: number of active data lanes + dsi,format: + description: pixel format for video mode + dsi,flags: + description: DSI operation mode related flags + + panel-init-sequence: true + panel-exit-sequence: + description: | + A byte stream formed by simple multiple dcs packets. + byte 0 - dcs data type + byte 1 - wait number of specified ms after dcs command transmitted + byte 2 - packet payload length + byte 3 - and beyond: number byte of payload + rockchip,cmd-type: + description: default is DSI cmd, or "spi", "mcu" cmd type + spi-sdi: + description: spi init panel for spi-sdi io + spi-scl: + description: spi init panel for spi-scl io + spi-cs: + description: spi init pael for spi-cs io + + power-invert: + description: power invert control + vsp-supply: + description: positive voltage supply + vsn-supply: + description: negative voltage supply + additionalProperties: false required: From 69e02ae9846b6a50b94c4edf491c52c42a1ddfb9 Mon Sep 17 00:00:00 2001 From: Chaoyi Chen Date: Fri, 8 Dec 2023 11:30:25 +0800 Subject: [PATCH 2/4] drm/rockchip: vop: fix vop dynamic debug crash If the old plane state is invalid, no printing should be performed, otherwise panic will occur. Fixes: 2e409456c1f4 ("drm/rockchip: add dynamic debug for vop") Change-Id: I0687f9231c49bc068322f555f95af96a214b049d Signed-off-by: Chaoyi Chen --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index d22b943e1a3a..1d415f7b2a67 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -1879,12 +1879,12 @@ static void vop_plane_atomic_disable(struct drm_plane *plane, to_vop_plane_state(plane->state); #endif - rockchip_drm_dbg(vop->dev, VOP_DEBUG_PLANE, "disable win%d-area%d by %s\n", - win->win_id, win->area_id, current->comm); - if (!old_state->crtc) return; + rockchip_drm_dbg(vop->dev, VOP_DEBUG_PLANE, "disable win%d-area%d by %s\n", + win->win_id, win->area_id, current->comm); + spin_lock(&vop->reg_lock); vop_win_disable(vop, win); From eefe952b3c43f4782a29bb43e74341b31afda322 Mon Sep 17 00:00:00 2001 From: Sandy Huang Date: Wed, 13 Dec 2023 15:31:22 +0800 Subject: [PATCH 3/4] drm/rockchip: vop: remove unused PLANE_MASK prop for vop We can get the binding relationship between plane and vop from the standard prop possible crtcs, so we remove the unused PLANE_MASK prop from vop. Signed-off-by: Sandy Huang Change-Id: I2c68ed60447024f4f5f379fa39b28ae0da065eae --- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 30 --------------------- drivers/gpu/drm/rockchip/rockchip_drm_vop.h | 8 ------ 2 files changed, 38 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c index 1d415f7b2a67..b80ef0c6dc53 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -222,7 +222,6 @@ struct vop { struct dentry *debugfs; struct drm_info_list *debugfs_files; struct drm_property *plane_feature_prop; - struct drm_property *plane_mask_prop; struct drm_property *feature_prop; bool is_iommu_enabled; @@ -237,7 +236,6 @@ struct vop { u32 background; u32 line_flag; u8 id; - u8 plane_mask; u64 soc_id; struct drm_prop_enum_list *plane_name_list; @@ -4639,32 +4637,6 @@ static int vop_of_init_display_lut(struct vop *vop) return 0; } -static int vop_crtc_create_plane_mask_property(struct vop *vop, struct drm_crtc *crtc) -{ - struct drm_property *prop; - - static const struct drm_prop_enum_list props[] = { - { ROCKCHIP_VOP_WIN0, "Win0" }, - { ROCKCHIP_VOP_WIN1, "Win1" }, - { ROCKCHIP_VOP_WIN2, "Win2" }, - { ROCKCHIP_VOP_WIN3, "Win3" }, - }; - - prop = drm_property_create_bitmask(vop->drm_dev, - DRM_MODE_PROP_IMMUTABLE, "PLANE_MASK", - props, ARRAY_SIZE(props), - 0xffffffff); - if (!prop) { - DRM_DEV_ERROR(vop->dev, "create plane_mask prop for vp%d failed\n", vop->id); - return -ENOMEM; - } - - vop->plane_mask_prop = prop; - drm_object_attach_property(&crtc->base, vop->plane_mask_prop, vop->plane_mask); - - return 0; -} - static int vop_crtc_create_feature_property(struct vop *vop, struct drm_crtc *crtc) { const struct vop_data *vop_data = vop->data; @@ -4792,7 +4764,6 @@ static int vop_create_crtc(struct vop *vop) VOP_ATTACH_MODE_CONFIG_PROP(tv_top_margin_property, 100); VOP_ATTACH_MODE_CONFIG_PROP(tv_bottom_margin_property, 100); #undef VOP_ATTACH_MODE_CONFIG_PROP - vop_crtc_create_plane_mask_property(vop, crtc); vop_crtc_create_feature_property(vop, crtc); ret = drm_self_refresh_helper_init(crtc); if (ret) @@ -4961,7 +4932,6 @@ static int vop_win_init(struct vop *vop) vop_area->name = devm_kstrdup(vop->dev, name, GFP_KERNEL); num_wins++; } - vop->plane_mask |= BIT(vop_win->win_id); } vop->num_wins = num_wins; diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h index b6e12d297d45..5f72a76beee0 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.h +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.h @@ -91,14 +91,6 @@ enum vop_vp_id { ROCKCHIP_VOP_VP3, }; -enum vop_win_phy_id { - ROCKCHIP_VOP_WIN0 = 0, - ROCKCHIP_VOP_WIN1, - ROCKCHIP_VOP_WIN2, - ROCKCHIP_VOP_WIN3, - ROCKCHIP_VOP_PHY_ID_INVALID = -1, -}; - enum bcsh_out_mode { BCSH_OUT_MODE_BLACK, BCSH_OUT_MODE_BLUE, From a16a11216577f50350302da5014d2cd7d5747d42 Mon Sep 17 00:00:00 2001 From: Lin Jianhua Date: Mon, 18 Dec 2023 09:27:39 +0800 Subject: [PATCH 4/4] ARM: dts: rockchip: add rk3308-evb-audio-v10-display-rgb-aarch32.dts Change-Id: I33346b330dcb617069d3ca0e787d14dadd89d400 Signed-off-by: Lin Jianhua --- arch/arm/boot/dts/Makefile | 1 + ...rk3308-evb-audio-v10-display-rgb-aarch32.dts | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 arch/arm/boot/dts/rk3308-evb-audio-v10-display-rgb-aarch32.dts diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile index f239eeb66715..a1fdd472c37a 100644 --- a/arch/arm/boot/dts/Makefile +++ b/arch/arm/boot/dts/Makefile @@ -1064,6 +1064,7 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += \ rk3288-veyron-speedy.dtb \ rk3288-veyron-tiger.dtb \ rk3288-vyasa.dtb \ + rk3308-evb-audio-v10-display-rgb-aarch32.dtb \ rk3308bs-evb-amic-v11-aarch32.dtb \ rk3308bs-evb-dmic-pdm-v11-aarch32.dtb \ rk3308bs-evb-mipi-display-v11-aarch32.dtb \ diff --git a/arch/arm/boot/dts/rk3308-evb-audio-v10-display-rgb-aarch32.dts b/arch/arm/boot/dts/rk3308-evb-audio-v10-display-rgb-aarch32.dts new file mode 100644 index 000000000000..e2f36bc7fc8f --- /dev/null +++ b/arch/arm/boot/dts/rk3308-evb-audio-v10-display-rgb-aarch32.dts @@ -0,0 +1,17 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2023 Fuzhou Rockchip Electronics Co., Ltd + */ + +#include "arm64/rockchip/rk3308-evb-audio-v10-display-rgb.dts" + +/ { + model = "Rockchip RK3308 evb audio display rgb board (AArch32)"; + compatible = "rockchip,rk3308-evb-audio-v10-display-rgb-aarch32", "rockchip,rk3308"; +}; + +&ramoops { + reg = <0x0 0x30000 0x0 0x20000>; + record-size = <0x00000>; + console-size = <0x20000>; +};