lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <875b24355315311db3a0c846be5f553b3d0c7498.camel@mediatek.com>
Date:   Fri, 13 May 2022 10:57:22 +0800
From:   "yunfei.dong@...iatek.com" <yunfei.dong@...iatek.com>
To:     Hans Verkuil <hverkuil-cisco@...all.nl>,
        Alexandre Courbot <acourbot@...omium.org>,
        Nicolas Dufresne <nicolas@...fresne.ca>,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        Benjamin Gaignard <benjamin.gaignard@...labora.com>,
        Tiffany Lin <tiffany.lin@...iatek.com>,
        Andrew-CT Chen <andrew-ct.chen@...iatek.com>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Rob Herring <robh+dt@...nel.org>,
        Matthias Brugger <matthias.bgg@...il.com>,
        "Tomasz Figa" <tfiga@...gle.com>
CC:     Irui Wang <irui.wang@...iatek.com>,
        George Sun <george.sun@...iatek.com>,
        Steve Cho <stevecho@...omium.org>,
        <devicetree@...r.kernel.org>,
        <Project_Global_Chrome_Upstream_Group@...iatek.com>,
        <linux-kernel@...r.kernel.org>,
        dri-devel <dri-devel@...ts.freedesktop.org>,
        Xiaoyong Lu <xiaoyong.lu@...iatek.com>,
        <linux-mediatek@...ts.infradead.org>,
        Hsin-Yi Wang <hsinyi@...omium.org>,
        Fritz Koenig <frkoenig@...omium.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-media@...r.kernel.org>
Subject: Re: [DKIM] [PATCH v12, 13/17] media: mediatek: vcodec: Extract H264
 common code

Dear Hans,

Thanks for your suggestion.
On Thu, 2022-05-12 at 11:31 +0200, Hans Verkuil wrote:
> Hi Yunfei,
> 
> On 5/12/22 04:19, Yunfei Dong wrote:
> > Mt8192 can use some of common code with mt8183. Moves them to
> > a new file in order to reuse.
> > 
> > Signed-off-by: Yunfei Dong <yunfei.dong@...iatek.com>
> > Reviewed-by: Nicolas Dufresne <nicolas.dufresne@...labora.com>
> > ---
> >  .../media/platform/mediatek/vcodec/Makefile   |   1 +
> >  .../vcodec/vdec/vdec_h264_req_common.c        | 310 +++++++++++++
> >  .../vcodec/vdec/vdec_h264_req_common.h        | 274 +++++++++++
> >  .../mediatek/vcodec/vdec/vdec_h264_req_if.c   | 427 ++----------
> > ------
> >  4 files changed, 629 insertions(+), 383 deletions(-)
> >  create mode 100644
> > drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_common.c
> >  create mode 100644
> > drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_common.h
> > 
> > diff --git a/drivers/media/platform/mediatek/vcodec/Makefile
> > b/drivers/media/platform/mediatek/vcodec/Makefile
> > index 359619653a0e..3f41d748eee5 100644
> > --- a/drivers/media/platform/mediatek/vcodec/Makefile
> > +++ b/drivers/media/platform/mediatek/vcodec/Makefile
> > @@ -9,6 +9,7 @@ mtk-vcodec-dec-y := vdec/vdec_h264_if.o \
> >  		vdec/vdec_vp8_if.o \
> >  		vdec/vdec_vp9_if.o \
> >  		vdec/vdec_h264_req_if.o \
> > +		vdec/vdec_h264_req_common.o \
> >  		mtk_vcodec_dec_drv.o \
> >  		vdec_drv_if.o \
> >  		vdec_vpu_if.o \
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_common.
> > c
> > b/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_common.
> > c
> > new file mode 100644
> > index 000000000000..4e7c9d47751d
> > --- /dev/null
> > +++
> > b/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_common.
> > c
> > @@ -0,0 +1,310 @@
> 
> <snip>
> 
> Here there is still a cast to iomem:
> 
> > +void mtk_vdec_h264_copy_scaling_matrix(struct
> > slice_api_h264_scaling_matrix *dst_matrix,
> > +				       const struct
> > v4l2_ctrl_h264_scaling_matrix *src_matrix)
> > +{
> > +	memcpy_toio((void __iomem *)dst_matrix->scaling_list_4x4,
> > src_matrix->scaling_list_4x4,
> > +		    sizeof(dst_matrix->scaling_list_4x4));
> > +
> > +	memcpy_toio((void __iomem *)dst_matrix->scaling_list_8x8,
> > src_matrix->scaling_list_8x8,
> > +		    sizeof(dst_matrix->scaling_list_8x8));
> > +}
> 
> <snip>
> 
> > diff --git
> > a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c
> > b/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c
> > index 27119aa31dd9..b055ceea481d 100644
> > ---
> > a/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c
> > +++
> > b/drivers/media/platform/mediatek/vcodec/vdec/vdec_h264_req_if.c
> 
> <snip>
> 
> > -static void
> > -get_h264_scaling_matrix(struct slice_api_h264_scaling_matrix
> > *dst_matrix,
> > -			const struct v4l2_ctrl_h264_scaling_matrix
> > *src_matrix)
> > -{
> > -	memcpy(dst_matrix->scaling_list_4x4, src_matrix-
> > >scaling_list_4x4,
> > -	       sizeof(dst_matrix->scaling_list_4x4));
> > -
> > -	memcpy(dst_matrix->scaling_list_8x8, src_matrix-
> > >scaling_list_8x8,
> > -	       sizeof(dst_matrix->scaling_list_8x8));
> > -}
> 
> but that function was moved (AFAICT) from vdec_h264_req_if.c where a
> regular memcpy was
> used.
> 
> Did you miss one iomem case?
> 
> Can I change mtk_vdec_h264_copy_scaling_matrix() to:
> 
> void mtk_vdec_h264_copy_scaling_matrix(struct
> slice_api_h264_scaling_matrix *dst_matrix,
> 				       const struct
> v4l2_ctrl_h264_scaling_matrix *src_matrix)
> {
> 	memcpy(dst_matrix->scaling_list_4x4, src_matrix-
> >scaling_list_4x4,
> 	       sizeof(dst_matrix->scaling_list_4x4));
> 
> 	memcpy(dst_matrix->scaling_list_8x8, src_matrix-
> >scaling_list_8x8,
> 	       sizeof(dst_matrix->scaling_list_8x8));
> }
> 
> If that's OK, then I'll do that manually, so no need to post a v13.
> 
> Everything else looks fine, so this is the only issue that needs to
> be resolved.
> 
> Regards,
> 
1: For h264_req_if.c no need to add __iomem anymore. You can help to
change it directly.

2: Could you please help to add for whole series: Tested-by: NĂ­colas F.
R. A. Prado <nfraprado@...labora.com>

according to Nicolas's mail.

Hi Yunfei,

With this series, and the new scp.img for mt8192 [1] (still waiting to
get
merged), I was able to get the following fluster scores on
mt8192-asurada-spherion:

VP8: 59/61
VP9: 249/303
H.264: 92/135

So for the whole series:

Tested-by: NĂ­colas F. R. A. Prado <nfraprado@...labora.com>

> 	Hans
> 
Best Regards,
Yunfei Dong
> _______________________________________________
> Linux-mediatek mailing list
> Linux-mediatek@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-mediatek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ