Message ID | 20240301020126.11539-1-yunfei.dong@mediatek.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-87810-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:2097:b0:108:e6aa:91d0 with SMTP id gs23csp805544dyb; Thu, 29 Feb 2024 18:02:36 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXtaSF5/iiXImyQo1lNyTBKxYrbyZ8uwBnWlES2eKJxwoxmhhP8wC/lCHY0KckwwRHO52XKJrqB/eU5pC0+bzFSreGzRg== X-Google-Smtp-Source: AGHT+IHgUP/6on+GuWp+s7d5b53qiCXJHLkpp0R2zfl9atP7z8xb2yhww2wuxHfcg+QRft62ppkl X-Received: by 2002:a17:906:361b:b0:a3f:4eaf:ec66 with SMTP id q27-20020a170906361b00b00a3f4eafec66mr225407ejb.25.1709258556287; Thu, 29 Feb 2024 18:02:36 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709258556; cv=pass; d=google.com; s=arc-20160816; b=r8ZnKPzMYcNHCwOx9iUFMwGP6DyGHiYK31g7iiWTCgqFFsyL0eR2qeLnonYHn/Lrei NC58J/HljUYr/hD0URbMYQmeWMgIC2TZpxrHy4gug/gunaFMGfXaKnYjt0gjhqqSfg9K 6e4cD4MiuJL5DfwUCRHuT1oTrGDHU/Qzu498DGXOdNzKqE6GzvkvT5fAvCU6lkh4L1R5 l/4/Q3NiO9yJxyA5VEh7nTU9aXssEDJE7QRl5JzqAaekcvWvPFx1qJKZ23v2jXhWX395 3D2T5YMl1nIh1EHp/U9hfcGMGuqvMHDSzuYwOyGUPzz05WEzPHrIhf20lwiL1QadDJiL 558Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=HBS1I/NOgPbbX1oZFpsgk/1CALyAPNq0suP+PJ3XesU=; fh=rYZqDNP63tf6+qk2gsh/u90wMd8bq0irMF7JOMts8X8=; b=hoTioDvmWA/zFb8J7bL+VolH0oOSu6KA3nxb/oLIfGfYRqRmhHDqmSraZfauITjA93 XT4zBocECmAD7QPuSiF+de97mZLQqhgDagCqsqiM6ItbU6kvdfFjJFbBdgcDRfpY8kM0 QHC+604zPBAzr9djlDAWbymqLXp1qElonAZHuJplUULLMq9ardz8FRimB3iJmdgVI0L/ XtRgdoDcGAmwiMu5OvBZAKxKVkVJvKqu95jF6WxTvieAWdS51lcmw7FVSk9SZmZ2pE1s 8AV/uzWtQ3loGwo5nUb3ZeDKGr15Agp06vPse/LbQKzOyllVQ5jU8gIgyJbVcJwAfMXy 2xsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=F++7zWSI; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-87810-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87810-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id qw28-20020a1709066a1c00b00a4356d767ddsi1079646ejc.793.2024.02.29.18.02.36 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 29 Feb 2024 18:02:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-87810-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=F++7zWSI; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-87810-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-87810-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D541F1F24606 for <ouuuleilei@gmail.com>; Fri, 1 Mar 2024 02:02:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id AD13539AC9; Fri, 1 Mar 2024 02:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="F++7zWSI" 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 8B961FC03; Fri, 1 Mar 2024 02:01:45 +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=1709258508; cv=none; b=Wwaa+FteXBNnHI1o520Jm/ZTWwxz3pVse6dlSzg4yQ0upWG84S/gCsKhCCdqf2R7je+lzEJzR0WWJAtnKWuS8wvv3ECIBOxNxN5hdsHv08asixAXPrZ5cSngb5TwHxT7+hrI8XXdJthqYjURZiimd4xIMOcfkW+2FdFVIDEJMIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709258508; c=relaxed/simple; bh=qL6ryTGcMgCNWUne3Xb4F08g2n+lnz0zgQg6XVOU8ZY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=iRk6fuagQYSCAd83Nv9OykEWFtSTMaT8dRNDgN/6xiKEUAWFPxQCFO9ZGkq38ziV2U99MyQT8JT+k7OM48J5OMzeN0Z/BMz4BCr6FgUCI+TRZoR3JmqJq5eBdgMnHze4OcrOh8BatZitF88CzPdCuAtpGo4dKTfBdtSrP3V9HQU= 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=F++7zWSI; 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 X-UUID: 9fa86d68d76f11eeb8927bc1f75efef4-20240301 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:Message-ID:Date:Subject:CC:To:From; bh=HBS1I/NOgPbbX1oZFpsgk/1CALyAPNq0suP+PJ3XesU=; b=F++7zWSIF/rtO46xP5XMrm5P6hDqrY4yxfJE7EF1ORCuygCyGTeNkWAkKbqbhdvgrqqmjmrfCjJqf415/pPlZJq8QWVf6Z0jbytmK5cwzKKrVFW9XA4Ni39QTAdSas+gpZ8SanxipNyasWGa2TbXIxExH8WNGBlI51egEPv/VMI=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.37,REQID:dead455a-5c7c-44f8-81b6-dcbfbd48f4bf,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:6f543d0,CLOUDID:cde97984-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:11|1,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES :1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_ULN X-UUID: 9fa86d68d76f11eeb8927bc1f75efef4-20240301 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from <yunfei.dong@mediatek.com>) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 176012849; Fri, 01 Mar 2024 10:01:31 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) 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.1118.26; Fri, 1 Mar 2024 10:01:29 +0800 Received: from mhfsdcap04.gcn.mediatek.inc (10.17.3.154) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 1 Mar 2024 10:01:28 +0800 From: Yunfei Dong <yunfei.dong@mediatek.com> To: =?utf-8?q?N=C3=ADcolas_F_=2E_R_=2E_A_=2E_Prado?= <nfraprado@collabora.com>, Nicolas Dufresne <nicolas.dufresne@collabora.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>, Benjamin Gaignard <benjamin.gaignard@collabora.com>, Nathan Hebert <nhebert@chromium.org> CC: Hsin-Yi Wang <hsinyi@chromium.org>, Fritz Koenig <frkoenig@chromium.org>, Daniel Vetter <daniel@ffwll.ch>, Steve Cho <stevecho@chromium.org>, "Yunfei Dong" <yunfei.dong@mediatek.com>, <linux-media@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, <linux-mediatek@lists.infradead.org>, <Project_Global_Chrome_Upstream_Group@mediatek.com> Subject: [PATCH] media: mediatek: vcodec: support 36bit physical address Date: Fri, 1 Mar 2024 10:01:26 +0800 Message-ID: <20240301020126.11539-1-yunfei.dong@mediatek.com> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--8.986100-8.000000 X-TMASE-MatchedRID: MXmpjVMQBvchu4G5/VkGwwPZZctd3P4B7f6JAS2hKPgUtdRZTmEaIb9n SsB9y3SmXfLeWSJ8nKvcFPFR1xoqQh8TzIzimOwPC24oEZ6SpSkj80Za3RRg8Nr8k9p6q6xQ8XR JHb0N4gK2+HtcNQgId7UxHy5DZGDPwaVEpyapekM= X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--8.986100-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: 81F330C20FD882D5E9A3FF4558755189B19F9D12D06F1B64C5360A96E6826FDE2000:8 X-MTK: N X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1792287499574381112 X-GMAIL-MSGID: 1792287499574381112 |
Series |
media: mediatek: vcodec: support 36bit physical address
|
|
Commit Message
Yunfei Dong (董云飞)
March 1, 2024, 2:01 a.m. UTC
The physical address is beyond 32bit for mt8188 platform, need
to change the type from unsigned int to unsigned long in case of
the high bit missing.
Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com>
---
.../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Il 01/03/24 03:01, Yunfei Dong ha scritto: > The physical address is beyond 32bit for mt8188 platform, need > to change the type from unsigned int to unsigned long in case of > the high bit missing. > > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> > --- > .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git 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 > index cf48d09b78d7..85df3e7c2983 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 > @@ -1074,7 +1074,7 @@ static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *inst > unsigned int mi_row; > unsigned int mi_col; > unsigned int offset; > - unsigned int pa; > + unsigned long pa; If you used the right type from the beginning, you wouldn't have to fix that ;-) Is there any reason why you didn't - and still don't use the `phys_addr_t` type for the `pa` member? Cheers, Angelo > unsigned int size; > struct vdec_vp9_slice_tiles *tiles; > unsigned char *pos; > @@ -1109,7 +1109,7 @@ static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *inst > pos = va + offset; > end = va + bs->size; > /* truncated */ > - pa = (unsigned int)bs->dma_addr + offset; > + pa = (unsigned long)bs->dma_addr + offset; > tb = instance->tile.va; > for (i = 0; i < rows; i++) { > for (j = 0; j < cols; j++) {
Hi AngeloGioacchino, Thanks for you reviewing. On Fri, 2024-03-01 at 10:03 +0100, AngeloGioacchino Del Regno wrote: > Il 01/03/24 03:01, Yunfei Dong ha scritto: > > The physical address is beyond 32bit for mt8188 platform, need > > to change the type from unsigned int to unsigned long in case of > > the high bit missing. > > > > Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> > > --- > > .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 4 > > ++-- > > 1 file changed, 2 insertions(+), 2 deletions(-) > > > > diff --git > > 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 > > index cf48d09b78d7..85df3e7c2983 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 > > @@ -1074,7 +1074,7 @@ static int > > vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance > > *inst > > unsigned int mi_row; > > unsigned int mi_col; > > unsigned int offset; > > - unsigned int pa; > > + unsigned long pa; > > If you used the right type from the beginning, you wouldn't have to > fix that ;-) > Yes, you are right, thanks for your remind. > Is there any reason why you didn't - and still don't use the > `phys_addr_t` type > for the `pa` member? > pa is also iova, dma address. Change it to dma_addr_t looks much better. I will change it in next patch. > Cheers, > Angelo > Best Regards, Yunfei Dong > > unsigned int size; > > struct vdec_vp9_slice_tiles *tiles; > > unsigned char *pos; > > @@ -1109,7 +1109,7 @@ static int > > vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance > > *inst > > pos = va + offset; > > end = va + bs->size; > > /* truncated */ > > - pa = (unsigned int)bs->dma_addr + offset; > > + pa = (unsigned long)bs->dma_addr + offset; > > tb = instance->tile.va; > > for (i = 0; i < rows; i++) { > > for (j = 0; j < cols; j++) { > >
Il 01/03/24 10:23, Yunfei Dong (董云飞) ha scritto: > Hi AngeloGioacchino, > > Thanks for you reviewing. > On Fri, 2024-03-01 at 10:03 +0100, AngeloGioacchino Del Regno wrote: >> Il 01/03/24 03:01, Yunfei Dong ha scritto: >>> The physical address is beyond 32bit for mt8188 platform, need >>> to change the type from unsigned int to unsigned long in case of >>> the high bit missing. >>> >>> Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> >>> --- >>> .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 4 >>> ++-- >>> 1 file changed, 2 insertions(+), 2 deletions(-) >>> >>> diff --git >>> 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 >>> index cf48d09b78d7..85df3e7c2983 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 >>> @@ -1074,7 +1074,7 @@ static int >>> vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance >>> *inst >>> unsigned int mi_row; >>> unsigned int mi_col; >>> unsigned int offset; >>> - unsigned int pa; >>> + unsigned long pa; >> >> If you used the right type from the beginning, you wouldn't have to >> fix that ;-) >> > Yes, you are right, thanks for your remind. >> Is there any reason why you didn't - and still don't use the >> `phys_addr_t` type >> for the `pa` member? >> > pa is also iova, dma address. Change it to dma_addr_t looks much > better. > Ok, dma_addr_t looks good as well. Cheers! > I will change it in next patch. >> Cheers, >> Angelo >> > Best Regards, > Yunfei Dong >>> unsigned int size; >>> struct vdec_vp9_slice_tiles *tiles; >>> unsigned char *pos; >>> @@ -1109,7 +1109,7 @@ static int >>> vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance >>> *inst >>> pos = va + offset; >>> end = va + bs->size; >>> /* truncated */ >>> - pa = (unsigned int)bs->dma_addr + offset; >>> + pa = (unsigned long)bs->dma_addr + offset; >>> tb = instance->tile.va; >>> for (i = 0; i < rows; i++) { >>> for (j = 0; j < cols; j++) { >> >>
Hey Yunfei, On 01.03.2024 10:01, Yunfei Dong wrote: >The physical address is beyond 32bit for mt8188 platform, need >to change the type from unsigned int to unsigned long in case of >the high bit missing. I would reword this a bit, the address is not beyond 32 bit, which would could be interpret as if the address starts after 32nd bit, instead it is larger than 32bits. Secondly, we don't change the type in case the high bit is missing, we change the type unconditionally, we do change the type so that the high bit isn't missing. My suggestion: The physical address on the MT8188 platform is larger than 32 bits, change the type from unsigned int to unsigned long to be able to access the high bits of the address. One more question below... > >Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> >--- > .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > >diff --git 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 >index cf48d09b78d7..85df3e7c2983 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 >@@ -1074,7 +1074,7 @@ static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *inst > unsigned int mi_row; > unsigned int mi_col; > unsigned int offset; >- unsigned int pa; >+ unsigned long pa; > unsigned int size; > struct vdec_vp9_slice_tiles *tiles; > unsigned char *pos; >@@ -1109,7 +1109,7 @@ static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *inst > pos = va + offset; > end = va + bs->size; > /* truncated */ >- pa = (unsigned int)bs->dma_addr + offset; >+ pa = (unsigned long)bs->dma_addr + offset; I can see in other parts of the driver that bs->dma_addr is converted to u64 or uint64_t. Is unsigned long always 64-bit on the different Mediatek platforms? If so, why do you prefer unsigned long over u64? (Which describes the type more precisely) (Same applies for: drivers/media/platform/mediatek/vcodec/decoder/vdec/vdec_vp8_if.c:452) Greetings, Sebastian > tb = instance->tile.va; > for (i = 0; i < rows; i++) { > for (j = 0; j < cols; j++) { >-- >2.18.0 > >
Hey Yunfei, On 01.03.2024 10:36, AngeloGioacchino Del Regno wrote: >Il 01/03/24 10:23, Yunfei Dong (董云飞) ha scritto: >>Hi AngeloGioacchino, >> >>Thanks for you reviewing. >>On Fri, 2024-03-01 at 10:03 +0100, AngeloGioacchino Del Regno wrote: >>>Il 01/03/24 03:01, Yunfei Dong ha scritto: >>>>The physical address is beyond 32bit for mt8188 platform, need >>>>to change the type from unsigned int to unsigned long in case of >>>>the high bit missing. >>>> >>>>Signed-off-by: Yunfei Dong <yunfei.dong@mediatek.com> >>>>--- >>>> .../mediatek/vcodec/decoder/vdec/vdec_vp9_req_lat_if.c | 4 >>>>++-- >>>> 1 file changed, 2 insertions(+), 2 deletions(-) >>>> >>>>diff --git >>>>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 >>>>index cf48d09b78d7..85df3e7c2983 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 >>>>@@ -1074,7 +1074,7 @@ static int >>>>vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance >>>>*inst >>>> unsigned int mi_row; >>>> unsigned int mi_col; >>>> unsigned int offset; >>>>- unsigned int pa; >>>>+ unsigned long pa; >>> >>>If you used the right type from the beginning, you wouldn't have to >>>fix that ;-) >>> >>Yes, you are right, thanks for your remind. >>>Is there any reason why you didn't - and still don't use the >>>`phys_addr_t` type >>>for the `pa` member? >>> >>pa is also iova, dma address. Change it to dma_addr_t looks much >>better. >> > >Ok, dma_addr_t looks good as well. Ah alright, disregard my comment about unsigned long vs u64 then, but please have a look at the other casts in the driver as well as you currently cast to either: - u64 - uint64_t - unsigned long Greetings, Sebastian > >Cheers! > >>I will change it in next patch. >>>Cheers, >>>Angelo >>> >>Best Regards, >>Yunfei Dong >>>> unsigned int size; >>>> struct vdec_vp9_slice_tiles *tiles; >>>> unsigned char *pos; >>>>@@ -1109,7 +1109,7 @@ static int >>>>vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance >>>>*inst >>>> pos = va + offset; >>>> end = va + bs->size; >>>> /* truncated */ >>>>- pa = (unsigned int)bs->dma_addr + offset; >>>>+ pa = (unsigned long)bs->dma_addr + offset; >>>> tb = instance->tile.va; >>>> for (i = 0; i < rows; i++) { >>>> for (j = 0; j < cols; j++) { >>> >>> > >
diff --git 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 index cf48d09b78d7..85df3e7c2983 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 @@ -1074,7 +1074,7 @@ static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *inst unsigned int mi_row; unsigned int mi_col; unsigned int offset; - unsigned int pa; + unsigned long pa; unsigned int size; struct vdec_vp9_slice_tiles *tiles; unsigned char *pos; @@ -1109,7 +1109,7 @@ static int vdec_vp9_slice_setup_tile_buffer(struct vdec_vp9_slice_instance *inst pos = va + offset; end = va + bs->size; /* truncated */ - pa = (unsigned int)bs->dma_addr + offset; + pa = (unsigned long)bs->dma_addr + offset; tb = instance->tile.va; for (i = 0; i < rows; i++) { for (j = 0; j < cols; j++) {