From nobody Thu Apr 2 02:42:24 2026 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5323B31F99D; Fri, 20 Mar 2026 05:59:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773986401; cv=none; b=uZp7FndRJr76eqW+AgRngZMIPhdYT9txn+Nskg16MpKIS4baC8UoLbVs8iTdkyIdDmOWRewoj47V19RSJAATn6OL0cvd0KQZoUf4SXJo5RdMoURkyCtrB/HB4m+Jp7RtGkLCUJxZfgQ5XliiyoakEzjhoy1ibtPQsVqebjpWqGI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773986401; c=relaxed/simple; bh=qVNvhKQoMloZWW+AcLTtTWV4/si4CDg0Bl0EOt7YygA=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=RPg2ouY0RSsz5uPd3W8DLcMxr5VgZ1wG76E8u1lCQ7geUgnimwh8sRuO67D8HEGEeGuzXrzVYV7hNZUzmj0+1x917xkiPK+CKoQ//2szPM7zy7k+2rfLvALkjAyV9mmwdVQp6bpOxALe3YuQSI2J7hTJPhDMY/8hM54ooq9dvC8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=KVnbFglx; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="KVnbFglx" X-UUID: 02e06b3c242211f1a02d4725871ece0b-20260320 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=uHtq+OHtAsVRdSDppBowtdrnvD+8u/z158uMqM5kJBU=; b=KVnbFglxFLDwskmiYLGvLoYUE+gqOwPude/Qg6p/y2Etj05Ev8gFOZIe+P6EAzRYzenUdqt0h3L2gG6PjJhMxBA1xgWYQ1gv0ZjqxLocbZuO8+0UGyO5EkZ0mXmGI8Rq2ctkxuxUZ2fnaxhODU7Tl2wXJ41d/ql0xyWIoagMMco=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.3.12,REQID:435a96e0-00d1-4456-96b3-8e14274490ff,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:e7bac3a,CLOUDID:fcd1efd4-060f-4ecc-9ee0-121eeeb4a682,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:81|82|102|836|888|898,TC:-5,Content: 0|15|50,EDM:-3,IP:nil,URL:0,File:130,RT:0,Bulk:nil,QS:nil,BEC:-1,COL:0,OSI :0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 2,SSN|SDN X-CID-BAS: 2,SSN|SDN,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-CID-RHF: D41D8CD98F00B204E9800998ECF8427E X-UUID: 02e06b3c242211f1a02d4725871ece0b-20260320 Received: from mtkmbs09n1.mediatek.inc [(172.21.101.35)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 300295878; Fri, 20 Mar 2026 13:59:52 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.29; Fri, 20 Mar 2026 13:59:50 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.2562.29 via Frontend Transport; Fri, 20 Mar 2026 13:59:49 +0800 From: Kyrie Wu To: Tiffany Lin , Andrew-CT Chen , Yunfei Dong , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Kyrie Wu , Hans Verkuil , Nicolas Dufresne , Nathan Hebert , Arnd Bergmann , Irui Wang , George Sun , , , , , CC: Neil Armstrong , Andrzej Pietrasiewicz , Yilong Zhou Subject: [PATCH v8 5/9] media: mediatek: vcodec: Fix vp9 4096x2176 fail for profile2 Date: Fri, 20 Mar 2026 13:59:36 +0800 Message-ID: <20260320055940.15961-6-kyrie.wu@mediatek.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20260320055940.15961-1-kyrie.wu@mediatek.com> References: <20260320055940.15961-1-kyrie.wu@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-MTK: N Content-Type: text/plain; charset="utf-8" The DRAM address of the VP9 decoder tile info buffers may require as much as 36bits for 4096x2176 resolution. Fold the 4 most significant bits into the lower (padding) four bits of address. Fixes: 5d418351ca8f1 ("media: mediatek: vcodec: support stateless VP9 decod= ing") Signed-off-by: Kyrie Wu Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: Nicolas Dufresne --- .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_r= eq_lat_if.c b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_= req_lat_if.c index 6123666ce1d5..c941bb0f6a62 100644 --- a/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_= if.c +++ b/drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_= if.c @@ -1139,9 +1139,17 @@ static int vdec_vp9_slice_setup_tile_buffer(struct v= dec_vp9_slice_instance *inst return -EINVAL; } tiles->size[i][j] =3D size; + /* + * If the system supports 64-bit DMA addresses, the upper 4 bits + * of the address are also encoded into the buffer entry. + * The buffer pointer (tb) is incremented after each entry is written. + */ if (tiles->mi_rows[i]) { *tb++ =3D (size << 3) + ((offset << 3) & 0x7f); - *tb++ =3D pa & ~0xf; + *tb =3D pa & GENMASK(31, 4); + if (IS_ENABLED(CONFIG_ARCH_DMA_ADDR_T_64BIT)) + *tb |=3D (pa >> 32) & GENMASK(3, 0); + tb++; *tb++ =3D (pa << 3) & 0x7f; mi_row =3D (tiles->mi_rows[i] - 1) & 0x1ff; mi_col =3D (tiles->mi_cols[j] - 1) & 0x3f; --=20 2.45.2