From: Daniel Golle Date: Sun, 15 Dec 2024 23:58:27 +0000 (+0000) Subject: mediatek: add pending patches fixing video output on MT7623N X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=f71ce1c34e43a1722eeadefa89324b23d0463022;p=openwrt%2Fstaging%2Fblocktrron.git mediatek: add pending patches fixing video output on MT7623N Add a bunch of fixes for HDMI output and Mali-450 GPU rendering on MT7623N, ie. the BananaPi R2. Signed-off-by: Daniel Golle --- diff --git a/target/linux/mediatek/patches-6.6/256-clk-mediatek-mt2701-vdec-fix-conversion-to-mtk_clk_s.patch b/target/linux/mediatek/patches-6.6/256-clk-mediatek-mt2701-vdec-fix-conversion-to-mtk_clk_s.patch new file mode 100644 index 0000000000..e2aed0126f --- /dev/null +++ b/target/linux/mediatek/patches-6.6/256-clk-mediatek-mt2701-vdec-fix-conversion-to-mtk_clk_s.patch @@ -0,0 +1,56 @@ +From patchwork Sun Dec 15 22:13:49 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909005 +Date: Sun, 15 Dec 2024 22:13:49 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 1/5] clk: mediatek: mt2701-vdec: fix conversion to + mtk_clk_simple_probe +Message-ID: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline + +Commit 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to +simplify driver") broke DT bindings as the highest index was reduced by +1 because the id count starts from 1 and not from 0. + +Fix this, like for other drivers which had the same issue, by adding a +dummy clk at index 0. + +Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-vdec.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-vdec.c ++++ b/drivers/clk/mediatek/clk-mt2701-vdec.c +@@ -31,6 +31,7 @@ static const struct mtk_gate_regs vdec1_ + GATE_MTK(_id, _name, _parent, &vdec1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) + + static const struct mtk_gate vdec_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "vdec_dummy"), + GATE_VDEC0(CLK_VDEC_CKGEN, "vdec_cken", "vdec_sel", 0), + GATE_VDEC1(CLK_VDEC_LARB, "vdec_larb_cken", "mm_sel", 0), + }; diff --git a/target/linux/mediatek/patches-6.6/257-clk-mediatek-mt2701-aud-fix-conversion-to-mtk_clk_si.patch b/target/linux/mediatek/patches-6.6/257-clk-mediatek-mt2701-aud-fix-conversion-to-mtk_clk_si.patch new file mode 100644 index 0000000000..5d31aec0be --- /dev/null +++ b/target/linux/mediatek/patches-6.6/257-clk-mediatek-mt2701-aud-fix-conversion-to-mtk_clk_si.patch @@ -0,0 +1,92 @@ +From patchwork Sun Dec 15 22:14:11 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909006 +Date: Sun, 15 Dec 2024 22:14:11 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 2/5] clk: mediatek: mt2701-aud: fix conversion to + mtk_clk_simple_probe +Message-ID: + +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Some of the audio subsystem clocks defined in clk-mt2701.h aren't +actually used by the driver. This broke conversion to +mtk_clk_simple_probe which expects that the highest possible clk id is +defined by the ARRAY_SIZE. + +Add additional dummy clocks to fill the gaps and remain compatible with +the existing DT bindings. + +Fixes: 0f69a423c458 ("clk: mediatek: Switch to mtk_clk_simple_probe() where possible") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-aud.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/drivers/clk/mediatek/clk-mt2701-aud.c ++++ b/drivers/clk/mediatek/clk-mt2701-aud.c +@@ -55,10 +55,16 @@ static const struct mtk_gate audio_clks[ + GATE_DUMMY(CLK_DUMMY, "aud_dummy"), + /* AUDIO0 */ + GATE_AUDIO0(CLK_AUD_AFE, "audio_afe", "aud_intbus_sel", 2), ++ GATE_DUMMY(CLK_AUD_LRCK_DETECT, "audio_lrck_detect_dummy"), ++ GATE_DUMMY(CLK_AUD_I2S, "audio_i2c_dummy"), ++ GATE_DUMMY(CLK_AUD_APLL_TUNER, "audio_apll_tuner_dummy"), + GATE_AUDIO0(CLK_AUD_HDMI, "audio_hdmi", "audpll_sel", 20), + GATE_AUDIO0(CLK_AUD_SPDF, "audio_spdf", "audpll_sel", 21), + GATE_AUDIO0(CLK_AUD_SPDF2, "audio_spdf2", "audpll_sel", 22), + GATE_AUDIO0(CLK_AUD_APLL, "audio_apll", "audpll_sel", 23), ++ GATE_DUMMY(CLK_AUD_TML, "audio_tml_dummy"), ++ GATE_DUMMY(CLK_AUD_AHB_IDLE_EXT, "audio_ahb_idle_ext_dummy"), ++ GATE_DUMMY(CLK_AUD_AHB_IDLE_INT, "audio_ahb_idle_int_dummy"), + /* AUDIO1 */ + GATE_AUDIO1(CLK_AUD_I2SIN1, "audio_i2sin1", "aud_mux1_sel", 0), + GATE_AUDIO1(CLK_AUD_I2SIN2, "audio_i2sin2", "aud_mux1_sel", 1), +@@ -76,10 +82,12 @@ static const struct mtk_gate audio_clks[ + GATE_AUDIO1(CLK_AUD_ASRCI2, "audio_asrci2", "asm_h_sel", 13), + GATE_AUDIO1(CLK_AUD_ASRCO1, "audio_asrco1", "asm_h_sel", 14), + GATE_AUDIO1(CLK_AUD_ASRCO2, "audio_asrco2", "asm_h_sel", 15), ++ GATE_DUMMY(CLK_AUD_HDMIRX, "audio_hdmirx_dummy"), + GATE_AUDIO1(CLK_AUD_INTDIR, "audio_intdir", "intdir_sel", 20), + GATE_AUDIO1(CLK_AUD_A1SYS, "audio_a1sys", "aud_mux1_sel", 21), + GATE_AUDIO1(CLK_AUD_A2SYS, "audio_a2sys", "aud_mux2_sel", 22), + GATE_AUDIO1(CLK_AUD_AFE_CONN, "audio_afe_conn", "aud_mux1_sel", 23), ++ GATE_DUMMY(CLK_AUD_AFE_PCMIF, "audio_afe_pcmif_dummy"), + GATE_AUDIO1(CLK_AUD_AFE_MRGIF, "audio_afe_mrgif", "aud_mux1_sel", 25), + /* AUDIO2 */ + GATE_AUDIO2(CLK_AUD_MMIF_UL1, "audio_ul1", "aud_mux1_sel", 0), +@@ -100,6 +108,8 @@ static const struct mtk_gate audio_clks[ + GATE_AUDIO2(CLK_AUD_MMIF_AWB2, "audio_awb2", "aud_mux1_sel", 15), + GATE_AUDIO2(CLK_AUD_MMIF_DAI, "audio_dai", "aud_mux1_sel", 16), + /* AUDIO3 */ ++ GATE_DUMMY(CLK_AUD_DMIC1, "audio_dmic1_dummy"), ++ GATE_DUMMY(CLK_AUD_DMIC2, "audio_dmic2_dummy"), + GATE_AUDIO3(CLK_AUD_ASRCI3, "audio_asrci3", "asm_h_sel", 2), + GATE_AUDIO3(CLK_AUD_ASRCI4, "audio_asrci4", "asm_h_sel", 3), + GATE_AUDIO3(CLK_AUD_ASRCI5, "audio_asrci5", "asm_h_sel", 4), diff --git a/target/linux/mediatek/patches-6.6/258-clk-mediatek-mt2701-bdp-add-missing-dummy-clk.patch b/target/linux/mediatek/patches-6.6/258-clk-mediatek-mt2701-bdp-add-missing-dummy-clk.patch new file mode 100644 index 0000000000..0542bcae4e --- /dev/null +++ b/target/linux/mediatek/patches-6.6/258-clk-mediatek-mt2701-bdp-add-missing-dummy-clk.patch @@ -0,0 +1,55 @@ +From patchwork Sun Dec 15 22:14:24 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909007 +Date: Sun, 15 Dec 2024 22:14:24 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 3/5] clk: mediatek: mt2701-bdp: add missing dummy clk +Message-ID: + +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Add dummy clk for index 0 which was missed during the conversion to +mtk_clk_simple_probe(). + +Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-bdp.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-bdp.c ++++ b/drivers/clk/mediatek/clk-mt2701-bdp.c +@@ -31,6 +31,7 @@ static const struct mtk_gate_regs bdp1_c + GATE_MTK(_id, _name, _parent, &bdp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr_inv) + + static const struct mtk_gate bdp_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "bdp_dummy"), + GATE_BDP0(CLK_BDP_BRG_BA, "brg_baclk", "mm_sel", 0), + GATE_BDP0(CLK_BDP_BRG_DRAM, "brg_dram", "mm_sel", 1), + GATE_BDP0(CLK_BDP_LARB_DRAM, "larb_dram", "mm_sel", 2), diff --git a/target/linux/mediatek/patches-6.6/259-clk-mediatek-mt2701-mm-add-missing-dummy-clk.patch b/target/linux/mediatek/patches-6.6/259-clk-mediatek-mt2701-mm-add-missing-dummy-clk.patch new file mode 100644 index 0000000000..526fdd9d1a --- /dev/null +++ b/target/linux/mediatek/patches-6.6/259-clk-mediatek-mt2701-mm-add-missing-dummy-clk.patch @@ -0,0 +1,56 @@ +From patchwork Sun Dec 15 22:14:34 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909008 +Date: Sun, 15 Dec 2024 22:14:34 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 4/5] clk: mediatek: mt2701-mm: add missing dummy clk +Message-ID: + <9de23440fcba1ffef9e77d58c9f505105e57a250.1734300668.git.daniel@makrotopia.org> +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Add dummy clk which was missed during the conversion to +mtk_clk_pdev_probe() and is required for the existing DT bindings to +keep working. + +Fixes: 65c10c50c9c7 ("clk: mediatek: Migrate to mtk_clk_pdev_probe() for multimedia clocks") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-mm.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-mm.c ++++ b/drivers/clk/mediatek/clk-mt2701-mm.c +@@ -31,6 +31,7 @@ static const struct mtk_gate_regs disp1_ + GATE_MTK(_id, _name, _parent, &disp1_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + + static const struct mtk_gate mm_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "mm_dummy"), + GATE_DISP0(CLK_MM_SMI_COMMON, "mm_smi_comm", "mm_sel", 0), + GATE_DISP0(CLK_MM_SMI_LARB0, "mm_smi_larb0", "mm_sel", 1), + GATE_DISP0(CLK_MM_CMDQ, "mm_cmdq", "mm_sel", 2), diff --git a/target/linux/mediatek/patches-6.6/260-clk-mediatek-mt2701-img-add-missing-dummy-clk.patch b/target/linux/mediatek/patches-6.6/260-clk-mediatek-mt2701-img-add-missing-dummy-clk.patch new file mode 100644 index 0000000000..a86f158106 --- /dev/null +++ b/target/linux/mediatek/patches-6.6/260-clk-mediatek-mt2701-img-add-missing-dummy-clk.patch @@ -0,0 +1,55 @@ +From patchwork Sun Dec 15 22:14:48 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13909009 +Date: Sun, 15 Dec 2024 22:14:48 +0000 +From: Daniel Golle +To: Michael Turquette , + Stephen Boyd , Matthias Brugger , + AngeloGioacchino Del Regno , + Alexandre Mergnat , + Geert Uytterhoeven , + Daniel Golle , + Uwe =?iso-8859-1?q?Kleine-K=F6nig?= , + Miles Chen , Chen-Yu Tsai , + Frank Wunderlich , John Crispin , + linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, + stable@vger.kernel.org +Subject: [PATCH 5/5] clk: mediatek: mt2701-img: add missing dummy clk +Message-ID: + +References: + +Precedence: bulk +X-Mailing-List: linux-clk@vger.kernel.org +List-Id: +List-Subscribe: +List-Unsubscribe: +MIME-Version: 1.0 +Content-Disposition: inline +In-Reply-To: + + +Add dummy clk for index 0 which was missed during the conversion to +mtk_clk_simple_probe(). + +Fixes: 973d1607d936 ("clk: mediatek: mt2701: use mtk_clk_simple_probe to simplify driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/clk/mediatek/clk-mt2701-img.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/clk/mediatek/clk-mt2701-img.c ++++ b/drivers/clk/mediatek/clk-mt2701-img.c +@@ -22,6 +22,7 @@ static const struct mtk_gate_regs img_cg + GATE_MTK(_id, _name, _parent, &img_cg_regs, _shift, &mtk_clk_gate_ops_setclr) + + static const struct mtk_gate img_clks[] = { ++ GATE_DUMMY(CLK_DUMMY, "img_dummy"), + GATE_IMG(CLK_IMG_SMI_COMM, "img_smi_comm", "mm_sel", 0), + GATE_IMG(CLK_IMG_RESZ, "img_resz", "mm_sel", 1), + GATE_IMG(CLK_IMG_JPGDEC_SMI, "img_jpgdec_smi", "mm_sel", 5), diff --git a/target/linux/mediatek/patches-6.6/870-drm-mediatek-only-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch b/target/linux/mediatek/patches-6.6/870-drm-mediatek-only-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch new file mode 100644 index 0000000000..4aea9e034c --- /dev/null +++ b/target/linux/mediatek/patches-6.6/870-drm-mediatek-only-touch-DISP_REG_OVL_PITCH_MSB-if-AF.patch @@ -0,0 +1,70 @@ +From patchwork Sun Dec 15 22:09:41 2024 +Content-Type: text/plain; charset="utf-8" +MIME-Version: 1.0 +Content-Transfer-Encoding: 7bit +X-Patchwork-Submitter: Daniel Golle +X-Patchwork-Id: 13908995 +Return-Path: + +Date: Sun, 15 Dec 2024 22:09:41 +0000 +From: Daniel Golle +To: Chun-Kuang Hu , + Philipp Zabel , + David Airlie , Simona Vetter , + Matthias Brugger , + AngeloGioacchino Del Regno , + Justin Green , + Frank Wunderlich , + John Crispin , dri-devel@lists.freedesktop.org, + linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, + linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org +Subject: [PATCH] drm/mediatek: only touch DISP_REG_OVL_PITCH_MSB if AFBC is + supported +Message-ID: + <8c001c8e70d93d64d3ee6bf7dc5078d2783d4e32.1734300345.git.daniel@makrotopia.org> +MIME-Version: 1.0 +Content-Disposition: inline +X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 +X-CRM114-CacheID: sfid-20241215_140959_910539_20C140B3 +X-CRM114-Status: UNSURE ( 9.48 ) +X-CRM114-Notice: Please train this message. +X-BeenThere: linux-mediatek@lists.infradead.org +X-Mailman-Version: 2.1.34 +Precedence: list +List-Id: +List-Unsubscribe: , + +List-Archive: +List-Post: +List-Help: +List-Subscribe: , + +Sender: "Linux-mediatek" +Errors-To: + linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org + +Touching DISP_REG_OVL_PITCH_MSB leads to video overlay on MT2701, MT7623N +and probably other older SoCs being broken. + +Only touching it on hardware which actually supports AFBC like it was +before commit c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek +DRM driver") fixes it. + +Fixes: c410fa9b07c3 ("drm/mediatek: Add AFBC support to Mediatek DRM driver") +Cc: stable@vger.kernel.org +Signed-off-by: Daniel Golle +--- + drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c ++++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +@@ -478,7 +478,7 @@ void mtk_ovl_layer_config(struct device + &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx)); + mtk_ddp_write_relaxed(cmdq_pkt, hdr_pitch, &ovl->cmdq_reg, ovl->regs, + DISP_REG_OVL_HDR_PITCH(ovl, idx)); +- } else { ++ } else if (ovl->data->supports_afbc) { + mtk_ddp_write_relaxed(cmdq_pkt, + overlay_pitch.split_pitch.msb, + &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH_MSB(idx));