Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp282681imu; Fri, 25 Jan 2019 02:11:07 -0800 (PST) X-Google-Smtp-Source: ALg8bN5ADNpFJBmO6wYZbHpCINRAjB2WdWxdAZovKTb3foAFvl/HfABRDfOdcv4U2fuHkON8ysKS X-Received: by 2002:a17:902:925:: with SMTP id 34mr9968485plm.14.1548411067571; Fri, 25 Jan 2019 02:11:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548411067; cv=none; d=google.com; s=arc-20160816; b=S6zVi+3xnkzBBwQcgBHbTdHi+fk2cpLMMW+PEGGZkaKNgocuVmfeYbaNRMJbE0L6hF +CM4fJvwJHxGiwGrZMin5s+SJxMkuhTG9djaPIBYYtig65yDOL6/m4w2l9Umba4ss3PR MP5BHS5kXZ9RIpIxIZGp8mTss6aBJzWQ7dmzm0SxKWaTKu/RiIfHeLh+ZMMejGHJm2Ue 4x0vtHHyjOPgCtLvJOz9aUL5/UlTQjs8bBPdxt/DVJJXkMlGFgWP3mVzZAe8+28+4RPt D9DwqK4sPbdbJxZuay3j3mfm36cdYcMLEe4Qd6VJKt3sx5QtZIZWtkEgLhlE6f4Gt8Gr ndUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=ovp06b6N0vnJRqYfeQZlqr2thPq9ZXuMg77G16JUwfs=; b=HBhV7GY0EZdOmFTIcTgxMYYWUER8u34gIhOXVGEk6fefYXSFg3LTTZZjC9EI17rj+j GFLLCkkP4WeSg1nbBnn6FfzfQ7PHy72F7CHSO4MU9OV0uEVidYMIA5AZiJoEkWONOd7+ rNo6P7M89RfiWTWlxGvh4ycNggGVxbVa7Tzi4NDVmSqXd/r3/zQl0fZ1PTTW+6LVpRbQ Nkz1PDveES8LQKLWJ8xyQ4S2lmxdJkFOn0uP45Unzj1FHczBQa7LkIcerV+BkyvCEWCT rrjHFHUOzESVFWot6Igp5ohkIUkJaGq8fso8KS7d3jpsih9u59WTnP3T0FJTQQO/C8vk r4zQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g66si25991194pgc.226.2019.01.25.02.10.52; Fri, 25 Jan 2019 02:11:07 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729211AbfAYKKF (ORCPT + 99 others); Fri, 25 Jan 2019 05:10:05 -0500 Received: from mail.bootlin.com ([62.4.15.54]:43524 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728917AbfAYKKE (ORCPT ); Fri, 25 Jan 2019 05:10:04 -0500 Received: by mail.bootlin.com (Postfix, from userid 110) id D4F8A20798; Fri, 25 Jan 2019 11:10:01 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.2 Received: from localhost (aaubervilliers-681-1-87-206.w90-88.abo.wanadoo.fr [90.88.29.206]) by mail.bootlin.com (Postfix) with ESMTPSA id A49B9206A6; Fri, 25 Jan 2019 11:10:01 +0100 (CET) Date: Fri, 25 Jan 2019 11:10:02 +0100 From: Maxime Ripard To: Paul Kocialkowski Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, Mauro Carvalho Chehab , linux-sunxi@googlegroups.com, Randy Li , Hans Verkuil , Ezequiel Garcia , Tomasz Figa , Alexandre Courbot , Thomas Petazzoni Subject: Re: [PATCH v2 2/2] media: cedrus: Add HEVC/H.265 decoding support Message-ID: <20190125101002.z5ftls5xo7izygvy@flea> References: <20181123130209.11696-1-paul.kocialkowski@bootlin.com> <20181123130209.11696-3-paul.kocialkowski@bootlin.com> <20181127082119.xdemdwgclai7kj3r@flea> <4f25de5bbcb7bf196fe4925f54e3335b50670bd2.camel@bootlin.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="z6zsvccsx3aejq2d" Content-Disposition: inline In-Reply-To: <4f25de5bbcb7bf196fe4925f54e3335b50670bd2.camel@bootlin.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --z6zsvccsx3aejq2d Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Thu, Jan 24, 2019 at 02:10:25PM +0100, Paul Kocialkowski wrote: > On Tue, 2018-11-27 at 09:21 +0100, Maxime Ripard wrote: > > Hi! > >=20 > > On Fri, Nov 23, 2018 at 02:02:09PM +0100, Paul Kocialkowski wrote: > > > This introduces support for HEVC/H.265 to the Cedrus VPU driver, with > > > both uni-directional and bi-directional prediction modes supported. > > >=20 > > > Field-coded (interlaced) pictures, custom quantization matrices and > > > 10-bit output are not supported at this point. > > >=20 > > > Signed-off-by: Paul Kocialkowski > >=20 > > Output from checkpatch: > > total: 0 errors, 68 warnings, 14 checks, 999 lines checked >=20 > Looks like many of the "line over 80 chars" are due to macros. I don't > think it would be a good idea to break them down or to change the > macros names since they are directly inherited from the bitstream > elements. >=20 > What do you think? Yeah, the 80-chars limit can be ignored. But there's more warnings and checks that should be addressed. > > > + /* Output frame. */ > > > + > > > + output_pic_list_index =3D V4L2_HEVC_DPB_ENTRIES_NUM_MAX; > > > + pic_order_cnt[0] =3D pic_order_cnt[1] =3D slice_params->slice_pic_o= rder_cnt; > > > + mv_col_buf_addr[0] =3D cedrus_h265_frame_info_mv_col_buf_addr(ctx, > > > + run->dst->vb2_buf.index, 0) - PHYS_OFFSET; > > > + mv_col_buf_addr[1] =3D cedrus_h265_frame_info_mv_col_buf_addr(ctx, > > > + run->dst->vb2_buf.index, 1) - PHYS_OFFSET; > > > + dst_luma_addr =3D cedrus_dst_buf_addr(ctx, run->dst->vb2_buf.index,= 0) - > > > + PHYS_OFFSET; > > > + dst_chroma_addr =3D cedrus_dst_buf_addr(ctx, run->dst->vb2_buf.inde= x, 1) - > > > + PHYS_OFFSET; > > > + > > > + cedrus_h265_frame_info_write_single(dev, output_pic_list_index, > > > + slice_params->pic_struct !=3D 0, > > > + pic_order_cnt, mv_col_buf_addr, > > > + dst_luma_addr, dst_chroma_addr); > >=20 > > You can only pass the run and slice_params pointers to that function. >=20 > The point is to make it independent from the context, so that the same > function can be called with either the slice_params or the dpb info. > I don't think making two variants or even two wrappers would bring any > significant benefit. Then you can still pass directly the vb2 buffer pointer, that would remove the mv_col_buf_addr, dst_luma_addr and dst_chroma_addr. The idea here is that the less arguments you have in your function, the easier it is to understand. > > > + > > > + cedrus_write(dev, VE_DEC_H265_OUTPUT_FRAME_IDX, output_pic_list_ind= ex); > > > + > > > + /* Reference picture list 0 (for P/B frames). */ > > > + if (slice_params->slice_type !=3D V4L2_HEVC_SLICE_TYPE_I) { > > > + cedrus_h265_ref_pic_list_write(dev, slice_params->ref_idx_l0, > > > + slice_params->num_ref_idx_l0_active_minus1 + 1, > > > + slice_params->dpb, slice_params->num_active_dpb_entries, > > > + VE_DEC_H265_SRAM_OFFSET_REF_PIC_LIST0); > > > + > >=20 > > slice_params is enough. >=20 > The rationale is similar to the one above: being able to use the same > helper with either L0 or L1, which implies passing the relevant > elements directly. The DPB and num_active_dpb_entries will not change from one run to the other though. And having intermediate functions if that allows to be clearer is fine as well. Maxime --=20 Maxime Ripard, Bootlin Embedded Linux and Kernel engineering https://bootlin.com --z6zsvccsx3aejq2d Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCXErgegAKCRDj7w1vZxhR xRsaAQC2ViWDkwRbE+VzfnvT6IM2IOggLnD2AO3axObHgVowZwEAsoum8jkX4cu3 0xmBF8qYXaO9qf+KUl0tIhsEPcj2dQA= =H23o -----END PGP SIGNATURE----- --z6zsvccsx3aejq2d--