From bfb8e98f9d0361e86a82c1295f919387e83e71ec Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Fri, 22 Oct 2021 13:03:50 +0200 Subject: [PATCH 1/7] Rockchip: linux: rebase patches on 5.10.61 --- .../linux-0001-rockchip-from-5.11.patch | 10 +- .../linux-0002-rockchip-from-5.12.patch | 8 +- ...ch => linux-0004-rockchip-from-next.patch} | 0 ...ch => linux-0005-rockchip-from-list.patch} | 4 +- .../default/linux-0010-v4l2-from-list.patch | 12 +- .../default/linux-0021-drm-from-list.patch | 20 +-- ...ip.patch => linux-1000-drm-rockchip.patch} | 118 +++++++++--------- ...p.patch => linux-1001-v4l2-rockchip.patch} | 44 +++---- ...c.patch => linux-1002-for-libreelec.patch} | 26 ++-- .../linux-2000-v4l-wip-rkvdec-vp9.patch | 4 +- .../linux-2001-v4l-wip-rkvdec-hevc.patch | 49 ++++---- .../linux-2002-v4l-wip-iep-driver.patch | 6 +- 12 files changed, 151 insertions(+), 150 deletions(-) rename projects/Rockchip/patches/linux/default/{linux-0003-rockchip-from-next.patch => linux-0004-rockchip-from-next.patch} (100%) rename projects/Rockchip/patches/linux/default/{linux-0004-rockchip-from-list.patch => linux-0005-rockchip-from-list.patch} (99%) rename projects/Rockchip/patches/linux/default/{linux-1001-drm-rockchip.patch => linux-1000-drm-rockchip.patch} (97%) rename projects/Rockchip/patches/linux/default/{linux-1002-v4l2-rockchip.patch => linux-1001-v4l2-rockchip.patch} (96%) rename projects/Rockchip/patches/linux/default/{linux-1003-for-libreelec.patch => linux-1002-for-libreelec.patch} (98%) diff --git a/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.11.patch b/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.11.patch index 0bf1066b21..8217d0efe8 100644 --- a/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.11.patch +++ b/projects/Rockchip/patches/linux/default/linux-0001-rockchip-from-5.11.patch @@ -1960,7 +1960,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -index b76282e704de..697fce709031 100644 +index daa9a0c601a9..a853d4b1c10d 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts @@ -161,6 +161,10 @@ &hdmiphy { @@ -2006,7 +2006,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 12 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -index 697fce709031..19959bfba451 100644 +index a853d4b1c10d..7d9481962f51 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts @@ -104,6 +104,14 @@ user_led: led-1 { @@ -2061,7 +2061,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index 7e69603fb41c..4d9a2ea3e6bf 100644 +index 4b6065dbba55..aa009063c51d 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -331,7 +331,7 @@ sdmmc: mmc@fe320000 { @@ -2784,7 +2784,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index 4d9a2ea3e6bf..2551b238b97c 100644 +index aa009063c51d..7cc4a0267f46 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -1725,6 +1725,32 @@ vopb_mmu: iommu@ff903f00 { @@ -2843,7 +2843,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 74 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi -index 60cd1c18cd4e..beee5fbb3443 100644 +index e9ecffc409c0..5d7a9d96d163 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-gru-scarlet.dtsi @@ -296,6 +296,52 @@ camera: &i2c7 { diff --git a/projects/Rockchip/patches/linux/default/linux-0002-rockchip-from-5.12.patch b/projects/Rockchip/patches/linux/default/linux-0002-rockchip-from-5.12.patch index 00c2e2fa24..5578ef104f 100644 --- a/projects/Rockchip/patches/linux/default/linux-0002-rockchip-from-5.12.patch +++ b/projects/Rockchip/patches/linux/default/linux-0002-rockchip-from-5.12.patch @@ -49,7 +49,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 3 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index 93c734d8a46c..17709faf651b 100644 +index e546c9d1d646..169a8064673d 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -27,6 +27,9 @@ aliases { @@ -198,7 +198,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi -index 68d5a58cfe88..01ea1f170f77 100644 +index 0d89ad274268..94f691f16944 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -1329,72 +1329,72 @@ opp-600000000 { @@ -310,7 +310,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/px30.dtsi b/arch/arm64/boot/dts/rockchip/px30.dtsi -index 64193292d26c..d8b673b486c9 100644 +index 0d6761074b11..3ece5344574d 100644 --- a/arch/arm64/boot/dts/rockchip/px30.dtsi +++ b/arch/arm64/boot/dts/rockchip/px30.dtsi @@ -1107,102 +1107,102 @@ vopl_mmu: iommu@ff470f00 { @@ -495,7 +495,7 @@ Signed-off-by: Heiko Stuebner 1 file changed, 24 insertions(+), 32 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts -index 86cfb5c50a94..c984662043da 100644 +index 95ab6928cfd4..ecf3fcf24ff3 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts @@ -84,34 +84,32 @@ standby_led: led-1 { diff --git a/projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-next.patch b/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch similarity index 100% rename from projects/Rockchip/patches/linux/default/linux-0003-rockchip-from-next.patch rename to projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch diff --git a/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0005-rockchip-from-list.patch similarity index 99% rename from projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-list.patch rename to projects/Rockchip/patches/linux/default/linux-0005-rockchip-from-list.patch index aeabfcd4cb..4b626e2dd7 100644 --- a/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-list.patch +++ b/projects/Rockchip/patches/linux/default/linux-0005-rockchip-from-list.patch @@ -1092,10 +1092,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 8 insertions(+) diff --git a/drivers/mmc/core/core.c b/drivers/mmc/core/core.c -index eaf4810fe656..6f8ea06b187b 100644 +index b5f3f160c842..6eb76c6cfd45 100644 --- a/drivers/mmc/core/core.c +++ b/drivers/mmc/core/core.c -@@ -1349,6 +1349,14 @@ void mmc_power_off(struct mmc_host *host) +@@ -1352,6 +1352,14 @@ void mmc_power_off(struct mmc_host *host) if (host->ios.power_mode == MMC_POWER_OFF) return; diff --git a/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch index d1d06c89bd..1d7fcf55af 100644 --- a/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch +++ b/projects/Rockchip/patches/linux/default/linux-0010-v4l2-from-list.patch @@ -47,7 +47,7 @@ Signed-off-by: Jonas Karlman 1 file changed, 2 insertions(+) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 1263991de76f..71a6b7b0b057 100644 +index e68303e2b390..38982049c7b8 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -223,6 +223,8 @@ static int rkvdec_try_capture_fmt(struct file *file, void *priv, @@ -98,7 +98,7 @@ index 054d2e3eed67..d46424ba88e8 100644 FRAME_MBS_ONLY_FLAG); WRITE_PPS(!!(sps->flags & V4L2_H264_SPS_FLAG_MB_ADAPTIVE_FRAME_FIELD), diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 71a6b7b0b057..f405dd72ad93 100644 +index 38982049c7b8..ba2026d79a1b 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -29,8 +29,11 @@ @@ -682,7 +682,7 @@ Signed-off-by: Jonas Karlman 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index f405dd72ad93..c81ca5c7e979 100644 +index ba2026d79a1b..4f36783c7881 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -27,6 +27,17 @@ @@ -754,7 +754,7 @@ Signed-off-by: Jonas Karlman 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index c81ca5c7e979..a11474214bde 100644 +index 4f36783c7881..1a99b3a9ddce 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -38,6 +38,16 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx, @@ -947,7 +947,7 @@ index 6f2d41b2e076..c115cd362a7f 100644 .stop = rkvdec_h264_stop, .run = rkvdec_h264_run, diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index a11474214bde..b57a39ce4f48 100644 +index 1a99b3a9ddce..85b9530bcddb 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -31,7 +31,7 @@ static void rkvdec_fill_decoded_pixfmt(struct rkvdec_ctx *ctx, @@ -1014,7 +1014,7 @@ Reviewed-by: Ezequiel Garcia 1 file changed, 13 insertions(+) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index b57a39ce4f48..9492822c12ae 100644 +index 85b9530bcddb..539b0c5efdcc 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -132,6 +132,19 @@ static const struct rkvdec_ctrl_desc rkvdec_h264_ctrl_descs[] = { diff --git a/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch b/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch index 244d6f5046..429da540fc 100644 --- a/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch +++ b/projects/Rockchip/patches/linux/default/linux-0021-drm-from-list.patch @@ -76,7 +76,7 @@ Reviewed-by: Sandy Huang 3 files changed, 54 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index c80f7d9fd13f..eb663e25ad9e 100644 +index 0f23144491e4..b149f0ab5201 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -261,6 +261,18 @@ static bool has_rb_swapped(uint32_t format) @@ -160,7 +160,7 @@ index 857d97cdc67c..b7169010622a 100644 struct vop_reg act_info; struct vop_reg dsp_info; diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index 80053d91a301..2c55e1852c3d 100644 +index a6fe03c3748a..c78b711765fd 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c @@ -50,6 +50,23 @@ static const uint32_t formats_win_full[] = { @@ -187,7 +187,7 @@ index 80053d91a301..2c55e1852c3d 100644 static const uint64_t format_modifiers_win_full[] = { DRM_FORMAT_MOD_LINEAR, DRM_FORMAT_MOD_INVALID, -@@ -579,11 +596,12 @@ static const struct vop_scl_regs rk3288_win_full_scl = { +@@ -584,11 +601,12 @@ static const struct vop_scl_regs rk3288_win_full_scl = { static const struct vop_win_phy rk3288_win01_data = { .scl = &rk3288_win_full_scl, @@ -202,7 +202,7 @@ index 80053d91a301..2c55e1852c3d 100644 .rb_swap = VOP_REG(RK3288_WIN0_CTRL0, 0x1, 12), .act_info = VOP_REG(RK3288_WIN0_ACT_INFO, 0x1fff1fff, 0), .dsp_info = VOP_REG(RK3288_WIN0_DSP_INFO, 0x0fff0fff, 0), -@@ -713,11 +731,12 @@ static const struct vop_intr rk3368_vop_intr = { +@@ -718,11 +736,12 @@ static const struct vop_intr rk3368_vop_intr = { static const struct vop_win_phy rk3368_win01_data = { .scl = &rk3288_win_full_scl, @@ -217,7 +217,7 @@ index 80053d91a301..2c55e1852c3d 100644 .rb_swap = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 12), .x_mir_en = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 21), .y_mir_en = VOP_REG(RK3368_WIN0_CTRL0, 0x1, 22), -@@ -862,11 +881,12 @@ static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = { +@@ -867,11 +886,12 @@ static const struct vop_win_yuv2yuv_data rk3399_vop_big_win_yuv2yuv_data[] = { static const struct vop_win_phy rk3399_win01_data = { .scl = &rk3288_win_full_scl, @@ -257,10 +257,10 @@ Signed-off-by: Qinglang Miao 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/cdn-dp-core.c b/drivers/gpu/drm/rockchip/cdn-dp-core.c -index a4a45daf93f2..9b4406191470 100644 +index 6802d9b65f82..acf554c6e559 100644 --- a/drivers/gpu/drm/rockchip/cdn-dp-core.c +++ b/drivers/gpu/drm/rockchip/cdn-dp-core.c -@@ -98,7 +98,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp) +@@ -99,7 +99,7 @@ static int cdn_dp_clk_enable(struct cdn_dp_device *dp) goto err_core_clk; } @@ -294,7 +294,7 @@ Signed-off-by: Qinglang Miao 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index eb663e25ad9e..c6c76e8ab66c 100644 +index b149f0ab5201..35a056e2c49b 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -602,7 +602,7 @@ static int vop_enable(struct drm_crtc *crtc, struct drm_crtc_state *old_state) @@ -306,7 +306,7 @@ index eb663e25ad9e..c6c76e8ab66c 100644 if (ret < 0) { DRM_DEV_ERROR(vop->dev, "failed to get pm runtime: %d\n", ret); return ret; -@@ -1933,7 +1933,7 @@ static int vop_initial(struct vop *vop) +@@ -1934,7 +1934,7 @@ static int vop_initial(struct vop *vop) return PTR_ERR(vop->dclk); } @@ -340,7 +340,7 @@ Signed-off-by: Qinglang Miao 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_lvds.c b/drivers/gpu/drm/rockchip/rockchip_lvds.c -index 41edd0a421b2..4d463d50a63a 100644 +index 7c20b4a24a7e..b5311c99a0e1 100644 --- a/drivers/gpu/drm/rockchip/rockchip_lvds.c +++ b/drivers/gpu/drm/rockchip/rockchip_lvds.c @@ -145,7 +145,7 @@ static int rk3288_lvds_poweron(struct rockchip_lvds *lvds) diff --git a/projects/Rockchip/patches/linux/default/linux-1001-drm-rockchip.patch b/projects/Rockchip/patches/linux/default/linux-1000-drm-rockchip.patch similarity index 97% rename from projects/Rockchip/patches/linux/default/linux-1001-drm-rockchip.patch rename to projects/Rockchip/patches/linux/default/linux-1000-drm-rockchip.patch index 5c159a9078..2e33056017 100644 --- a/projects/Rockchip/patches/linux/default/linux-1001-drm-rockchip.patch +++ b/projects/Rockchip/patches/linux/default/linux-1000-drm-rockchip.patch @@ -13,10 +13,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index c6c76e8ab66c..2f98a5e7dce1 100644 +index 35a056e2c49b..67626bfde556 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1554,7 +1554,11 @@ static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) +@@ -1555,7 +1555,11 @@ static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc) { struct rockchip_crtc_state *rockchip_state; @@ -47,10 +47,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 54 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index 2f98a5e7dce1..defa314a8f96 100644 +index 67626bfde556..36a87a9a9216 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1167,6 +1167,59 @@ static void vop_crtc_disable_vblank(struct drm_crtc *crtc) +@@ -1168,6 +1168,59 @@ static void vop_crtc_disable_vblank(struct drm_crtc *crtc) spin_unlock_irqrestore(&vop->irq_lock, flags); } @@ -110,7 +110,7 @@ index 2f98a5e7dce1..defa314a8f96 100644 static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, const struct drm_display_mode *mode, struct drm_display_mode *adjusted_mode) -@@ -1537,6 +1590,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, +@@ -1538,6 +1591,7 @@ static void vop_crtc_atomic_flush(struct drm_crtc *crtc, } static const struct drm_crtc_helper_funcs vop_crtc_helper_funcs = { @@ -133,10 +133,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index defa314a8f96..a9e6e8bdc848 100644 +index 36a87a9a9216..6600658a2f45 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1205,6 +1205,9 @@ static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, +@@ -1206,6 +1206,9 @@ static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, if (!vop_crtc_is_tmds(crtc)) return MODE_OK; @@ -183,10 +183,10 @@ index b7169010622a..0b1984585082 100644 #define VOP_FEATURE_OUTPUT_RGB10 BIT(0) #define VOP_FEATURE_INTERNAL_RGB BIT(1) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index 2c55e1852c3d..cf87361108a0 100644 +index c78b711765fd..e8b0cc4dc99d 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -@@ -700,6 +700,7 @@ static const struct vop_intr rk3288_vop_intr = { +@@ -705,6 +705,7 @@ static const struct vop_intr rk3288_vop_intr = { static const struct vop_data rk3288_vop = { .version = VOP_VERSION(3, 1), .feature = VOP_FEATURE_OUTPUT_RGB10, @@ -194,7 +194,7 @@ index 2c55e1852c3d..cf87361108a0 100644 .intr = &rk3288_vop_intr, .common = &rk3288_common, .modeset = &rk3288_modeset, -@@ -801,6 +802,7 @@ static const struct vop_misc rk3368_misc = { +@@ -806,6 +807,7 @@ static const struct vop_misc rk3368_misc = { static const struct vop_data rk3368_vop = { .version = VOP_VERSION(3, 2), @@ -202,7 +202,7 @@ index 2c55e1852c3d..cf87361108a0 100644 .intr = &rk3368_vop_intr, .common = &rk3288_common, .modeset = &rk3288_modeset, -@@ -822,6 +824,7 @@ static const struct vop_intr rk3366_vop_intr = { +@@ -827,6 +829,7 @@ static const struct vop_intr rk3366_vop_intr = { static const struct vop_data rk3366_vop = { .version = VOP_VERSION(3, 4), @@ -210,7 +210,7 @@ index 2c55e1852c3d..cf87361108a0 100644 .intr = &rk3366_vop_intr, .common = &rk3288_common, .modeset = &rk3288_modeset, -@@ -929,6 +932,7 @@ static const struct vop_afbc rk3399_vop_afbc = { +@@ -934,6 +937,7 @@ static const struct vop_afbc rk3399_vop_afbc = { static const struct vop_data rk3399_vop_big = { .version = VOP_VERSION(3, 5), .feature = VOP_FEATURE_OUTPUT_RGB10, @@ -218,7 +218,7 @@ index 2c55e1852c3d..cf87361108a0 100644 .intr = &rk3366_vop_intr, .common = &rk3288_common, .modeset = &rk3288_modeset, -@@ -955,6 +959,7 @@ static const struct vop_win_yuv2yuv_data rk3399_vop_lit_win_yuv2yuv_data[] = { +@@ -960,6 +964,7 @@ static const struct vop_win_yuv2yuv_data rk3399_vop_lit_win_yuv2yuv_data[] = { static const struct vop_data rk3399_vop_lit = { .version = VOP_VERSION(3, 6), @@ -226,7 +226,7 @@ index 2c55e1852c3d..cf87361108a0 100644 .intr = &rk3366_vop_intr, .common = &rk3288_common, .modeset = &rk3288_modeset, -@@ -975,6 +980,7 @@ static const struct vop_win_data rk3228_vop_win_data[] = { +@@ -980,6 +985,7 @@ static const struct vop_win_data rk3228_vop_win_data[] = { static const struct vop_data rk3228_vop = { .version = VOP_VERSION(3, 7), .feature = VOP_FEATURE_OUTPUT_RGB10, @@ -234,7 +234,7 @@ index 2c55e1852c3d..cf87361108a0 100644 .intr = &rk3366_vop_intr, .common = &rk3288_common, .modeset = &rk3288_modeset, -@@ -1046,6 +1052,7 @@ static const struct vop_win_data rk3328_vop_win_data[] = { +@@ -1051,6 +1057,7 @@ static const struct vop_win_data rk3328_vop_win_data[] = { static const struct vop_data rk3328_vop = { .version = VOP_VERSION(3, 8), .feature = VOP_FEATURE_OUTPUT_RGB10, @@ -256,10 +256,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 16 insertions(+) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index a9e6e8bdc848..bf44282409ab 100644 +index 6600658a2f45..bae495f80376 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1199,6 +1199,7 @@ static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, +@@ -1200,6 +1200,7 @@ static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, const struct drm_display_mode *mode) { struct vop *vop = to_vop(crtc); @@ -267,7 +267,7 @@ index a9e6e8bdc848..bf44282409ab 100644 long rounded_rate; long lowest, highest; -@@ -1220,6 +1221,10 @@ static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, +@@ -1221,6 +1222,10 @@ static enum drm_mode_status vop_crtc_mode_valid(struct drm_crtc *crtc, if (rounded_rate > highest) return MODE_CLOCK_HIGH; @@ -278,7 +278,7 @@ index a9e6e8bdc848..bf44282409ab 100644 return MODE_OK; } -@@ -1228,8 +1233,19 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, +@@ -1229,8 +1234,19 @@ static bool vop_crtc_mode_fixup(struct drm_crtc *crtc, struct drm_display_mode *adjusted_mode) { struct vop *vop = to_vop(crtc); @@ -846,10 +846,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index cf87361108a0..05ade8ea962f 100644 +index e8b0cc4dc99d..4a991d87f00e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -@@ -697,7 +697,7 @@ static const struct vop_intr rk3288_vop_intr = { +@@ -702,7 +702,7 @@ static const struct vop_intr rk3288_vop_intr = { .clear = VOP_REG(RK3288_INTR_CTRL0, 0xf, 8), }; @@ -858,7 +858,7 @@ index cf87361108a0..05ade8ea962f 100644 .version = VOP_VERSION(3, 1), .feature = VOP_FEATURE_OUTPUT_RGB10, .max_output = { 3840, 2160 }, -@@ -710,6 +710,19 @@ static const struct vop_data rk3288_vop = { +@@ -715,6 +715,19 @@ static const struct vop_data rk3288_vop = { .lut_size = 1024, }; @@ -878,7 +878,7 @@ index cf87361108a0..05ade8ea962f 100644 static const int rk3368_vop_intrs[] = { FS_INTR, 0, 0, -@@ -1075,8 +1088,10 @@ static const struct of_device_id vop_driver_dt_match[] = { +@@ -1080,8 +1093,10 @@ static const struct of_device_id vop_driver_dt_match[] = { .data = &rk3066_vop }, { .compatible = "rockchip,rk3188-vop", .data = &rk3188_vop }, @@ -903,7 +903,7 @@ Signed-off-by: Jonas Karlman 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi -index 01ea1f170f77..3575dea1ee29 100644 +index 94f691f16944..1c62775f5b3c 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -1037,7 +1037,7 @@ rga: rga@ff920000 { @@ -1501,10 +1501,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 4 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index bf44282409ab..25b89ddb446d 100644 +index bae495f80376..8377b84cd9ca 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1854,19 +1854,10 @@ static int vop_create_crtc(struct vop *vop) +@@ -1855,19 +1855,10 @@ static int vop_create_crtc(struct vop *vop) int ret; int i; @@ -1524,7 +1524,7 @@ index bf44282409ab..25b89ddb446d 100644 ret = drm_universal_plane_init(vop->drm_dev, &vop_win->base, 0, &vop_plane_funcs, win_data->phy->data_formats, -@@ -1899,32 +1890,13 @@ static int vop_create_crtc(struct vop *vop) +@@ -1900,32 +1891,13 @@ static int vop_create_crtc(struct vop *vop) drm_crtc_enable_color_mgmt(crtc, 0, false, vop_data->lut_size); } @@ -1587,10 +1587,10 @@ index 3aa37e177667..a2b59faa9184 100644 dev->mode_config.helper_private = &rockchip_mode_config_helpers; } diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index 25b89ddb446d..74d7e474bf89 100644 +index 8377b84cd9ca..7a568681f9f4 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1831,7 +1831,7 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1832,7 +1832,7 @@ static irqreturn_t vop_isr(int irq, void *data) return ret; } @@ -1599,7 +1599,7 @@ index 25b89ddb446d..74d7e474bf89 100644 const struct vop_win_data *win_data) { unsigned int flags = 0; -@@ -1841,6 +1841,8 @@ static void vop_plane_add_properties(struct drm_plane *plane, +@@ -1842,6 +1842,8 @@ static void vop_plane_add_properties(struct drm_plane *plane, if (flags) drm_plane_create_rotation_property(plane, DRM_MODE_ROTATE_0, DRM_MODE_ROTATE_0 | flags); @@ -1608,7 +1608,7 @@ index 25b89ddb446d..74d7e474bf89 100644 } static int vop_create_crtc(struct vop *vop) -@@ -1872,7 +1874,7 @@ static int vop_create_crtc(struct vop *vop) +@@ -1873,7 +1875,7 @@ static int vop_create_crtc(struct vop *vop) plane = &vop_win->base; drm_plane_helper_add(plane, &plane_helper_funcs); @@ -1629,10 +1629,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index 74d7e474bf89..d8e0c5a4df01 100644 +index 7a568681f9f4..5a44569b53d6 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -@@ -1831,8 +1831,23 @@ static irqreturn_t vop_isr(int irq, void *data) +@@ -1832,8 +1832,23 @@ static irqreturn_t vop_isr(int irq, void *data) return ret; } @@ -1657,7 +1657,7 @@ index 74d7e474bf89..d8e0c5a4df01 100644 { unsigned int flags = 0; -@@ -1843,6 +1858,19 @@ static void vop_plane_add_properties(struct drm_plane *plane, int zpos, +@@ -1844,6 +1859,19 @@ static void vop_plane_add_properties(struct drm_plane *plane, int zpos, DRM_MODE_ROTATE_0 | flags); drm_plane_create_zpos_immutable_property(plane, zpos); @@ -1677,7 +1677,7 @@ index 74d7e474bf89..d8e0c5a4df01 100644 } static int vop_create_crtc(struct vop *vop) -@@ -1874,7 +1902,7 @@ static int vop_create_crtc(struct vop *vop) +@@ -1875,7 +1903,7 @@ static int vop_create_crtc(struct vop *vop) plane = &vop_win->base; drm_plane_helper_add(plane, &plane_helper_funcs); @@ -1703,7 +1703,7 @@ Signed-off-by: Jonas Karlman 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi -index 3575dea1ee29..03e86d012edd 100644 +index 1c62775f5b3c..5b65874525cd 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -1046,6 +1046,8 @@ vopb: vop@ff930000 { @@ -1947,7 +1947,7 @@ Subject: [PATCH] HACK: dts: rockchip: do not use vopl for hdmi 2 files changed, 18 deletions(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi -index 03e86d012edd..746acfac1e92 100644 +index 5b65874525cd..61d97fb22be9 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -1104,11 +1104,6 @@ vopl_out: port { @@ -1974,7 +1974,7 @@ index 03e86d012edd..746acfac1e92 100644 }; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index 2551b238b97c..ea1ef6c7455a 100644 +index 7cc4a0267f46..dc21f5451fcd 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -1639,11 +1639,6 @@ vopl_out_edp: endpoint@1 { @@ -2490,7 +2490,7 @@ index 43ad0278fad1..c8eaeb484672 100644 static const struct dw_hdmi_plat_data rk3328_hdmi_drv_data = { diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index d8e0c5a4df01..9fde1c27072b 100644 +index 5a44569b53d6..d09c55aa2c55 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -325,6 +325,17 @@ static int vop_convert_afbc_format(uint32_t format) @@ -2511,7 +2511,7 @@ index d8e0c5a4df01..9fde1c27072b 100644 static uint16_t scl_vop_cal_scale(enum scale_mode mode, uint32_t src, uint32_t dst, bool is_horizontal, int vsu_mode, int *vskiplines) -@@ -1375,6 +1386,7 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -1376,6 +1387,7 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, u16 vact_end = vact_st + vdisplay; uint32_t pin_pol, val; int dither_bpc = s->output_bpc ? s->output_bpc : 10; @@ -2519,7 +2519,7 @@ index d8e0c5a4df01..9fde1c27072b 100644 int ret; if (old_state && old_state->self_refresh_active) { -@@ -1448,6 +1460,8 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -1449,6 +1461,8 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, !(vop_data->feature & VOP_FEATURE_OUTPUT_RGB10)) s->output_mode = ROCKCHIP_OUT_MODE_P888; @@ -2528,7 +2528,7 @@ index d8e0c5a4df01..9fde1c27072b 100644 if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA && dither_bpc <= 8) VOP_REG_SET(vop, common, pre_dither_down, 1); else -@@ -1463,6 +1477,21 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -1464,6 +1478,21 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, VOP_REG_SET(vop, common, out_mode, s->output_mode); @@ -2572,10 +2572,10 @@ index 0b1984585082..72dd670bf2a7 100644 struct vop_intr { diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index 05ade8ea962f..f276ef4b3f64 100644 +index 4a991d87f00e..3b87288cca1c 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -@@ -662,6 +662,11 @@ static const struct vop_common rk3288_common = { +@@ -667,6 +667,11 @@ static const struct vop_common rk3288_common = { .dsp_blank = VOP_REG(RK3288_DSP_CTRL0, 0x3, 18), .out_mode = VOP_REG(RK3288_DSP_CTRL0, 0xf, 0), .cfg_done = VOP_REG_SYNC(RK3288_REG_CFG_DONE, 0x1, 0), @@ -2587,7 +2587,7 @@ index 05ade8ea962f..f276ef4b3f64 100644 }; /* -@@ -1029,6 +1034,10 @@ static const struct vop_output rk3328_output = { +@@ -1034,6 +1039,10 @@ static const struct vop_output rk3328_output = { static const struct vop_misc rk3328_misc = { .global_regdone_en = VOP_REG(RK3328_SYS_CTRL, 0x1, 11), @@ -2598,7 +2598,7 @@ index 05ade8ea962f..f276ef4b3f64 100644 }; static const struct vop_common rk3328_common = { -@@ -1041,6 +1050,11 @@ static const struct vop_common rk3328_common = { +@@ -1046,6 +1055,11 @@ static const struct vop_common rk3328_common = { .dsp_blank = VOP_REG(RK3328_DSP_CTRL0, 0x3, 18), .out_mode = VOP_REG(RK3328_DSP_CTRL0, 0xf, 0), .cfg_done = VOP_REG_SYNC(RK3328_REG_CFG_DONE, 0x1, 0), @@ -2688,7 +2688,7 @@ index c8eaeb484672..9fe690570e3d 100644 static struct rockchip_hdmi_chip_data rk3399_chip_data = { diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index 9fde1c27072b..4d855724e1dd 100644 +index d09c55aa2c55..48cd667eead6 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -326,6 +326,19 @@ static int vop_convert_afbc_format(uint32_t format) @@ -2711,7 +2711,7 @@ index 9fde1c27072b..4d855724e1dd 100644 { switch (bus_format) { case MEDIA_BUS_FMT_YUV8_1X24: -@@ -1460,7 +1473,7 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -1461,7 +1474,7 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, !(vop_data->feature & VOP_FEATURE_OUTPUT_RGB10)) s->output_mode = ROCKCHIP_OUT_MODE_P888; @@ -2720,7 +2720,7 @@ index 9fde1c27072b..4d855724e1dd 100644 if (s->output_mode == ROCKCHIP_OUT_MODE_AAAA && dither_bpc <= 8) VOP_REG_SET(vop, common, pre_dither_down, 1); -@@ -1477,6 +1490,9 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, +@@ -1478,6 +1491,9 @@ static void vop_crtc_atomic_enable(struct drm_crtc *crtc, VOP_REG_SET(vop, common, out_mode, s->output_mode); @@ -2760,10 +2760,10 @@ index 72dd670bf2a7..a997578e174a 100644 /* output flags */ #define ROCKCHIP_OUTPUT_DSI_DUAL BIT(0) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index f276ef4b3f64..8c99cc2a7eda 100644 +index 3b87288cca1c..60ff2f7fd9ac 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -@@ -664,6 +664,7 @@ static const struct vop_common rk3288_common = { +@@ -669,6 +669,7 @@ static const struct vop_common rk3288_common = { .cfg_done = VOP_REG_SYNC(RK3288_REG_CFG_DONE, 0x1, 0), .overlay_mode = VOP_REG(RK3288_SYS_CTRL, 0x1, 16), @@ -2771,7 +2771,7 @@ index f276ef4b3f64..8c99cc2a7eda 100644 .dsp_data_swap = VOP_REG(RK3288_DSP_CTRL0, 0x1f, 12), .dsp_out_yuv = VOP_REG(RK3288_POST_SCL_CTRL, 0x1, 2), .dsp_background = VOP_REG(RK3288_DSP_BG, 0xffffffff, 0), -@@ -1052,6 +1053,7 @@ static const struct vop_common rk3328_common = { +@@ -1057,6 +1058,7 @@ static const struct vop_common rk3328_common = { .cfg_done = VOP_REG_SYNC(RK3328_REG_CFG_DONE, 0x1, 0), .overlay_mode = VOP_REG(RK3328_SYS_CTRL, 0x1, 16), @@ -2874,10 +2874,10 @@ Subject: [PATCH] !fixup drm/rockchip: rk3368's vop does not support 10-bit 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index 8c99cc2a7eda..9ca9fff0d359 100644 +index 60ff2f7fd9ac..f791d8504dba 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -@@ -751,8 +751,8 @@ static const struct vop_intr rk3368_vop_intr = { +@@ -756,8 +756,8 @@ static const struct vop_intr rk3368_vop_intr = { static const struct vop_win_phy rk3368_win01_data = { .scl = &rk3288_win_full_scl, @@ -2900,10 +2900,10 @@ Signed-off-by: Alex Bee 1 file changed, 27 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -index 9ca9fff0d359..e34482c3d2be 100644 +index f791d8504dba..af6fe3687f09 100644 --- a/drivers/gpu/drm/rockchip/rockchip_vop_reg.c +++ b/drivers/gpu/drm/rockchip/rockchip_vop_reg.c -@@ -1069,12 +1069,36 @@ static const struct vop_intr rk3328_vop_intr = { +@@ -1074,12 +1074,36 @@ static const struct vop_intr rk3328_vop_intr = { .clear = VOP_REG_MASK_SYNC(RK3328_INTR_CLEAR0, 0xffff, 0), }; @@ -2954,7 +2954,7 @@ Subject: [PATCH] rockchip: vop: force skip lines if image too big 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index 4d855724e1dd..5622ffd1b587 100644 +index 48cd667eead6..15c6259820c2 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -932,6 +932,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane, @@ -3014,7 +3014,7 @@ Signed-off-by: Jonas Karlman 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index d327fd300116..31c48c38c955 100644 +index 169a8064673d..8b76a7b16f00 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -805,8 +805,8 @@ cru: clock-controller@ff440000 { @@ -3488,7 +3488,7 @@ index a612bf3da9ee..e4cfa6adbd87 100644 static void diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c -index 5622ffd1b587..a0d27a9a9675 100644 +index 15c6259820c2..b44f6f4b2a9e 100644 --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c @@ -401,8 +401,8 @@ static void scl_vop_cal_scl_fac(struct vop *vop, const struct vop_win_data *win, diff --git a/projects/Rockchip/patches/linux/default/linux-1002-v4l2-rockchip.patch b/projects/Rockchip/patches/linux/default/linux-1001-v4l2-rockchip.patch similarity index 96% rename from projects/Rockchip/patches/linux/default/linux-1002-v4l2-rockchip.patch rename to projects/Rockchip/patches/linux/default/linux-1001-v4l2-rockchip.patch index b6e8d01e2c..0e33f0bfd2 100644 --- a/projects/Rockchip/patches/linux/default/linux-1002-v4l2-rockchip.patch +++ b/projects/Rockchip/patches/linux/default/linux-1001-v4l2-rockchip.patch @@ -10,10 +10,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 9492822c12ae..b49541f8ecf5 100644 +index 539b0c5efdcc..e3615c4125a8 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c -@@ -1024,7 +1024,8 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv) +@@ -1032,7 +1032,8 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv) state = (status & RKVDEC_RDY_STA) ? VB2_BUF_STATE_DONE : VB2_BUF_STATE_ERROR; @@ -23,7 +23,7 @@ index 9492822c12ae..b49541f8ecf5 100644 if (cancel_delayed_work(&rkvdec->watchdog_work)) { struct rkvdec_ctx *ctx; -@@ -1045,7 +1046,8 @@ static void rkvdec_watchdog_func(struct work_struct *work) +@@ -1053,7 +1054,8 @@ static void rkvdec_watchdog_func(struct work_struct *work) ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); if (ctx) { dev_err(rkvdec->dev, "Frame processing timed out!\n"); @@ -46,10 +46,10 @@ Signed-off-by: Jonas Karlman 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index b49541f8ecf5..51e257a0233d 100644 +index e3615c4125a8..e5842aa83225 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c -@@ -1145,9 +1145,9 @@ static int rkvdec_remove(struct platform_device *pdev) +@@ -1153,9 +1153,9 @@ static int rkvdec_remove(struct platform_device *pdev) { struct rkvdec_dev *rkvdec = platform_get_drvdata(pdev); @@ -712,7 +712,7 @@ index 15b9bee92016..3acc914888f6 100644 #define RKVDEC_REG_SYSCTRL 0x008 #define RKVDEC_IN_ENDIAN BIT(0) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 51e257a0233d..c05ba31ed656 100644 +index e5842aa83225..b4c3f4f7baac 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -10,12 +10,15 @@ @@ -731,7 +731,7 @@ index 51e257a0233d..c05ba31ed656 100644 #include #include #include -@@ -725,6 +728,11 @@ static void rkvdec_job_finish(struct rkvdec_ctx *ctx, +@@ -733,6 +736,11 @@ static void rkvdec_job_finish(struct rkvdec_ctx *ctx, pm_runtime_mark_last_busy(rkvdec->dev); pm_runtime_put_autosuspend(rkvdec->dev); @@ -743,7 +743,7 @@ index 51e257a0233d..c05ba31ed656 100644 rkvdec_job_finish_no_pm(ctx, result); } -@@ -762,6 +770,33 @@ static void rkvdec_device_run(void *priv) +@@ -770,6 +778,33 @@ static void rkvdec_device_run(void *priv) if (WARN_ON(!desc)) return; @@ -775,9 +775,9 @@ index 51e257a0233d..c05ba31ed656 100644 + pm_runtime_suspend(rkvdec->dev); + } - ret = pm_runtime_get_sync(rkvdec->dev); + ret = pm_runtime_resume_and_get(rkvdec->dev); if (ret < 0) { -@@ -1029,6 +1064,11 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv) +@@ -1037,6 +1072,11 @@ static irqreturn_t rkvdec_irq_handler(int irq, void *priv) if (cancel_delayed_work(&rkvdec->watchdog_work)) { struct rkvdec_ctx *ctx; @@ -789,7 +789,7 @@ index 51e257a0233d..c05ba31ed656 100644 ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); rkvdec_job_finish(ctx, state); } -@@ -1046,6 +1086,7 @@ static void rkvdec_watchdog_func(struct work_struct *work) +@@ -1054,6 +1094,7 @@ static void rkvdec_watchdog_func(struct work_struct *work) ctx = v4l2_m2m_get_curr_priv(rkvdec->m2m_dev); if (ctx) { dev_err(rkvdec->dev, "Frame processing timed out!\n"); @@ -797,7 +797,7 @@ index 51e257a0233d..c05ba31ed656 100644 writel(RKVDEC_CONFIG_DEC_CLK_GATE_E | RKVDEC_IRQ_DIS, rkvdec->regs + RKVDEC_REG_INTERRUPT); writel(0, rkvdec->regs + RKVDEC_REG_SYSCTRL); -@@ -1125,6 +1166,18 @@ static int rkvdec_probe(struct platform_device *pdev) +@@ -1133,6 +1174,18 @@ static int rkvdec_probe(struct platform_device *pdev) return ret; } @@ -866,11 +866,11 @@ Subject: [PATCH] WIP: arm64: dts: add resets to vdec for RK3399 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index ea1ef6c7455a..92e3f6da0297 100644 +index dc21f5451fcd..da09403a6860 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -@@ -1022,7 +1022,10 @@ pd_vcodec@RK3399_PD_VCODEC { - pd_vdu@RK3399_PD_VDU { +@@ -1022,7 +1022,10 @@ power-domain@RK3399_PD_VCODEC { + power-domain@RK3399_PD_VDU { reg = ; clocks = <&cru ACLK_VDU>, - <&cru HCLK_VDU>; @@ -905,7 +905,7 @@ Signed-off-by: Alex Bee 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index 92e3f6da0297..03c6737ca0ea 100644 +index da09403a6860..59b69f069b0c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -1279,7 +1279,7 @@ vpu_mmu: iommu@ff650800 { @@ -946,19 +946,19 @@ index dfafdb671798..360b750e5514 100644 reg: maxItems: 1 diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index 31c48c38c955..bd0ec27cf49b 100644 +index 8b76a7b16f00..ee539487dfc7 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -326,6 +326,10 @@ pd_hevc@RK3328_PD_HEVC { +@@ -326,6 +326,10 @@ power-domain@RK3328_PD_HEVC { }; - pd_video@RK3328_PD_VIDEO { + power-domain@RK3328_PD_VIDEO { reg = ; + clocks = <&cru ACLK_RKVDEC>, + <&cru HCLK_RKVDEC>, + <&cru SCLK_VDEC_CABAC>, + <&cru SCLK_VDEC_CORE>; }; - pd_vpu@RK3328_PD_VPU { + power-domain@RK3328_PD_VPU { reg = ; @@ -670,6 +674,26 @@ vpu_mmu: iommu@ff350800 { power-domains = <&power RK3328_PD_VPU>; @@ -1008,10 +1008,10 @@ Signed-off-by: Alex Bee 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index c05ba31ed656..4111155d62f4 100644 +index b4c3f4f7baac..7df90a03e7d4 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c -@@ -1134,10 +1134,12 @@ static int rkvdec_probe(struct platform_device *pdev) +@@ -1142,10 +1142,12 @@ static int rkvdec_probe(struct platform_device *pdev) return ret; /* diff --git a/projects/Rockchip/patches/linux/default/linux-1003-for-libreelec.patch b/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch similarity index 98% rename from projects/Rockchip/patches/linux/default/linux-1003-for-libreelec.patch rename to projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch index ed11c9bfea..1c605e1800 100644 --- a/projects/Rockchip/patches/linux/default/linux-1003-for-libreelec.patch +++ b/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch @@ -14,7 +14,7 @@ Signed-off-by: Alex Bee 1 file changed, 33 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index bd0ec27cf49b..21e32ddb21a0 100644 +index ee539487dfc7..da54409aa50c 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -321,6 +321,10 @@ power: power-controller { @@ -84,11 +84,11 @@ Signed-off-by: Alex Bee 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index 21e32ddb21a0..18d663aacd07 100644 +index da54409aa50c..0c6e35ef77b9 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -@@ -1109,6 +1109,20 @@ usbdrd_dwc3: dwc3@ff600000 { - }; +@@ -1063,6 +1063,20 @@ usbdrd3: usb@ff600000 { + status = "disabled"; }; + sdmmc_ext: dwmmc@ff5f0000 { @@ -183,7 +183,7 @@ index 9c1e38c54eae..ee332fc9cf1f 100644 simple-audio-card,codec { diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index 03c6737ca0ea..9c2ac03c154b 100644 +index 59b69f069b0c..215b37ee5aaa 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -1782,7 +1782,7 @@ hdmi_sound: hdmi-sound { @@ -379,7 +379,7 @@ Signed-off-by: Alex Bee 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -index 3ac876c08d61..8607514437f5 100644 +index 7d9481962f51..b6542d3fb311 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts @@ -161,6 +161,10 @@ &gmac2io { @@ -394,7 +394,7 @@ index 3ac876c08d61..8607514437f5 100644 status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts -index 89fde87f7650..bd62349a9390 100644 +index ecf3fcf24ff3..49582172d49b 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-rock64.dts @@ -157,6 +157,10 @@ &gmac2io { @@ -409,7 +409,7 @@ index 89fde87f7650..bd62349a9390 100644 status = "okay"; }; diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index 18d663aacd07..0e5e492db9c7 100644 +index 0c6e35ef77b9..1cfd35372c4a 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -619,7 +619,7 @@ saradc: adc@ff280000 { @@ -463,7 +463,7 @@ Signed-off-by: Alex Bee 2 files changed, 46 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts -index 4013f16bb368..1bb3f4a6e496 100644 +index 37f307cfa4cc..68f7c76a3a56 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts @@ -52,6 +52,24 @@ ir-receiver { @@ -504,7 +504,7 @@ index 4013f16bb368..1bb3f4a6e496 100644 rockchip,hw-tshut-mode = <0>; rockchip,hw-tshut-polarity = <0>; diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -index 8607514437f5..6ca08854aef3 100644 +index b6542d3fb311..9826d0f574f8 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts @@ -102,6 +102,24 @@ user_led: led-1 { @@ -556,7 +556,7 @@ Signed-off-by: Alex Bee 1 file changed, 14 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts -index 6ca08854aef3..fb21ad1324bc 100644 +index 9826d0f574f8..ea5b606f2dde 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts @@ -83,6 +83,13 @@ vcc_phy: vcc-phy-regulator { @@ -621,7 +621,7 @@ Subject: [PATCH] HACK: arm64: dts: enable FE phy for Beelink A1 also 1 file changed, 8 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts -index 1bb3f4a6e496..99f28dac0791 100644 +index 68f7c76a3a56..47520938d3a3 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328-a1.dts +++ b/arch/arm64/boot/dts/rockchip/rk3328-a1.dts @@ -142,6 +142,14 @@ rtl8211f: ethernet-phy@0 { @@ -714,7 +714,7 @@ Signed-off-by: Alex Bee 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index 9c2ac03c154b..b1c7ee80d255 100644 +index 215b37ee5aaa..ad72d1796542 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -1390,7 +1390,7 @@ cru: clock-controller@ff760000 { diff --git a/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch b/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch index d8b5058087..bc80ee1923 100644 --- a/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch +++ b/projects/Rockchip/patches/linux/default/linux-2000-v4l-wip-rkvdec-vp9.patch @@ -38,7 +38,7 @@ index 7869b6f6ff72..6b4a83b053f5 100644 + +:author: Adrian Grange (Google), Peter de Rivaz (Argon Design), Jonathan Hunt (Argon Design) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst -index ce728c757eaf..456488f2b5ca 100644 +index b864869b42bc..3217c5fc421a 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -2730,6 +2730,556 @@ enum v4l2_mpeg_video_h264_hierarchical_coding_type - @@ -3023,7 +3023,7 @@ index 000000000000..8b443ed511c9 + .done = rkvdec_vp9_done, +}; diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index c4e0ec16c285..f3578c5ea902 100644 +index 7df90a03e7d4..81a14db30285 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -162,6 +162,40 @@ static const u32 rkvdec_h264_decoded_fmts[] = { diff --git a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch index cb746a6920..7a555e6b27 100644 --- a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch +++ b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch @@ -14,10 +14,10 @@ Signed-off-by: Jernej Skrabec 4 files changed, 63 insertions(+) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst -index 456488f2b5ca..81529b1d8d69 100644 +index 3217c5fc421a..4a98be158beb 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst -@@ -4866,6 +4866,47 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - +@@ -4869,6 +4869,47 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - - ``padding[6]`` - Applications and drivers must set this to zero. @@ -120,7 +120,7 @@ index 7ed11f296008..a2609de88d26 100644 elem_size = sizeof(struct v4l2_area); break; diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h -index 1009cf0891cc..1592e52c3614 100644 +index a3b650ab00f6..3cf7da003cd9 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -19,6 +19,7 @@ @@ -139,7 +139,7 @@ index 1009cf0891cc..1592e52c3614 100644 enum v4l2_mpeg_video_hevc_decode_mode { V4L2_MPEG_VIDEO_HEVC_DECODE_MODE_SLICE_BASED, -@@ -209,4 +211,13 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -210,4 +212,13 @@ struct v4l2_ctrl_hevc_slice_params { __u64 flags; }; @@ -171,7 +171,7 @@ Signed-off-by: Jernej Skrabec 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst -index 81529b1d8d69..817773791888 100644 +index 4a98be158beb..206716fa9792 100644 --- a/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst +++ b/Documentation/userspace-api/media/v4l/ext-ctrls-codec.rst @@ -4661,6 +4661,9 @@ enum v4l2_mpeg_video_hevc_size_of_length_field - @@ -194,10 +194,10 @@ index 81529b1d8d69..817773791888 100644 * - struct :c:type:`v4l2_hevc_dpb_entry` - ``dpb[V4L2_HEVC_DPB_ENTRIES_NUM_MAX]`` diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h -index 1592e52c3614..3e2e32098312 100644 +index 3cf7da003cd9..ffc701e268eb 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h -@@ -167,6 +167,9 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -168,6 +168,9 @@ struct v4l2_ctrl_hevc_slice_params { __u32 bit_size; __u32 data_bit_offset; @@ -207,7 +207,7 @@ index 1592e52c3614..3e2e32098312 100644 /* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */ __u8 nal_unit_type; __u8 nuh_temporal_id_plus1; -@@ -200,7 +203,7 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -201,7 +204,7 @@ struct v4l2_ctrl_hevc_slice_params { __u8 num_rps_poc_st_curr_after; __u8 num_rps_poc_lt_curr; @@ -230,7 +230,7 @@ Signed-off-by: Jonas Karlman 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h -index 3e2e32098312..3cc3b47e1417 100644 +index ffc701e268eb..632f7b4357be 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -56,6 +56,9 @@ enum v4l2_mpeg_video_hevc_start_code { @@ -274,7 +274,7 @@ index 3e2e32098312..3cc3b47e1417 100644 __u64 flags; }; -@@ -203,7 +208,10 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -204,7 +209,10 @@ struct v4l2_ctrl_hevc_slice_params { __u8 num_rps_poc_st_curr_after; __u8 num_rps_poc_lt_curr; @@ -297,7 +297,7 @@ Subject: [PATCH] HACK: media: uapi: hevc: tiles and num_slices 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/media/hevc-ctrls.h b/include/media/hevc-ctrls.h -index 3cc3b47e1417..b33e1a8141e1 100644 +index 632f7b4357be..10a4296ac219 100644 --- a/include/media/hevc-ctrls.h +++ b/include/media/hevc-ctrls.h @@ -80,7 +80,8 @@ struct v4l2_ctrl_hevc_sps { @@ -310,7 +310,7 @@ index 3cc3b47e1417..b33e1a8141e1 100644 __u64 flags; }; -@@ -174,6 +175,7 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -175,6 +176,7 @@ struct v4l2_ctrl_hevc_slice_params { /* ISO/IEC 23008-2, ITU-T Rec. H.265: General slice segment header */ __u32 slice_segment_addr; @@ -318,7 +318,7 @@ index 3cc3b47e1417..b33e1a8141e1 100644 /* ISO/IEC 23008-2, ITU-T Rec. H.265: NAL unit header */ __u8 nal_unit_type; -@@ -211,7 +213,9 @@ struct v4l2_ctrl_hevc_slice_params { +@@ -212,7 +214,9 @@ struct v4l2_ctrl_hevc_slice_params { __u16 short_term_ref_pic_set_size; __u16 long_term_ref_pic_set_size; @@ -359,7 +359,7 @@ index cb86b429cfaa..a77122641d14 100644 +rockchip-vdec-y += rkvdec.o rkvdec-h264.o rkvdec-hevc.o rkvdec-vp9.o diff --git a/drivers/staging/media/rkvdec/rkvdec-hevc.c b/drivers/staging/media/rkvdec/rkvdec-hevc.c new file mode 100644 -index 000000000000..03ba848411c6 +index 000000000000..c3cceba837c2 --- /dev/null +++ b/drivers/staging/media/rkvdec/rkvdec-hevc.c @@ -0,0 +1,2522 @@ @@ -2898,7 +2898,7 @@ index 3acc914888f6..4addfaefdfb4 100644 #define RKVDEC_MODE_VP9 2 #define RKVDEC_RPS_MODE BIT(24) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index f3578c5ea902..a44db1aa161e 100644 +index 81a14db30285..dd67e621f36f 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -162,6 +162,61 @@ static const u32 rkvdec_h264_decoded_fmts[] = { @@ -3009,7 +3009,7 @@ Subject: [PATCH] WIP: media: rkvdec: add HEVC format validation 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-hevc.c b/drivers/staging/media/rkvdec/rkvdec-hevc.c -index 03ba848411c6..b8ad7fc2271c 100644 +index c3cceba837c2..b9f7b931d028 100644 --- a/drivers/staging/media/rkvdec/rkvdec-hevc.c +++ b/drivers/staging/media/rkvdec/rkvdec-hevc.c @@ -2415,6 +2415,16 @@ static int rkvdec_hevc_adjust_fmt(struct rkvdec_ctx *ctx, @@ -3038,7 +3038,7 @@ index 03ba848411c6..b8ad7fc2271c 100644 .stop = rkvdec_hevc_stop, .run = rkvdec_hevc_run, diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index a44db1aa161e..7419ae7027ab 100644 +index dd67e621f36f..b0657ab2d029 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -79,6 +79,26 @@ static int rkvdec_try_ctrl(struct v4l2_ctrl *ctrl) @@ -3098,7 +3098,7 @@ Signed-off-by: Alex Bee 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-hevc.c b/drivers/staging/media/rkvdec/rkvdec-hevc.c -index b8ad7fc2271c..943f3f4a644a 100644 +index b9f7b931d028..8b1c9a38c487 100644 --- a/drivers/staging/media/rkvdec/rkvdec-hevc.c +++ b/drivers/staging/media/rkvdec/rkvdec-hevc.c @@ -2164,9 +2164,9 @@ static void assemble_hw_pps(struct rkvdec_ctx *ctx, @@ -3125,7 +3125,7 @@ Signed-off-by: Alex Bee 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-hevc.c b/drivers/staging/media/rkvdec/rkvdec-hevc.c -index 943f3f4a644a..93b4e09e5bf1 100644 +index 8b1c9a38c487..e5283c598798 100644 --- a/drivers/staging/media/rkvdec/rkvdec-hevc.c +++ b/drivers/staging/media/rkvdec/rkvdec-hevc.c @@ -2194,8 +2194,8 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx, @@ -3164,10 +3164,10 @@ Subject: [PATCH] WIP: media: rkvdec: hevc: implement lowdelay Signed-off-by: Alex Bee --- drivers/staging/media/rkvdec/rkvdec-hevc.c | 16 ++++++++++++++-- - 1 files changed, 14 insertions(+), 2 deletions(-) + 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-hevc.c b/drivers/staging/media/rkvdec/rkvdec-hevc.c -index 93b4e09e5bf1..8a94fc04980f 100644 +index e5283c598798..5986b3d2b5b0 100644 --- a/drivers/staging/media/rkvdec/rkvdec-hevc.c +++ b/drivers/staging/media/rkvdec/rkvdec-hevc.c @@ -2185,6 +2185,7 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx, @@ -3207,6 +3207,7 @@ index 93b4e09e5bf1..8a94fc04980f 100644 WRITE_RPS(sl_params->long_term_ref_pic_set_size + sl_params->short_term_ref_pic_set_size, + From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Sat, 30 Jan 2021 18:16:39 +0100 @@ -3229,7 +3230,7 @@ Signed-off-by: Alex Bee 2 files changed, 84 insertions(+), 30 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index 7419ae7027ab..ab8b42f4f98c 100644 +index b0657ab2d029..0c33d6a5a751 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -14,6 +14,7 @@ @@ -3501,7 +3502,7 @@ Signed-off-by: Alex Bee 1 file changed, 8 insertions(+) diff --git a/drivers/staging/media/rkvdec/rkvdec.c b/drivers/staging/media/rkvdec/rkvdec.c -index ab8b42f4f98c..162623567a1d 100644 +index 0c33d6a5a751..5b20ca492032 100644 --- a/drivers/staging/media/rkvdec/rkvdec.c +++ b/drivers/staging/media/rkvdec/rkvdec.c @@ -1285,11 +1285,19 @@ static const struct rkvdec_variant rk3399_rkvdec_variant = { @@ -3536,7 +3537,7 @@ Signed-off-by: Alex Bee 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi -index 746acfac1e92..32e141a3955b 100644 +index 61d97fb22be9..7c255244f5ed 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -1271,6 +1271,25 @@ vpu_mmu: iommu@ff9a0800 { diff --git a/projects/Rockchip/patches/linux/default/linux-2002-v4l-wip-iep-driver.patch b/projects/Rockchip/patches/linux/default/linux-2002-v4l-wip-iep-driver.patch index b62cdf056f..ce4daa38c8 100644 --- a/projects/Rockchip/patches/linux/default/linux-2002-v4l-wip-iep-driver.patch +++ b/projects/Rockchip/patches/linux/default/linux-2002-v4l-wip-iep-driver.patch @@ -1680,7 +1680,7 @@ Signed-off-by: Alex Bee 1 file changed, 22 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi -index 0e5e492db9c7..f014b87c48f0 100644 +index 1cfd35372c4a..b5315833e5b1 100644 --- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi @@ -771,6 +771,28 @@ vop_mmu: iommu@ff373f00 { @@ -1724,7 +1724,7 @@ Signed-off-by: Alex Bee 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi -index b1c7ee80d255..be839c1a7692 100644 +index ad72d1796542..ae4c4e770669 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi @@ -1304,6 +1304,17 @@ vdec_mmu: iommu@ff660480 { @@ -1767,7 +1767,7 @@ Signed-off-by: Alex Bee 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi -index 32e141a3955b..6b1523b38e53 100644 +index 7c255244f5ed..78bbeaad0294 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -1002,6 +1002,17 @@ crypto: cypto-controller@ff8a0000 { From 40125b6affc012f81bcd3862b434644e6ad05b82 Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Mon, 11 Oct 2021 15:26:52 +0200 Subject: [PATCH 2/7] Rockchip: linux: rkvdec: hevc: improve lowdelay --- .../linux-2001-v4l-wip-rkvdec-hevc.patch | 37 +++++++++++-------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch index 7a555e6b27..1bcff19479 100644 --- a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch +++ b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch @@ -3163,11 +3163,11 @@ Subject: [PATCH] WIP: media: rkvdec: hevc: implement lowdelay Signed-off-by: Alex Bee --- - drivers/staging/media/rkvdec/rkvdec-hevc.c | 16 ++++++++++++++-- - 1 file changed, 14 insertions(+), 2 deletions(-) + drivers/staging/media/rkvdec/rkvdec-hevc.c | 11 +++++++++-- + 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/staging/media/rkvdec/rkvdec-hevc.c b/drivers/staging/media/rkvdec/rkvdec-hevc.c -index e5283c598798..5986b3d2b5b0 100644 +index e5283c598798..d8e9a9c75e78 100644 --- a/drivers/staging/media/rkvdec/rkvdec-hevc.c +++ b/drivers/staging/media/rkvdec/rkvdec-hevc.c @@ -2185,6 +2185,7 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx, @@ -3182,27 +3182,32 @@ index e5283c598798..5986b3d2b5b0 100644 for (j = 0; j < run->num_slices; j++) { sl_params = &run->slices_params[j]; dpb = sl_params->dpb; -+ lowdelay = 0; ++ lowdelay = (sl_params->slice_type == V4L2_HEVC_SLICE_TYPE_I) ? 0 : 1; hw_ps = &priv_tbl->rps[j]; memset(hw_ps, 0, sizeof(*hw_ps)); -@@ -2219,8 +2221,18 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx, +@@ -2209,18 +2211,23 @@ static void assemble_hw_rps(struct rkvdec_ctx *ctx, + WRITE_RPS(!!(dpb[sl_params->ref_idx_l0[i]].rps == V4L2_HEVC_DPB_ENTRY_RPS_LT_CURR), + REF_PIC_LONG_TERM_L0(i)); + WRITE_RPS(sl_params->ref_idx_l0[i], REF_PIC_IDX_L0(i)); ++ ++ if (dpb[sl_params->ref_idx_l0[i]].pic_order_cnt[0] > sl_params->slice_pic_order_cnt) ++ lowdelay = 0; + } + + for (i = 0; i <= sl_params->num_ref_idx_l1_active_minus1; i++) { + WRITE_RPS(!!(dpb[sl_params->ref_idx_l1[i]].rps == V4L2_HEVC_DPB_ENTRY_RPS_LT_CURR), + REF_PIC_LONG_TERM_L1(i)); + WRITE_RPS(sl_params->ref_idx_l1[i], REF_PIC_IDX_L1(i)); ++ ++ if (dpb[sl_params->ref_idx_l1[i]].pic_order_cnt[0] > sl_params->slice_pic_order_cnt) ++ lowdelay = 0; + } //WRITE_RPS(0xffffffff, PS_FIELD(96, 32)); - // TODO: lowdelay - WRITE_RPS(0, LOWDELAY); -+ if (sl_params->slice_type != V4L2_HEVC_SLICE_TYPE_I && -+ !(!!(sl_params->flags & V4L2_HEVC_SLICE_PARAMS_FLAG_DEPENDENT_SLICE_SEGMENT))) { -+ lowdelay = 1; -+ for (i = 0; i < sl_params->num_active_dpb_entries; i++) { -+ if (dpb[i].pic_order_cnt[0] > sl_params->slice_pic_order_cnt) { -+ lowdelay = 0; -+ break; -+ } -+ } -+ } -+ + WRITE_RPS(lowdelay, LOWDELAY); WRITE_RPS(sl_params->long_term_ref_pic_set_size + From 2bcc43cf0124856fb8653fa7969268df64bf1109 Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Mon, 11 Oct 2021 15:28:14 +0200 Subject: [PATCH 3/7] Rockchip linux/ffmpeg hevc: increase max slices count --- ...v4l2request-hevc-increase-max-slices.patch | 25 +++++++++++++++++++ .../linux-2001-v4l-wip-rkvdec-hevc.patch | 2 +- 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 projects/Rockchip/patches/ffmpeg/ffmpeg-0004-v4l2request-hevc-increase-max-slices.patch diff --git a/projects/Rockchip/patches/ffmpeg/ffmpeg-0004-v4l2request-hevc-increase-max-slices.patch b/projects/Rockchip/patches/ffmpeg/ffmpeg-0004-v4l2request-hevc-increase-max-slices.patch new file mode 100644 index 0000000000..4b665817f0 --- /dev/null +++ b/projects/Rockchip/patches/ffmpeg/ffmpeg-0004-v4l2request-hevc-increase-max-slices.patch @@ -0,0 +1,25 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alex Bee +Date: Sun, 20 Jun 2021 20:19:19 +0200 +Subject: [PATCH] v4l2request: hevc: increase max slices + +It's required by some HEVC confromance tests + +Signed-off-by: Alex Bee +--- + libavcodec/v4l2_request_hevc.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libavcodec/v4l2_request_hevc.c b/libavcodec/v4l2_request_hevc.c +index be78382444..35ec87e310 100644 +--- a/libavcodec/v4l2_request_hevc.c ++++ b/libavcodec/v4l2_request_hevc.c +@@ -21,7 +21,7 @@ + #include "v4l2_request.h" + #include "hevc-ctrls.h" + +-#define MAX_SLICES 16 ++#define MAX_SLICES 32 + + typedef struct V4L2RequestControlsHEVC { + struct v4l2_ctrl_hevc_sps sps; diff --git a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch index 1bcff19479..89a0d95939 100644 --- a/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch +++ b/projects/Rockchip/patches/linux/default/linux-2001-v4l-wip-rkvdec-hevc.patch @@ -2911,7 +2911,7 @@ index 81a14db30285..dd67e621f36f 100644 + .cfg.id = V4L2_CID_MPEG_VIDEO_HEVC_SLICE_PARAMS, + // HACK: match ffmpeg v4l2 request api hwaccel size, + // we should support variable length up to 600 slices -+ .cfg.dims = { 16 }, ++ .cfg.dims = { 32 }, + }, + { + .mandatory = true, From b96cfe165bf8990ccc581cd3ff11406b18877ed5 Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Mon, 11 Oct 2021 15:28:31 +0200 Subject: [PATCH 4/7] Rockchip: ffmpeg: support more formats / automatic output format selection in deinterlace filter Also increase input/output buffer count --- ...2m-increase-input-and-output-buffers.patch | 26 ++ ...deinterlace-support-more-formats-aut.patch | 288 ++++++++++++++++++ 2 files changed, 314 insertions(+) create mode 100644 projects/Rockchip/patches/ffmpeg/ffmpeg-0006-deint_v4l2m2m-increase-input-and-output-buffers.patch create mode 100644 projects/Rockchip/patches/ffmpeg/ffmpeg-0006-libavfilter-v4l2deinterlace-support-more-formats-aut.patch diff --git a/projects/Rockchip/patches/ffmpeg/ffmpeg-0006-deint_v4l2m2m-increase-input-and-output-buffers.patch b/projects/Rockchip/patches/ffmpeg/ffmpeg-0006-deint_v4l2m2m-increase-input-and-output-buffers.patch new file mode 100644 index 0000000000..8ccbe42b6c --- /dev/null +++ b/projects/Rockchip/patches/ffmpeg/ffmpeg-0006-deint_v4l2m2m-increase-input-and-output-buffers.patch @@ -0,0 +1,26 @@ +From 1a4b8070ff968a07dc24467922849c1142995e30 Mon Sep 17 00:00:00 2001 +From: popcornmix +Date: Tue, 14 Sep 2021 19:14:24 +0100 +Subject: [PATCH] deint_v4l2m2m: increase input and output buffers + +Required for advanced deinterlacer on pi +--- + libavfilter/vf_deinterlace_v4l2m2m.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c +index a545d551d9ee..0adc96d25435 100644 +--- a/libavfilter/vf_deinterlace_v4l2m2m.c ++++ b/libavfilter/vf_deinterlace_v4l2m2m.c +@@ -954,9 +954,9 @@ static av_cold int deint_v4l2m2m_init(AVFilterContext *avctx) + priv->shared = ctx; + ctx->fd = -1; + ctx->output.ctx = ctx; +- ctx->output.num_buffers = 6; ++ ctx->output.num_buffers = 8; + ctx->capture.ctx = ctx; +- ctx->capture.num_buffers = 6; ++ ctx->capture.num_buffers = 8; + ctx->done = 0; + ctx->field_order = V4L2_FIELD_ANY; + ctx->cur_in_frame = NULL; diff --git a/projects/Rockchip/patches/ffmpeg/ffmpeg-0006-libavfilter-v4l2deinterlace-support-more-formats-aut.patch b/projects/Rockchip/patches/ffmpeg/ffmpeg-0006-libavfilter-v4l2deinterlace-support-more-formats-aut.patch new file mode 100644 index 0000000000..a46cc8f83d --- /dev/null +++ b/projects/Rockchip/patches/ffmpeg/ffmpeg-0006-libavfilter-v4l2deinterlace-support-more-formats-aut.patch @@ -0,0 +1,288 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alex Bee +Date: Wed, 15 Sep 2021 00:37:15 +0200 +Subject: [PATCH] libavfilter: v4l2deinterlace: support more formats / + automatic output format selection + +Signed-off-by: Alex Bee +--- + libavfilter/vf_deinterlace_v4l2m2m.c | 120 +++++++++++++++++++++++---- + 1 file changed, 102 insertions(+), 18 deletions(-) + +diff --git a/libavfilter/vf_deinterlace_v4l2m2m.c b/libavfilter/vf_deinterlace_v4l2m2m.c +index d7935d92f9..8161fd9e75 100644 +--- a/libavfilter/vf_deinterlace_v4l2m2m.c ++++ b/libavfilter/vf_deinterlace_v4l2m2m.c +@@ -85,6 +85,9 @@ typedef struct DeintV4L2M2MContextShared { + int height; + int orig_width; + int orig_height; ++ uint64_t drm_in_format; ++ uint64_t drm_out_format; ++ + atomic_uint refcount; + + AVBufferRef *hw_frames_ctx; +@@ -108,6 +111,65 @@ typedef struct DeintV4L2M2MContext { + DeintV4L2M2MContextShared *shared; + } DeintV4L2M2MContext; + ++typedef struct drm_v4l2_pix_fmt_mapping { ++ uint64_t drm_format; ++ uint32_t v4l2_pix_fmt; ++}; ++ ++static struct drm_v4l2_pix_fmt_mapping drm_v4l2_pix_fmt_map[] = { ++ { .drm_format = DRM_FORMAT_NV12, .v4l2_pix_fmt = V4L2_PIX_FMT_NV12 }, ++ { .drm_format = DRM_FORMAT_NV21, .v4l2_pix_fmt = V4L2_PIX_FMT_NV21 }, ++ { .drm_format = DRM_FORMAT_NV16, .v4l2_pix_fmt = V4L2_PIX_FMT_NV16 }, ++ { .drm_format = DRM_FORMAT_NV16, .v4l2_pix_fmt = V4L2_PIX_FMT_NV16 }, ++#ifdef DRM_FORMAT_MOD_ALLWINNER_TILED ++ { .drm_format = DRM_FORMAT_MOD_ALLWINNER_TILED, .v4l2_pix_fmt = V4L2_PIX_FMT_SUNXI_TILED_NV12 }, ++#endif ++#if defined(V4L2_PIX_FMT_NV15) && defined(DRM_FORMAT_NV15) ++ { .drm_format = DRM_FORMAT_NV15, .v4l2_pix_fmt = V4L2_PIX_FMT_NV15 }, ++#endif ++#if defined(V4L2_PIX_FMT_NV20) && defined(DRM_FORMAT_NV20) ++ { .drm_format = DRM_FORMAT_NV20, .v4l2_pix_fmt = V4L2_PIX_FMT_NV20 }, ++#endif ++}; ++ ++static inline uint32_t v4l2_pix_fmt_from_drm_format(uint64_t drm_format) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < FF_ARRAY_ELEMS(drm_v4l2_pix_fmt_map); i++) { ++ if (drm_v4l2_pix_fmt_map[i].drm_format == drm_format) ++ return drm_v4l2_pix_fmt_map[i].v4l2_pix_fmt; ++ } ++ ++ av_log(NULL, AV_LOG_WARNING, "%s unknown drm format 0x%llx using default v4l2_pix_fmt 0x%x\n", ++ __func__ , drm_format, drm_v4l2_pix_fmt_map[0].v4l2_pix_fmt); ++ return drm_v4l2_pix_fmt_map[0].v4l2_pix_fmt; ++} ++ ++static inline uint64_t drm_format_from_v4l2_pix_fmt(uint32_t v4l2_pix_fmt) ++{ ++ unsigned int i; ++ ++ for (i = 0; i < FF_ARRAY_ELEMS(drm_v4l2_pix_fmt_map); i++) { ++ if (drm_v4l2_pix_fmt_map[i].v4l2_pix_fmt == v4l2_pix_fmt) ++ return drm_v4l2_pix_fmt_map[i].drm_format; ++ } ++ ++ av_log(NULL, AV_LOG_WARNING, "%s unknown v4l2_pix_fmt format 0x%x using default drm_format 0x%llx\n", ++ __func__ , v4l2_pix_fmt, drm_v4l2_pix_fmt_map[0].drm_format); ++ return drm_v4l2_pix_fmt_map[0].drm_format; ++} ++ ++static inline uint64_t drm_format_modifier(uint64_t drm_format) ++{ ++#ifdef DRM_FORMAT_MOD_ALLWINNER_TILED ++ if (drm_format == DRM_FORMAT_MOD_ALLWINNER_TILED) ++ return DRM_FORMAT_MOD_ALLWINNER_TILED; ++#endif ++ return DRM_FORMAT_MOD_LINEAR; ++ ++} ++ + static int deint_v4l2m2m_prepare_context(DeintV4L2M2MContextShared *ctx) + { + struct v4l2_capability cap; +@@ -138,11 +200,12 @@ static int deint_v4l2m2m_prepare_context(DeintV4L2M2MContextShared *ctx) + return AVERROR(EINVAL); + } + +-static int deint_v4l2m2m_try_format(V4L2Queue *queue) ++static int deint_v4l2m2m_try_format(V4L2Queue *queue, uint64_t drm_format) + { + struct v4l2_format *fmt = &queue->format; + DeintV4L2M2MContextShared *ctx = queue->ctx; + int ret, field; ++ uint32_t v4l2_pix_fmt = v4l2_pix_fmt_from_drm_format(drm_format); + + ret = ioctl(ctx->fd, VIDIOC_G_FMT, fmt); + if (ret) +@@ -154,12 +217,12 @@ static int deint_v4l2m2m_try_format(V4L2Queue *queue) + field = V4L2_FIELD_NONE; + + if (V4L2_TYPE_IS_MULTIPLANAR(fmt->type)) { +- fmt->fmt.pix_mp.pixelformat = V4L2_PIX_FMT_NV12; ++ fmt->fmt.pix_mp.pixelformat = v4l2_pix_fmt; + fmt->fmt.pix_mp.field = field; + fmt->fmt.pix_mp.width = ctx->width; + fmt->fmt.pix_mp.height = ctx->height; + } else { +- fmt->fmt.pix.pixelformat = V4L2_PIX_FMT_NV12; ++ fmt->fmt.pix.pixelformat = v4l2_pix_fmt; + fmt->fmt.pix.field = field; + fmt->fmt.pix.width = ctx->width; + fmt->fmt.pix.height = ctx->height; +@@ -170,14 +233,14 @@ static int deint_v4l2m2m_try_format(V4L2Queue *queue) + return AVERROR(EINVAL); + + if (V4L2_TYPE_IS_MULTIPLANAR(fmt->type)) { +- if (fmt->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_NV12 || ++ if (fmt->fmt.pix_mp.pixelformat != v4l2_pix_fmt || + fmt->fmt.pix_mp.field != field) { + av_log(NULL, AV_LOG_DEBUG, "format not supported for type %d\n", fmt->type); + + return AVERROR(EINVAL); + } + } else { +- if (fmt->fmt.pix.pixelformat != V4L2_PIX_FMT_NV12 || ++ if (fmt->fmt.pix.pixelformat != v4l2_pix_fmt || + fmt->fmt.pix.field != field) { + av_log(NULL, AV_LOG_DEBUG, "format not supported for type %d\n", fmt->type); + +@@ -187,19 +250,21 @@ static int deint_v4l2m2m_try_format(V4L2Queue *queue) + + return 0; + } +- +-static int deint_v4l2m2m_set_format(V4L2Queue *queue, uint32_t field, int width, int height) ++static int deint_v4l2m2m_set_format(V4L2Queue *queue, uint32_t field, int width, int height, uint64_t drm_format) + { + struct v4l2_format *fmt = &queue->format; + DeintV4L2M2MContextShared *ctx = queue->ctx; + int ret; ++ uint32_t v4l2_pix_fmt = v4l2_pix_fmt_from_drm_format(drm_format); + + if (V4L2_TYPE_IS_MULTIPLANAR(fmt->type)) { ++ fmt->fmt.pix_mp.pixelformat = v4l2_pix_fmt; + fmt->fmt.pix_mp.field = field; + fmt->fmt.pix_mp.width = width; + fmt->fmt.pix_mp.height = height; + /* TODO: bytesperline and imagesize */ + } else { ++ fmt->fmt.pix.pixelformat = v4l2_pix_fmt; + fmt->fmt.pix.field = field; + fmt->fmt.pix.width = width; + fmt->fmt.pix.height = height; +@@ -211,6 +276,18 @@ static int deint_v4l2m2m_set_format(V4L2Queue *queue, uint32_t field, int width, + if (ret) + av_log(NULL, AV_LOG_ERROR, "VIDIOC_S_FMT failed: %d\n", ret); + ++ else if (!V4L2_TYPE_IS_OUTPUT(queue->format.type)) { ++ if (V4L2_TYPE_IS_MULTIPLANAR(fmt->type) && fmt->fmt.pix_mp.pixelformat != v4l2_pix_fmt) { ++ ctx->drm_out_format = drm_format_from_v4l2_pix_fmt(fmt->fmt.pix_mp.pixelformat); ++ av_log(NULL, AV_LOG_DEBUG, "%s driver updated v4l2_pixfmt from: %x to %x, so now using %llx as drm output format\n", ++ __func__, v4l2_pix_fmt, fmt->fmt.pix_mp.pixelformat, ctx->drm_out_format); ++ } else if (fmt->fmt.pix.pixelformat != v4l2_pix_fmt) { ++ ctx->drm_out_format = drm_format_from_v4l2_pix_fmt(fmt->fmt.pix.pixelformat); ++ av_log(NULL, AV_LOG_DEBUG, "%s driver updated v4l2_pixfmt from: %x to %x, so now using %llx as drm output format\n", ++ __func__, v4l2_pix_fmt, fmt->fmt.pix.pixelformat, ctx->drm_out_format); ++ } ++ } ++ + return ret; + } + +@@ -226,11 +303,11 @@ static int deint_v4l2m2m_probe_device(DeintV4L2M2MContextShared *ctx, char *node + if (ret) + goto fail; + +- ret = deint_v4l2m2m_try_format(&ctx->capture); ++ ret = deint_v4l2m2m_try_format(&ctx->capture, ctx->drm_out_format); + if (ret) + goto fail; + +- ret = deint_v4l2m2m_try_format(&ctx->output); ++ ret = deint_v4l2m2m_try_format(&ctx->output, ctx->drm_in_format); + if (ret) + goto fail; + +@@ -293,7 +370,7 @@ static int deint_v4l2m2m_enqueue_buffer(V4L2Buffer *buf) + return 0; + } + +-static int v4l2_buffer_export_drm(V4L2Buffer* avbuf) ++static int v4l2_buffer_export_drm(V4L2Buffer* avbuf, uint64_t drm_format) + { + struct v4l2_exportbuffer expbuf; + int i, ret; +@@ -315,12 +392,12 @@ static int v4l2_buffer_export_drm(V4L2Buffer* avbuf) + /* drm frame */ + avbuf->drm_frame.objects[i].size = avbuf->buffer.m.planes[i].length; + avbuf->drm_frame.objects[i].fd = expbuf.fd; +- avbuf->drm_frame.objects[i].format_modifier = DRM_FORMAT_MOD_LINEAR; ++ avbuf->drm_frame.objects[i].format_modifier = drm_format_modifier(drm_format); + } else { + /* drm frame */ + avbuf->drm_frame.objects[0].size = avbuf->buffer.length; + avbuf->drm_frame.objects[0].fd = expbuf.fd; +- avbuf->drm_frame.objects[0].format_modifier = DRM_FORMAT_MOD_LINEAR; ++ avbuf->drm_frame.objects[0].format_modifier = drm_format_modifier(drm_format); + } + } + +@@ -405,7 +482,7 @@ static int deint_v4l2m2m_allocate_buffers(V4L2Queue *queue) + if (ret) + goto fail; + +- ret = v4l2_buffer_export_drm(buf); ++ ret = v4l2_buffer_export_drm(buf, ctx->drm_out_format); + if (ret) + goto fail; + } +@@ -597,7 +674,7 @@ static void v4l2_free_buffer(void *opaque, uint8_t *unused) + deint_v4l2m2m_destroy_context(ctx); + } + +-static uint8_t *v4l2_get_drm_frame(V4L2Buffer *avbuf, int height) ++static uint8_t *v4l2_get_drm_frame(V4L2Buffer *avbuf, int height, uint64_t drm_format) + { + AVDRMFrameDescriptor *drm_desc = &avbuf->drm_frame; + AVDRMLayerDescriptor *layer; +@@ -615,7 +692,7 @@ static uint8_t *v4l2_get_drm_frame(V4L2Buffer *avbuf, int height) + layer->planes[i].pitch = avbuf->plane_info[i].bytesperline; + } + +- layer->format = DRM_FORMAT_NV12; ++ layer->format = drm_format; + + if (avbuf->num_planes == 1) { + layer->nb_planes = 2; +@@ -647,7 +724,7 @@ static int deint_v4l2m2m_dequeue_frame(V4L2Queue *queue, AVFrame* frame, int tim + + atomic_fetch_add(&ctx->refcount, 1); + +- frame->data[0] = (uint8_t *)v4l2_get_drm_frame(avbuf, ctx->orig_height); ++ frame->data[0] = (uint8_t *)v4l2_get_drm_frame(avbuf, ctx->orig_height, ctx->drm_out_format); + frame->format = AV_PIX_FMT_DRM_PRIME; + frame->hw_frames_ctx = av_buffer_ref(ctx->hw_frames_ctx); + frame->height = ctx->height; +@@ -797,17 +874,22 @@ static int deint_v4l2m2m_filter_frame(AVFilterLink *link, AVFrame *in) + AVDRMFrameDescriptor *drm_desc = (AVDRMFrameDescriptor *)in->data[0]; + ctx->orig_width = drm_desc->layers[0].planes[0].pitch; + ctx->orig_height = drm_desc->layers[0].planes[1].offset / ctx->orig_width; ++ ctx->drm_in_format = drm_desc->layers->format; ++ ctx->drm_out_format = drm_desc->layers->format; ++ + + if (in->top_field_first) + ctx->field_order = V4L2_FIELD_INTERLACED_TB; + else + ctx->field_order = V4L2_FIELD_INTERLACED_BT; + +- ret = deint_v4l2m2m_set_format(output, ctx->field_order, ctx->orig_width, ctx->orig_height); ++ ret = deint_v4l2m2m_set_format(output, ctx->field_order, ctx->orig_width, ctx->orig_height, ++ ctx->drm_in_format); + if (ret) + return ret; + +- ret = deint_v4l2m2m_set_format(capture, V4L2_FIELD_NONE, ctx->orig_width, ctx->orig_height); ++ ret = deint_v4l2m2m_set_format(capture, V4L2_FIELD_NONE, ctx->orig_width, ctx->orig_height, ++ ctx->drm_out_format); + if (ret) + return ret; + +@@ -864,6 +946,8 @@ static av_cold int deint_v4l2m2m_init(AVFilterContext *avctx) + ctx->field_order = V4L2_FIELD_ANY; + ctx->cur_in_frame = NULL; + ctx->prev_in_frame = NULL; ++ ctx->drm_in_format = drm_v4l2_pix_fmt_map[0].drm_format; ++ ctx->drm_out_format = drm_v4l2_pix_fmt_map[0].drm_format; + atomic_init(&ctx->refcount, 1); + + return 0; From 6c9d0093d0fc396b35b2403a4e0406aefbe6e959 Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Mon, 11 Oct 2021 15:03:41 +0200 Subject: [PATCH 5/7] Rockchip: RK3328: Disable 500 MHz GPU OPP --- .../linux/default/linux-1002-for-libreelec.patch | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch b/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch index 1c605e1800..fffd1b61ff 100644 --- a/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch +++ b/projects/Rockchip/patches/linux/default/linux-1002-for-libreelec.patch @@ -6,12 +6,13 @@ Subject: [PATCH] arm64: dts: rockchip: add gpu powerdomain, gpu opp-table and Note: since the regulator that supplies the GPU usually also supplies other SoC components, we have to make sure voltage is never lower then -1075 mV. +1050 mV - also disable 500 MHz for now, since it will crash if rkvdec +is running at the same time (voltage to high) Signed-off-by: Alex Bee --- arch/arm64/boot/dts/rockchip/rk3328.dtsi | 33 ++++++++++++++++++++++++ - 1 file changed, 33 insertions(+) + 1 file changed, 34 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi index ee539487dfc7..da54409aa50c 100644 @@ -40,7 +41,7 @@ index ee539487dfc7..da54409aa50c 100644 }; }; -@@ -627,7 +636,31 @@ gpu: gpu@ff300000 { +@@ -627,7 +636,32 @@ gpu: gpu@ff300000 { "ppmmu1"; clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>; clock-names = "bus", "core"; @@ -55,19 +56,20 @@ index ee539487dfc7..da54409aa50c 100644 + + opp-200000000 { + opp-hz = /bits/ 64 <200000000>; -+ opp-microvolt = <1075000>; ++ opp-microvolt = <1050000>; + }; + opp-300000000 { + opp-hz = /bits/ 64 <300000000>; -+ opp-microvolt = <1075000>; ++ opp-microvolt = <1050000>; + }; + opp-400000000 { + opp-hz = /bits/ 64 <400000000>; -+ opp-microvolt = <1075000>; ++ opp-microvolt = <1050000>; + }; + opp-500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microvolt = <1150000>; ++ status = "disabled"; + }; }; From 7f13c80bf208e1e10ca12fd3f9621858c1094dc2 Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Fri, 22 Oct 2021 12:13:02 +0200 Subject: [PATCH 6/7] Rockchip: linux: fix CEC not working after power-cycle and reinstate debounce_ms patch --- .../default/linux-1000-drm-rockchip.patch | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) diff --git a/projects/Rockchip/patches/linux/default/linux-1000-drm-rockchip.patch b/projects/Rockchip/patches/linux/default/linux-1000-drm-rockchip.patch index 2e33056017..6510c147ce 100644 --- a/projects/Rockchip/patches/linux/default/linux-1000-drm-rockchip.patch +++ b/projects/Rockchip/patches/linux/default/linux-1000-drm-rockchip.patch @@ -3502,3 +3502,215 @@ index 15c6259820c2..b44f6f4b2a9e 100644 return; } + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Jonas Karlman +Date: Tue, 1 Oct 2019 20:52:42 +0000 +Subject: [PATCH] media: cec-adap: add debounce support when setting an invalid + phys addr + +When EDID is refreshed, HDMI cable is unplugged/replugged or +an AVR is power cycled the CEC phys addr gets invalidated. + +This can cause some disruption of CEC communication when +adapter is being reconfigured. + +Add a debounce_ms module option that can be used to debounce setting +an invalid phys addr. Default is not to use debouncing. + +Using a configured debounce_ms of e.g. 5000 ms, cec reconfiguring +could be avoided when AVR was power cycled on my setup. + +Power off AVR (default cec.debounce_ms=0): +[ 101.536866] cec-dw_hdmi: new physical address f.f.f.f +[ 102.495686] cec-dw_hdmi: new physical address 2.1.0.0 +[ 102.495913] cec-dw_hdmi: physical address: 2.1.0.0, claim 1 logical addresses +[ 102.628574] cec-dw_hdmi: config: la 1 pa 2.1.0.0 +[ 105.130115] cec-dw_hdmi: new physical address f.f.f.f +[ 106.979705] cec-dw_hdmi: new physical address 2.1.0.0 +[ 106.979872] cec-dw_hdmi: physical address: 2.1.0.0, claim 1 logical addresses +[ 107.112399] cec-dw_hdmi: config: la 1 pa 2.1.0.0 +[ 108.979408] cec-dw_hdmi: reported physical address 2.0.0.0 for logical address 5 +[ 109.205386] cec-dw_hdmi: reported physical address 2.0.0.0 for logical address 11 + +Power on AVR (default cec.debounce_ms=0): +[ 158.398447] cec-dw_hdmi: new physical address f.f.f.f +[ 161.977714] cec-dw_hdmi: new physical address 2.1.0.0 +[ 161.978766] cec-dw_hdmi: physical address: 2.1.0.0, claim 1 logical addresses +[ 162.115624] cec-dw_hdmi: config: la 1 pa 2.1.0.0 +[ 162.402750] cec-dw_hdmi: new physical address f.f.f.f +[ 162.403389] cec-dw_hdmi: cec_transmit_msg_fh: adapter is unconfigured +[ 162.886757] cec-dw_hdmi: new physical address 2.1.0.0 +[ 162.886964] cec-dw_hdmi: physical address: 2.1.0.0, claim 1 logical addresses +[ 163.510725] cec-dw_hdmi: config: la 1 pa 2.1.0.0 +[ 173.034200] cec-dw_hdmi: message 10 89 02 05 timed out + +Power off AVR (cec.debounce_ms=5000): +[ 251.720471] cec-dw_hdmi: reported physical address 2.0.0.0 for logical address 5 +[ 251.922432] cec-dw_hdmi: reported physical address 2.0.0.0 for logical address 11 + +Power on AVR (cec.debounce_ms=5000): +[ 291.154262] cec-dw_hdmi: reported physical address 2.0.0.0 for logical address 5 +[ 291.296199] cec-dw_hdmi: reported physical address 2.0.0.0 for logical address 11 + +Signed-off-by: Jonas Karlman +--- + drivers/media/cec/core/cec-adap.c | 9 ++++++++- + drivers/media/cec/core/cec-core.c | 18 ++++++++++++++++++ + drivers/media/cec/core/cec-priv.h | 1 + + include/media/cec.h | 2 ++ + 4 files changed, 29 insertions(+), 1 deletion(-) + +diff --git a/drivers/media/cec/core/cec-adap.c b/drivers/media/cec/core/cec-adap.c +index d5d5d28d0b36..06f30ff78723 100644 +--- a/drivers/media/cec/core/cec-adap.c ++++ b/drivers/media/cec/core/cec-adap.c +@@ -1613,8 +1613,15 @@ void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block) + if (IS_ERR_OR_NULL(adap)) + return; + ++ cancel_delayed_work_sync(&adap->debounce_work); ++ + mutex_lock(&adap->lock); +- __cec_s_phys_addr(adap, phys_addr, block); ++ if (cec_debounce_ms > 0 && !block && phys_addr == CEC_PHYS_ADDR_INVALID && ++ adap->phys_addr != phys_addr) ++ schedule_delayed_work(&adap->debounce_work, ++ msecs_to_jiffies(cec_debounce_ms)); ++ else ++ __cec_s_phys_addr(adap, phys_addr, block); + mutex_unlock(&adap->lock); + } + EXPORT_SYMBOL_GPL(cec_s_phys_addr); +diff --git a/drivers/media/cec/core/cec-core.c b/drivers/media/cec/core/cec-core.c +index ece236291f35..8a9e6c9dd426 100644 +--- a/drivers/media/cec/core/cec-core.c ++++ b/drivers/media/cec/core/cec-core.c +@@ -28,6 +28,10 @@ static bool debug_phys_addr; + module_param(debug_phys_addr, bool, 0644); + MODULE_PARM_DESC(debug_phys_addr, "add CEC_CAP_PHYS_ADDR if set"); + ++int cec_debounce_ms; ++module_param_named(debounce_ms, cec_debounce_ms, int, 0644); ++MODULE_PARM_DESC(debounce_ms, "debounce invalid phys addr"); ++ + static dev_t cec_dev_t; + + /* Active devices */ +@@ -174,6 +178,8 @@ static void cec_devnode_unregister(struct cec_adapter *adap) + devnode->unregistered = true; + mutex_unlock(&devnode->lock); + ++ cancel_delayed_work_sync(&adap->debounce_work); ++ + mutex_lock(&adap->lock); + __cec_s_phys_addr(adap, CEC_PHYS_ADDR_INVALID, false); + __cec_s_log_addrs(adap, NULL, false); +@@ -232,6 +238,17 @@ static const struct file_operations cec_error_inj_fops = { + }; + #endif + ++static void cec_s_phys_addr_debounce(struct work_struct *work) ++{ ++ struct delayed_work *delayed_work = to_delayed_work(work); ++ struct cec_adapter *adap = ++ container_of(delayed_work, struct cec_adapter, debounce_work); ++ ++ mutex_lock(&adap->lock); ++ __cec_s_phys_addr(adap, CEC_PHYS_ADDR_INVALID, false); ++ mutex_unlock(&adap->lock); ++} ++ + struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, + void *priv, const char *name, u32 caps, + u8 available_las) +@@ -269,6 +286,7 @@ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops, + INIT_LIST_HEAD(&adap->transmit_queue); + INIT_LIST_HEAD(&adap->wait_queue); + init_waitqueue_head(&adap->kthread_waitq); ++ INIT_DELAYED_WORK(&adap->debounce_work, cec_s_phys_addr_debounce); + + /* adap->devnode initialization */ + INIT_LIST_HEAD(&adap->devnode.fhs); +diff --git a/drivers/media/cec/core/cec-priv.h b/drivers/media/cec/core/cec-priv.h +index 9bbd05053d42..d479dbd50528 100644 +--- a/drivers/media/cec/core/cec-priv.h ++++ b/drivers/media/cec/core/cec-priv.h +@@ -27,6 +27,7 @@ static inline bool msg_is_raw(const struct cec_msg *msg) + + /* cec-core.c */ + extern int cec_debug; ++extern int cec_debounce_ms; + int cec_get_device(struct cec_devnode *devnode); + void cec_put_device(struct cec_devnode *devnode); + +diff --git a/include/media/cec.h b/include/media/cec.h +index cd35ae6b7560..df742fe6e0c1 100644 +--- a/include/media/cec.h ++++ b/include/media/cec.h +@@ -217,6 +217,8 @@ struct cec_adapter { + struct task_struct *kthread; + wait_queue_head_t kthread_waitq; + ++ struct delayed_work debounce_work; ++ + const struct cec_adap_ops *ops; + void *priv; + u32 capabilities; + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alex Bee +Date: Fri, 22 Oct 2021 11:17:30 +0200 +Subject: [PATCH] WIP: drm/bridge: synopsys: Fix CEC not working after + power-cyclying + +This fixes standby -> power-on on Rockchip platform for, at least, +RK3288/RK3328/RK3399 where CEC wasn't working after powering on again. +It might differ for other phy implementations: +The whole HPD-detection part shoud be reworked and we should in general +avoid to rely in RX_SENSE phy status (at least for HDMI), since it differs +depending on sink's implementation. + +Signed-off-by: Alex Bee +--- + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +index d798846579f5..184a4a47558e 100644 +--- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c ++++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +@@ -3052,18 +3052,11 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) + * ask the source to re-read the EDID. + */ + if (intr_stat & +- (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) { ++ (HDMI_IH_PHY_STAT0_RX_SENSE | HDMI_IH_PHY_STAT0_HPD)) + dw_hdmi_setup_rx_sense(hdmi, + phy_stat & HDMI_PHY_HPD, + phy_stat & HDMI_PHY_RX_SENSE); + +- if ((phy_stat & (HDMI_PHY_RX_SENSE | HDMI_PHY_HPD)) == 0) { +- mutex_lock(&hdmi->cec_notifier_mutex); +- cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); +- mutex_unlock(&hdmi->cec_notifier_mutex); +- } +- } +- + if (intr_stat & HDMI_IH_PHY_STAT0_HPD) { + enum drm_connector_status status = phy_int_pol & HDMI_PHY_HPD + ? connector_status_connected +@@ -3077,6 +3070,13 @@ static irqreturn_t dw_hdmi_irq(int irq, void *dev_id) + drm_helper_hpd_irq_event(hdmi->bridge.dev); + drm_bridge_hpd_notify(&hdmi->bridge, status); + } ++ ++ if (status == connector_status_disconnected && ++ (phy_stat & HDMI_PHY_RX_SENSE)) { ++ mutex_lock(&hdmi->cec_notifier_mutex); ++ cec_notifier_phys_addr_invalidate(hdmi->cec_notifier); ++ mutex_unlock(&hdmi->cec_notifier_mutex); ++ } + } + + hdmi_writeb(hdmi, intr_stat, HDMI_IH_PHY_STAT0); From eea5891db79222a2c982442d630394b023240ccb Mon Sep 17 00:00:00 2001 From: Alex Bee Date: Fri, 22 Oct 2021 13:51:07 +0200 Subject: [PATCH 7/7] Rockchip: linux: add anlog sound for Rock Pi4 (backport from 5.15) --- .../linux-0004-rockchip-from-next.patch | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch b/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch index d505f26bfd..db890c1c7b 100644 --- a/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch +++ b/projects/Rockchip/patches/linux/default/linux-0004-rockchip-from-next.patch @@ -259,3 +259,73 @@ index d582ef3a3aeb..f3f49cf3731b 100644 di->slew_mask = CTL_SLEW_MASK; di->slew_shift = CTL_SLEW_SHIFT; di->vsel_count = FAN53555_NVOLTAGES; + +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: Alex Bee +Date: Fri, 18 Jun 2021 20:12:55 +0200 +Subject: [PATCH] arm64: dts: rockchip: add ES8316 codec for ROCK Pi 4 + +ROCK Pi 4 boards have the codec connected to i2s0 and it is accessible +via i2c1 address 0x11. +Add an audio-graph-card for it. + +Signed-off-by: Alex Bee +Link: https://lore.kernel.org/r/20210618181256.27992-5-knaerzche@gmail.com +Signed-off-by: Heiko Stuebner +--- + .../boot/dts/rockchip/rk3399-rock-pi-4.dtsi | 28 +++++++++++++++++++ + 1 file changed, 28 insertions(+) + +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +index fb7599f07af4..619471a1fb46 100644 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dtsi +@@ -31,6 +31,12 @@ sdio_pwrseq: sdio-pwrseq { + reset-gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_LOW>; + }; + ++ sound { ++ compatible = "audio-graph-card"; ++ label = "Analog"; ++ dais = <&i2s0_p0>; ++ }; ++ + vcc12v_dcin: dc-12v { + compatible = "regulator-fixed"; + regulator-name = "vcc12v_dcin"; +@@ -417,6 +423,20 @@ &i2c1 { + i2c-scl-rising-time-ns = <300>; + i2c-scl-falling-time-ns = <15>; + status = "okay"; ++ ++ es8316: codec@11 { ++ compatible = "everest,es8316"; ++ reg = <0x11>; ++ clocks = <&cru SCLK_I2S_8CH_OUT>; ++ clock-names = "mclk"; ++ #sound-dai-cells = <0>; ++ ++ port { ++ es8316_p0_0: endpoint { ++ remote-endpoint = <&i2s0_p0_0>; ++ }; ++ }; ++ }; + }; + + &i2c3 { +@@ -436,6 +456,14 @@ &i2s0 { + rockchip,capture-channels = <2>; + rockchip,playback-channels = <2>; + status = "okay"; ++ ++ i2s0_p0: port { ++ i2s0_p0_0: endpoint { ++ dai-format = "i2s"; ++ mclk-fs = <256>; ++ remote-endpoint = <&es8316_p0_0>; ++ }; ++ }; + }; + + &i2s1 {