Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp662197ybj; Tue, 5 May 2020 05:48:04 -0700 (PDT) X-Google-Smtp-Source: APiQypIv3WULJL3h2s/hxRTkK4pfYTnl6WrV5xv5OCauPKM3mmcMR+JeDrBUE7zijq/rrQ25nxXk X-Received: by 2002:a17:907:210d:: with SMTP id qn13mr2550596ejb.376.1588682884645; Tue, 05 May 2020 05:48:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588682884; cv=none; d=google.com; s=arc-20160816; b=zKJlXRk4/2lbNEDymhYFFZdvCb10v1e2rqNN9LBAZLakuahfyq0q7AUBPM/P+jKfOi PFfSMQNk/Ev7gi711k45bMDN1vhDBs7McyUB0L8Ql8JxYv5BGLYLC8pv7BI/PXRMc717 gFcoCaz5Lu+4kFLGTbBmLTC8KbSubTfP1wTfqWO01tjN6bPULrvlpJ3ry8QPTQRzXkNx 0AEaIjQ3uPXo6XpJURexSkhyHV9OqTDTUrGOvXuMzQin1BF5k3CU/u4B7bQPr4O+aT6T WN/UH2hLyMhsYvYpATmtlWQO0k6jxXUl3//ETb+bMKi6McBG6MBd+DehPABiivMAV7DT dzQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=YMVoM8MB/DmaYSfgc1C7r97WJiRJ98Zuz8O8b2fB1Tk=; b=U6KYeGNVXvPhisL+vmIFVvQvp8oS75jCsPQ/WO3E8vpa8OaNG69KcmD0ygfdEJtOsy Hr+Uot7RUQHTx9M2d6fWFW3SWwDr2KvLtH4FaYkbIoHUmIc7H77HVfkOoRWEu+ff48+h aEvwj3l6SyqWGAgeAELVHTQETCYKU1+p5vd6AvCOPzJ1q3T/GA0j/I1SzdlkxcgVbtjW zRonXA5UohVR0oExH4H5NuUGY5X1SFRywMOq14r2rv7dsFTB5kfV2TWYS3Qy5xjxnNnp uDStAiv1+vb8EoveBv4s5nwhm7Y5zc9iBTT6NfYY6mlDqhSl4aj0UUkEwCqo0a1ZVh6x pMlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=YZDlR7wb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y7si1283785ede.225.2020.05.05.05.47.41; Tue, 05 May 2020 05:48:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@vanguardiasur-com-ar.20150623.gappssmtp.com header.s=20150623 header.b=YZDlR7wb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728900AbgEEMpw (ORCPT + 99 others); Tue, 5 May 2020 08:45:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34686 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728642AbgEEMpt (ORCPT ); Tue, 5 May 2020 08:45:49 -0400 Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D3F17C061A10 for ; Tue, 5 May 2020 05:45:47 -0700 (PDT) Received: by mail-ed1-x544.google.com with SMTP id d16so1640288edq.7 for ; Tue, 05 May 2020 05:45:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vanguardiasur-com-ar.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=YMVoM8MB/DmaYSfgc1C7r97WJiRJ98Zuz8O8b2fB1Tk=; b=YZDlR7wbgPixPGqp6u7w1A7c0PPVBfjS74wwW7ww4Ig5XezgZvl9QiF9A0RFr/W9Ih rwj2bR4V3i7wXxokh95QBlfNsec5zxioWSkkvqgXo2Jgr9pUUnw45qBqaNiG9N2sbBdZ VNT78i2Uaat8Os2U8RbN0mHi2SZjlpTYFnafK3h7c0cts4BjvSTLmL+AQ0sOHj1OfrJx VyRIhjHZ85wtcQMoCHETeWA3CSUcPMQ35mZiZOAAJA/KIfWTwuxPJ/NfT9UqUXsOBTCq Ol/NeYcxTHXH1dJk4OIDZsX8vpsCtpkW96uaiICi5xxxIu2m8QY/ymo0aAf1b1VjYe5g ovyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=YMVoM8MB/DmaYSfgc1C7r97WJiRJ98Zuz8O8b2fB1Tk=; b=j4EBtEvTIkuUKUogqgiVdE76Yt3wF6b7h/q4nppV9sw54wRPefjotfrzZgDDL+bGP8 zjaw5/fWjSR9WNs0iQc6QqcHmzr4p3fWZ8WQrIMR+4pt/UwFxSHyPzjrHaD0GhQWLb76 0J0AHtzkNZ5Y2hvtbqm84GA9lVv/Jz192rqIZrMsSOdOULsvOBad0Xk+WiKHPH3xPdGV tLdU+tUnfAUApJ+myS21CKJs+0IWruMwJri07bxXorxWQbUqNzA9WlWIIdod6foV10QM i4etyny61Ul0LE2WMLzA5E+LD364HDEBkkKrJTTKEMTnKopbXmZZqlp4GMVmsd5E3pV0 N7ZA== X-Gm-Message-State: AGi0PuZ1WhmNjC72qK9tldlABTbIRMID9dNFsrsqcpJwom+/Fs17yxni jKtke/8/X97wu4qKTcVUp+MrNMGoaqJo/Gggr5564w== X-Received: by 2002:a05:6402:1587:: with SMTP id c7mr2263913edv.61.1588682746473; Tue, 05 May 2020 05:45:46 -0700 (PDT) MIME-Version: 1.0 References: <20200422040410.6251-1-samuel@sholland.org> In-Reply-To: <20200422040410.6251-1-samuel@sholland.org> From: Ezequiel Garcia Date: Tue, 5 May 2020 09:45:35 -0300 Message-ID: Subject: Re: [linux-sunxi] [PATCH v2 1/2] media: cedrus: Program output format during each run To: Samuel Holland Cc: Maxime Ripard , Paul Kocialkowski , Chen-Yu Tsai , Mauro Carvalho Chehab , Greg Kroah-Hartman , linux-arm-kernel , Linux Kernel Mailing List , linux-media , linux-sunxi@googlegroups.com, =?UTF-8?Q?Jernej_=C5=A0krabec?= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 22 Apr 2020 at 01:00, Samuel Holland wrote: > > Previously, the output format was programmed as part of the ioctl() > handler. However, this has two problems: > > 1) If there are multiple active streams with different output > formats, the hardware will use whichever format was set last > for both streams. Similary, an ioctl() done in an inactive > context will wrongly affect other active contexts. > 2) The registers are written while the device is not actively > streaming. To enable runtime PM tied to the streaming state, > all hardware access needs to be moved inside cedrus_device_run(). > > The call to cedrus_dst_format_set() is now placed just before the > codec-specific callback that programs the hardware. > Cc: > Fixes: 50e761516f2b ("media: platform: Add Cedrus VPU decoder driver") > Suggested-by: Jernej =C5=A0krabec > Suggested-by: Paul Kocialkowski > Signed-off-by: Samuel Holland Reviewed-by: Ezequiel Garcia Thanks, Ezequiel > --- > > v2: added patch > > --- > drivers/staging/media/sunxi/cedrus/cedrus_dec.c | 2 ++ > drivers/staging/media/sunxi/cedrus/cedrus_video.c | 3 --- > 2 files changed, 2 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c b/drivers/st= aging/media/sunxi/cedrus/cedrus_dec.c > index 4a2fc33a1d79..58c48e4fdfe9 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_dec.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_dec.c > @@ -74,6 +74,8 @@ void cedrus_device_run(void *priv) > > v4l2_m2m_buf_copy_metadata(run.src, run.dst, true); > > + cedrus_dst_format_set(dev, &ctx->dst_fmt); > + > dev->dec_ops[ctx->current_codec]->setup(ctx, &run); > > /* Complete request(s) controls if needed. */ > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/= staging/media/sunxi/cedrus/cedrus_video.c > index 15cf1f10221b..ed3f511f066f 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > @@ -273,7 +273,6 @@ static int cedrus_s_fmt_vid_cap(struct file *file, vo= id *priv, > struct v4l2_format *f) > { > struct cedrus_ctx *ctx =3D cedrus_file2ctx(file); > - struct cedrus_dev *dev =3D ctx->dev; > struct vb2_queue *vq; > int ret; > > @@ -287,8 +286,6 @@ static int cedrus_s_fmt_vid_cap(struct file *file, vo= id *priv, > > ctx->dst_fmt =3D f->fmt.pix; > > - cedrus_dst_format_set(dev, &ctx->dst_fmt); > - > return 0; > } > > -- > 2.24.1 > > -- > You received this message because you are subscribed to the Google Groups= "linux-sunxi" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to linux-sunxi+unsubscribe@googlegroups.com. > To view this discussion on the web, visit https://groups.google.com/d/msg= id/linux-sunxi/20200422040410.6251-1-samuel%40sholland.org.