Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1799873imm; Thu, 21 Jun 2018 02:34:54 -0700 (PDT) X-Google-Smtp-Source: ADUXVKI7sFLkgTxJH9DPk2TECpgwXFYIEw/mK/lgW08Qc71+ZPIrnVxjncqHXDNGK13yhTf8l1BY X-Received: by 2002:a17:902:345:: with SMTP id 63-v6mr28059474pld.328.1529573694374; Thu, 21 Jun 2018 02:34:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529573694; cv=none; d=google.com; s=arc-20160816; b=mIUvL6qOd96eJP73ayP1CMQReNbQUTry5GB54URNl9wSNn2cPlwfcYxO9mLgkGXxC6 ZhyDNZLlER9dR+eUdytncZqxI84B6ju+8emuQfcd+s+rhv80dwWVe9xBxRqC8f5PijYz P9FbylsdFGaIm6fuesB05SWXBTVi1aAlrz9yn+P3Gp+IvplezKGDbzM2XyVbWRUuNexU 6hei8IuY8D8FJF3qJndOrmg+jZ40FLAfWGfMG7GCJ+XzLaqTW7Ck577/ei7t90aTkNLk 5WWZk26VT+GmODb0aTrEBMdA1/jgINjCXd7prSpVTPBEnePo6z9bzVBRNOTVNsuNNG9n tWKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:references :in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=5hJQenw8Js/N+o99FxOw68gPvYbiwZccowEBb1mjRLU=; b=R+VNHj1DWXTCHK5VTpYKYLEFwecgfgbwkTxWXHd3octFsd/+gCY1tUtJwtQ6fb6nqr uJh+44zxUcKWXc6qHk7jU0GH/CeJbo8P50rFIs+JHad/hwQVKMTNsU5zLSUQypX1N9N5 ybqkuIE08S7cBeV2DT5UuDnYMDycVRrFudKky7E3qJzmVXpo0FazSeSmljpk/PsNit23 Ylf32FkwRHCBbBf7jH09mGzRz+uS2PizdakT2gNJwkaSVibf8deBAvvqvfwhStHMMB2a +1gij/ZJO60a70tiiC88tXK5cmvzujZmSmG8cOcCJAu4Fc+2rnMnVpqhfLm/zPjjVX2c dIaA== 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 o16-v6si3639978pgd.12.2018.06.21.02.34.38; Thu, 21 Jun 2018 02:34:54 -0700 (PDT) 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 S932748AbeFUJd7 (ORCPT + 99 others); Thu, 21 Jun 2018 05:33:59 -0400 Received: from mail.bootlin.com ([62.4.15.54]:48481 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932534AbeFUJd5 (ORCPT ); Thu, 21 Jun 2018 05:33:57 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 141452072B; Thu, 21 Jun 2018 11:33:55 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from aptenodytes (AAubervilliers-681-1-50-153.w90-88.abo.wanadoo.fr [90.88.168.153]) by mail.bootlin.com (Postfix) with ESMTPSA id AA758206D8; Thu, 21 Jun 2018 11:33:44 +0200 (CEST) Message-ID: <4fcfed23bfae158699c23329f92d6f2e968dc062.camel@bootlin.com> Subject: Re: [PATCH 4/9] media: cedrus: make engine type more generic From: Paul Kocialkowski To: Maxime Ripard , hans.verkuil@cisco.com, acourbot@chromium.org, sakari.ailus@linux.intel.com, Laurent Pinchart Cc: tfiga@chromium.org, posciak@chromium.org, Chen-Yu Tsai , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, nicolas.dufresne@collabora.com, jenskuske@gmail.com, linux-sunxi@googlegroups.com, Thomas Petazzoni Date: Thu, 21 Jun 2018 11:33:44 +0200 In-Reply-To: <20180613140714.1686-5-maxime.ripard@bootlin.com> References: <20180613140714.1686-1-maxime.ripard@bootlin.com> <20180613140714.1686-5-maxime.ripard@bootlin.com> Organization: Bootlin Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-7wU1Tez5FhraT+rPcUE/" X-Mailer: Evolution 3.28.2 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-7wU1Tez5FhraT+rPcUE/ Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Wed, 2018-06-13 at 16:07 +0200, Maxime Ripard wrote: > The sunxi_cedrus_engine enum actually enumerates pretty much the codecs t= o > use (or we can easily infer the codec engine from the codec). >=20 > Since we will need the codec type as well in some later refactoring, make > that structure more useful by just enumerating the codec, and converting > the existing users. With the comment below taken in account, this is: Acked-by: Paul Kocialkowski > Signed-off-by: Maxime Ripard > --- > drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h | 6 ++++++ > drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c | 6 +++--- > drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h | 6 +----- > drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c | 2 +- > 4 files changed, 11 insertions(+), 9 deletions(-) >=20 > diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h b/= drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h > index b1ed1c8cb130..a5f83c452006 100644 > --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h > +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h > @@ -61,6 +61,12 @@ struct sunxi_cedrus_run { > }; > }; > =20 > +enum sunxi_cedrus_codec { Feel free to rename to cedrus_codec when rebasing on top of the latest patchset introducing the driver. Cheers, Paul > + SUNXI_CEDRUS_CODEC_MPEG2, > + > + SUNXI_CEDRUS_CODEC_LAST, > +}; > + > struct sunxi_cedrus_ctx { > struct v4l2_fh fh; > struct sunxi_cedrus_dev *dev; > diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c b/driv= ers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c > index fc688a5c1ea3..bb46a01214e0 100644 > --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c > +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c > @@ -41,7 +41,7 @@ > #define SYSCON_SRAM_C1_MAP_VE 0x7fffffff > =20 > int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev, > - enum sunxi_cedrus_engine engine) > + enum sunxi_cedrus_codec codec) > { > u32 reg =3D 0; > =20 > @@ -53,8 +53,8 @@ int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev = *dev, > =20 > reg |=3D VE_CTRL_CACHE_BUS_BW_128; > =20 > - switch (engine) { > - case SUNXI_CEDRUS_ENGINE_MPEG: > + switch (codec) { > + case SUNXI_CEDRUS_CODEC_MPEG2: > reg |=3D VE_CTRL_DEC_MODE_MPEG; > break; > =20 > diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h b/driv= ers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h > index 34f3fae462a8..3236c80bfcf4 100644 > --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h > +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.h > @@ -23,12 +23,8 @@ > #ifndef _SUNXI_CEDRUS_HW_H_ > #define _SUNXI_CEDRUS_HW_H_ > =20 > -enum sunxi_cedrus_engine { > - SUNXI_CEDRUS_ENGINE_MPEG, > -}; > - > int sunxi_cedrus_engine_enable(struct sunxi_cedrus_dev *dev, > - enum sunxi_cedrus_engine engine); > + enum sunxi_cedrus_codec codec); > void sunxi_cedrus_engine_disable(struct sunxi_cedrus_dev *dev); > =20 > int sunxi_cedrus_hw_probe(struct sunxi_cedrus_dev *dev); > diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c b/d= rivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c > index 5be3e3b9ceef..85e6fc2fbdb2 100644 > --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c > +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_mpeg2.c > @@ -83,7 +83,7 @@ void sunxi_cedrus_mpeg2_setup(struct sunxi_cedrus_ctx *= ctx, > } > =20 > /* Activate MPEG engine. */ > - sunxi_cedrus_engine_enable(dev, SUNXI_CEDRUS_ENGINE_MPEG); > + sunxi_cedrus_engine_enable(dev, SUNXI_CEDRUS_CODEC_MPEG2); > =20 > /* Set quantization matrices. */ > for (i =3D 0; i < 64; i++) { --=20 Paul Kocialkowski, Bootlin (formerly Free Electrons) Embedded Linux and kernel engineering https://bootlin.com --=-7wU1Tez5FhraT+rPcUE/ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAlsrcPgACgkQ3cLmz3+f v9GxTwf/TJCCcwCC3Rv2+rY85tD/+4wVMDu1JncGIkjS04EpWaDeHeO3SBgPU7Dr 9O8/rNPsujLDshuzU1dMFg0DATVfi/gC8TidPgKZRlzjzvKDijLKHpF6xbULHHQZ t+u47yVw6LJnsLNiMCoe4lV+cryd8VH1qWNkC+KxBXFO7pnHPwlNou0LFbQr02oI ZlKmqXCLOSqZxAigIfnTIWhrWdtv0Fq6d2YixXoFxlsB4idOyEtvCmT+TOXAwlTt oem23/JJfZ7RgbOc/DMFoOkITN8fEggA3VnVkURd/7Iv85pQ9y40qwWc1DUtaS5H 9p0wDDf/RdeWFXvQUJP1q0eJVwrSPA== =5Sa5 -----END PGP SIGNATURE----- --=-7wU1Tez5FhraT+rPcUE/--