Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp4034311imm; Mon, 25 Jun 2018 08:39:17 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJ6lLRwWhxaMn9JN7w+X56KINnPWD+Kj1/Qv9Q+gpWYrys6BQXkEuvLIe3zzZ32fPxQtoY8 X-Received: by 2002:a62:6b06:: with SMTP id g6-v6mr13492886pfc.96.1529941157175; Mon, 25 Jun 2018 08:39:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529941157; cv=none; d=google.com; s=arc-20160816; b=BGumXPcveUnmy8Ib1IDAW/4WnOKovAZHCmhaZku7q4t7fY93uR//BxnJwsT+ZNxMq0 TeEJ77HrWZLjgLRVc6swnMK0ivSFMIOMkCAockn8sDaI2FnHV5WFy19Fc8W0NsmNmGK/ CAukHfXZcl76tLCoZ1Qtin32ojciLhlj9XVgZw0K4FRhikwYvl7MYnpEn2KkXQ0oJlz6 fclMETOdtjmmYQTJqXbrUGWojoAV5bliJJfh42kKR5FQtgRrfTIGBRBlXYut1iaxcHQT w/WABYVxbsDX5OdKh5pFg2z0JvbWLPDconea11TEZ9GvTRKE3nHXm/jsEyusFi6hA+6R /jLg== 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=aJtVadcH4Av1JhNECAGObTQ8VNxtVRhlt/NfM/ZOmbo=; b=d5eGQt4c1V6Fv3WdVn6kWA2Ub/K2XYRHvr6HkrUdlNHzO1oGXZKcXIvaBurEb1wA+/ KP0MSByo9h/Ef1z2sMS+Kql4Z3zvQcHP8h6dZxuYcqqOs74rVmFJDESDlTzqUDfGaswu x+jby0qDTYb50oH15LShctayWrKT4jrdiFbimFLjo1V9tJM25hADfFbCgQWpWMz3gK80 LfRxk8IHU71ui68kPoWr9xkhIc3TxbY5ee5WWL6NFLVvTmcQ5W2mEYs41V1DYPMsRfrt Z7fQbG67s+VNdqrafnXThU2nm0XbVKJDZGGujKs/acBl94PP0Eaxu+w6nlN2jsvOz12x 8Lvg== 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 c18-v6si13474633pfn.245.2018.06.25.08.39.02; Mon, 25 Jun 2018 08:39:17 -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 S1752320AbeFYPiP (ORCPT + 99 others); Mon, 25 Jun 2018 11:38:15 -0400 Received: from mail.bootlin.com ([62.4.15.54]:58526 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752224AbeFYPiM (ORCPT ); Mon, 25 Jun 2018 11:38:12 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 9A221206A0; Mon, 25 Jun 2018 17:38:10 +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-87-188.w90-88.abo.wanadoo.fr [90.88.29.188]) by mail.bootlin.com (Postfix) with ESMTPSA id 3DAA6203B4; Mon, 25 Jun 2018 17:38:10 +0200 (CEST) Message-ID: Subject: Re: [PATCH 7/9] media: cedrus: Move IRQ maintainance to cedrus_dec_ops 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: Mon, 25 Jun 2018 17:38:10 +0200 In-Reply-To: <20180613140714.1686-8-maxime.ripard@bootlin.com> References: <20180613140714.1686-1-maxime.ripard@bootlin.com> <20180613140714.1686-8-maxime.ripard@bootlin.com> Organization: Bootlin Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-IEAekvlujL4VhhCQES3c" 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 --=-IEAekvlujL4VhhCQES3c 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 IRQ handler up until now was hardcoding the use of the MPEG engine to > read the interrupt status, clear it and disable the interrupts. >=20 > Obviously, that won't work really well with the introduction of new codec= s > that use a separate engine with a separate register set. >=20 > In order to make this more future proof, introduce new decodec operations > to deal with the interrupt management. The only one missing is the one to > enable the interrupts in the first place, but that's taken care of by the > trigger hook for now. Here's another comment about an issue I just figured out. > Signed-off-by: Maxime Ripard > --- > .../sunxi/cedrus/sunxi_cedrus_common.h | 9 +++++ > .../platform/sunxi/cedrus/sunxi_cedrus_hw.c | 21 ++++++------ > .../sunxi/cedrus/sunxi_cedrus_mpeg2.c | 33 +++++++++++++++++++ > 3 files changed, 53 insertions(+), 10 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 c2e2c92d103b..a2a507eb9fc9 100644 > --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h > +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_common.h > @@ -108,7 +108,16 @@ struct sunxi_cedrus_buffer *vb2_to_cedrus_buffer(con= st struct vb2_buffer *p) > return vb2_v4l2_to_cedrus_buffer(to_vb2_v4l2_buffer(p)); > } > =20 > +enum sunxi_cedrus_irq_status { > + SUNXI_CEDRUS_IRQ_NONE, > + SUNXI_CEDRUS_IRQ_ERROR, > + SUNXI_CEDRUS_IRQ_OK, > +}; > + > struct sunxi_cedrus_dec_ops { > + void (*irq_clear)(struct sunxi_cedrus_ctx *ctx); > + void (*irq_disable)(struct sunxi_cedrus_ctx *ctx); > + enum sunxi_cedrus_irq_status (*irq_status)(struct sunxi_cedrus_ctx *ctx= ); > void (*setup)(struct sunxi_cedrus_ctx *ctx, > struct sunxi_cedrus_run *run); > void (*trigger)(struct sunxi_cedrus_ctx *ctx); > diff --git a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c b/driv= ers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c > index bb46a01214e0..6b97cbd2834e 100644 > --- a/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c > +++ b/drivers/media/platform/sunxi/cedrus/sunxi_cedrus_hw.c > @@ -77,27 +77,28 @@ static irqreturn_t sunxi_cedrus_ve_irq(int irq, void = *dev_id) > struct sunxi_cedrus_ctx *ctx; > struct sunxi_cedrus_buffer *src_buffer, *dst_buffer; > struct vb2_v4l2_buffer *src_vb, *dst_vb; > + enum sunxi_cedrus_irq_status status; > unsigned long flags; > - unsigned int value, status; > =20 > spin_lock_irqsave(&dev->irq_lock, flags); > =20 > - /* Disable MPEG interrupts and stop the MPEG engine */ > - value =3D sunxi_cedrus_read(dev, VE_MPEG_CTRL); > - sunxi_cedrus_write(dev, value & (~0xf), VE_MPEG_CTRL); > - > - status =3D sunxi_cedrus_read(dev, VE_MPEG_STATUS); > - sunxi_cedrus_write(dev, 0x0000c00f, VE_MPEG_STATUS); > - sunxi_cedrus_engine_disable(dev); This call was dropped from the code reorganization. What it intentional? IMO, it should be brought back to the irq_disable ops for MPEG2 (and the same probably applies to H264). Things still seem to work without it, though, but there might be a difference in terms of standby VPU power consumption. Cheers, Paul --=20 Paul Kocialkowski, Bootlin (formerly Free Electrons) Embedded Linux and kernel engineering https://bootlin.com --=-IEAekvlujL4VhhCQES3c 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+fv9EFAlsxDGIACgkQ3cLmz3+f v9HJ1wf/e87b7B3R3TQcw7qgwoyI20Zd9HMG+A4Ow7MFZnuYfnPT+Y6odRkUn1Tu XL/Cg4KAFBLuIq/qQnFvIJCW+MErhX8iW/KlW23xZzzhPxzxRDR//j2iEru8Rj3H l/XqxhoaMUpGj29QEaHAlH2Fjdxj9xxYcq6dzUPEhRmNVAdVeUuIXtmAlOzsIFbi jP6U3cnOcW4MX9QP6NN+Q3Aoh5FlwHEHJbRTrSOMb5vgP464m8Rjv14o+SiS8lke aedm+Hyi1bCH1o8/mHObDA55ByoN2EYIgY0gcJu5YuOcR0IJis5akZuSMukq+Z1a fgTM04NVSRLoMEgcdTcNCFtdQpBnLg== =kGSx -----END PGP SIGNATURE----- --=-IEAekvlujL4VhhCQES3c--