From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C681FC47088 for ; Wed, 26 May 2021 10:12:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A3C8461440 for ; Wed, 26 May 2021 10:12:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233861AbhEZKNt (ORCPT ); Wed, 26 May 2021 06:13:49 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:59462 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233700AbhEZKNn (ORCPT ); Wed, 26 May 2021 06:13:43 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 2B35B1F40AFD Message-ID: <06d5432c44d3b4d6129891c46cc62f0edf735cf7.camel@collabora.com> Subject: Re: [PATCH v11 8/9] media: hantro: Introduce G2/HEVC decoder From: Ezequiel Garcia To: Benjamin Gaignard , p.zabel@pengutronix.de, mchehab@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, gregkh@linuxfoundation.org, mripard@kernel.org, paul.kocialkowski@bootlin.com, wens@csie.org, jernej.skrabec@siol.net, emil.l.velikov@gmail.com, Andrzej Pietrasiewicz Cc: kernel@pengutronix.de, linux-imx@nxp.com, linux-media@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Adrian Ratiu Date: Wed, 26 May 2021 07:12:00 -0300 In-Reply-To: <20210525161238.1191168-9-benjamin.gaignard@collabora.com> References: <20210525161238.1191168-1-benjamin.gaignard@collabora.com> <20210525161238.1191168-9-benjamin.gaignard@collabora.com> Organization: Collabora Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.38.2-1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Benjamin, (Adding Andrzej) On Tue, 2021-05-25 at 18:12 +0200, Benjamin Gaignard wrote: > Implement all the logic to get G2 hardware decoding HEVC frames. > It supports up level 5.1 HEVC stream. > It doesn't support yet 10 bits formats or the scaling feature. > > Add HANTRO HEVC dedicated control to skip some bits at the beginning > of the slice header. That is very specific to this hardware so can't > go into uapi structures. Computing the needed value is complex and requires > information from the stream that only the userland knows so let it > provide the correct value to the driver. > > Signed-off-by: Benjamin Gaignard > Co-developed-by: Adrian Ratiu > Signed-off-by: Adrian Ratiu > Co-developed-by: Ezequiel Garcia > Signed-off-by: Ezequiel Garcia > --- [..] > diff --git a/drivers/staging/media/hantro/hantro_g2_regs.h b/drivers/staging/media/hantro/hantro_g2_regs.h > new file mode 100644 > index 000000000000..2477573f7163 > --- /dev/null > +++ b/drivers/staging/media/hantro/hantro_g2_regs.h > @@ -0,0 +1,198 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Copyright (c) 2021, Collabora > + * > + * Author: Benjamin Gaignard > + */ > + > +#ifndef HANTRO_G2_REGS_H_ > +#define HANTRO_G2_REGS_H_ > + > +#include "hantro.h" > + > +#define G2_SWREG(nr)   ((nr) * 4) > + > +#define HEVC_DEC_REG(name, base, shift, mask) \ > +       static const struct hantro_reg _hevc_##name[] = { \ > +               { G2_SWREG(base), (shift), (mask) } \ > +       }; \ > +       static const struct hantro_reg __maybe_unused *hevc_##name = &_hevc_##name[0]; > + > +#define HEVC_REG_VERSION               G2_SWREG(0) > + > +#define HEVC_REG_INTERRUPT             G2_SWREG(1) These definitions seem valid across G2 and not something specific to HEVC, so can we rename (the ones that make sense) to G2_ ? That would allow to reuse them for VP9 with a smaller gap. Thanks, Ezequiel