Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7260003ybi; Wed, 5 Jun 2019 14:11:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqzgsSdjmTgSIPm0LQhPVU4OquCJNXkwz+rE9XmrYOO7GlcbfpBM5I1rhfEXFaeLBEUuohoI X-Received: by 2002:a17:902:a986:: with SMTP id bh6mr44841642plb.100.1559769078625; Wed, 05 Jun 2019 14:11:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559769078; cv=none; d=google.com; s=arc-20160816; b=0K/35CSoVs3GTqKrjRoS91Zt0lx8axby8h6cO1XOQ4k6WlH2BQQW1yuAJskUjcYwBP WJy3VN4rLvC1dmAU7ZhgosbIfjPkMseYr5ZI+R5sEczjF2GbGfG2D3VXeC5SxpTrnWxY oi2TW7lo49vJVDrS9STdUFIvuRCZZVmmvaacCdtYhUJmaBJXqwlUhZ2SqeeoNIWH04sT EhoOz5BAu/sNtHHW1W7ebFXhhYrLPFY6jp8tVSRy8H4OyCtxb7YZIoQ2KgSX1XufC021 MGBWaNGvqhhzDeM8UJQKng7mlenSWA2ppubFnoAD4BLUjN+ADLb7opx2euMpSiaSkcSr oKCA== 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:mime-version :user-agent:references:in-reply-to:date:cc:to:from:subject :message-id; bh=JtmPKUgcXRMgMApgHysGFjHe+TFnX1VPxVtnY+sXYd0=; b=Kni1Rq+LQFELLtc+XZEVxO9c0XNV12rKJzf6iK1U9+lNYs2qvheHNMaLcOdj3GVm5u 5y8dg9MuREM8tBOfJnAdhYHlFmvcMLQgeqDc4MtEQbCuNt6jJnH8ct5rRO9d4N3EzpTK W4X8+fclFkFHGO72gWC/Vr1QOx5SQc6vpF3CbqjYHL8tIWrF57KKYNxiEyF2lx2zJSfr jUa2QAuNygsY6SQ3ULKcQfl8ySa0NMQy8vyDPSzIFqy6wXkN2v+m3YhjeU0gQvU+ZLAW qDZW1icua7xpNB925V2+KSYApxZ0yA7IVdVVn2+CyZ3thKUcaSO5jLva4QIiV6+DMoBo mAcg== 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 o32si8294274pld.115.2019.06.05.14.11.01; Wed, 05 Jun 2019 14:11:18 -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 S1726637AbfFEVHi (ORCPT + 99 others); Wed, 5 Jun 2019 17:07:38 -0400 Received: from relay10.mail.gandi.net ([217.70.178.230]:53551 "EHLO relay10.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726464AbfFEVHi (ORCPT ); Wed, 5 Jun 2019 17:07:38 -0400 Received: from collins (196.109.29.93.rev.sfr.net [93.29.109.196]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay10.mail.gandi.net (Postfix) with ESMTPSA id 1E24924000B; Wed, 5 Jun 2019 21:07:33 +0000 (UTC) Message-ID: <870e55d3697583841700258b184ed4f5f3a8fb03.camel@bootlin.com> Subject: Re: [PATCH 4/7] media: cedrus: Remove dst_bufs from context From: Paul Kocialkowski To: Jernej Skrabec , maxime.ripard@bootlin.com Cc: wens@csie.org, mchehab@kernel.org, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, devel@driverdev.osuosl.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Date: Wed, 05 Jun 2019 23:07:33 +0200 In-Reply-To: <20190530211516.1891-5-jernej.skrabec@siol.net> References: <20190530211516.1891-1-jernej.skrabec@siol.net> <20190530211516.1891-5-jernej.skrabec@siol.net> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Le jeudi 30 mai 2019 à 23:15 +0200, Jernej Skrabec a écrit : > This array is just duplicated capture buffer queue. Remove it and adjust > code to look into capture buffer queue instead. > > Signed-off-by: Jernej Skrabec Acked-by: Paul Kocialkowski Cheers and thanks, Paul > --- > drivers/staging/media/sunxi/cedrus/cedrus.h | 4 +--- > .../staging/media/sunxi/cedrus/cedrus_h264.c | 4 ++-- > .../staging/media/sunxi/cedrus/cedrus_video.c | 22 ------------------- > 3 files changed, 3 insertions(+), 27 deletions(-) > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h b/drivers/staging/media/sunxi/cedrus/cedrus.h > index 3f476d0fd981..d8e6777e5e27 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus.h > +++ b/drivers/staging/media/sunxi/cedrus/cedrus.h > @@ -100,8 +100,6 @@ struct cedrus_ctx { > struct v4l2_ctrl_handler hdl; > struct v4l2_ctrl **ctrls; > > - struct vb2_buffer *dst_bufs[VIDEO_MAX_FRAME]; > - > union { > struct { > void *mv_col_buf; > @@ -187,7 +185,7 @@ static inline dma_addr_t cedrus_dst_buf_addr(struct cedrus_ctx *ctx, > if (index < 0) > return 0; > > - buf = ctx->dst_bufs[index]; > + buf = ctx->fh.m2m_ctx->cap_q_ctx.q.bufs[index]; > return buf ? cedrus_buf_addr(buf, &ctx->dst_fmt, plane) : 0; > } > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > index d0ee3f90ff46..b2290f98d81a 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_h264.c > @@ -119,7 +119,7 @@ static void cedrus_write_frame_list(struct cedrus_ctx *ctx, > if (buf_idx < 0) > continue; > > - cedrus_buf = vb2_to_cedrus_buffer(ctx->dst_bufs[buf_idx]); > + cedrus_buf = vb2_to_cedrus_buffer(cap_q->bufs[buf_idx]); > position = cedrus_buf->codec.h264.position; > used_dpbs |= BIT(position); > > @@ -194,7 +194,7 @@ static void _cedrus_write_ref_list(struct cedrus_ctx *ctx, > if (buf_idx < 0) > continue; > > - ref_buf = to_vb2_v4l2_buffer(ctx->dst_bufs[buf_idx]); > + ref_buf = to_vb2_v4l2_buffer(cap_q->bufs[buf_idx]); > cedrus_buf = vb2_v4l2_to_cedrus_buffer(ref_buf); > position = cedrus_buf->codec.h264.position; > > diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > index e2b530b1a956..681dfe3367a6 100644 > --- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c > +++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c > @@ -411,26 +411,6 @@ static void cedrus_queue_cleanup(struct vb2_queue *vq, u32 state) > } > } > > -static int cedrus_buf_init(struct vb2_buffer *vb) > -{ > - struct vb2_queue *vq = vb->vb2_queue; > - struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); > - > - if (!V4L2_TYPE_IS_OUTPUT(vq->type)) > - ctx->dst_bufs[vb->index] = vb; > - > - return 0; > -} > - > -static void cedrus_buf_cleanup(struct vb2_buffer *vb) > -{ > - struct vb2_queue *vq = vb->vb2_queue; > - struct cedrus_ctx *ctx = vb2_get_drv_priv(vq); > - > - if (!V4L2_TYPE_IS_OUTPUT(vq->type)) > - ctx->dst_bufs[vb->index] = NULL; > -} > - > static int cedrus_buf_out_validate(struct vb2_buffer *vb) > { > struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); > @@ -517,8 +497,6 @@ static void cedrus_buf_request_complete(struct vb2_buffer *vb) > static struct vb2_ops cedrus_qops = { > .queue_setup = cedrus_queue_setup, > .buf_prepare = cedrus_buf_prepare, > - .buf_init = cedrus_buf_init, > - .buf_cleanup = cedrus_buf_cleanup, > .buf_queue = cedrus_buf_queue, > .buf_out_validate = cedrus_buf_out_validate, > .buf_request_complete = cedrus_buf_request_complete,