From patchwork Fri Aug 31 13:18:04 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sascha Hauer X-Patchwork-Id: 1393231 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id CEC8E3FF1B for ; Fri, 31 Aug 2012 13:18:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753377Ab2HaNST (ORCPT ); Fri, 31 Aug 2012 09:18:19 -0400 Received: from metis.ext.pengutronix.de ([92.198.50.35]:52705 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752641Ab2HaNSQ (ORCPT ); Fri, 31 Aug 2012 09:18:16 -0400 Received: from dude.hi.pengutronix.de ([2001:6f8:1178:2:21e:67ff:fe11:9c5c]) by metis.ext.pengutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1T7R6t-0002zQ-37; Fri, 31 Aug 2012 15:18:07 +0200 Received: from sha by dude.hi.pengutronix.de with local (Exim 4.80) (envelope-from ) id 1T7R6r-0003XZ-Tt; Fri, 31 Aug 2012 15:18:05 +0200 From: Sascha Hauer To: linux-media@vger.kernel.org Cc: Pawel Osciak , Mauro Carvalho Chehab , Marek Szyprowski , Sascha Hauer Subject: [PATCH 2/2] media v4l2-mem2mem: fix src/out and dst/cap num_rdy Date: Fri, 31 Aug 2012 15:18:04 +0200 Message-Id: <1346419084-10879-3-git-send-email-s.hauer@pengutronix.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1346419084-10879-1-git-send-email-s.hauer@pengutronix.de> References: <1346419084-10879-1-git-send-email-s.hauer@pengutronix.de> X-SA-Exim-Connect-IP: 2001:6f8:1178:2:21e:67ff:fe11:9c5c X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-media@vger.kernel.org Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org src bufs belong to out queue, dst bufs belong to in queue. Currently this is not a real problem since all users currently need exactly one input and one output buffer. Signed-off-by: Sascha Hauer Acked-by: Marek Szyprowski Acked-by: Pawel Osciak --- include/media/v4l2-mem2mem.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/media/v4l2-mem2mem.h b/include/media/v4l2-mem2mem.h index 16ac473..131cc4a 100644 --- a/include/media/v4l2-mem2mem.h +++ b/include/media/v4l2-mem2mem.h @@ -140,7 +140,7 @@ void v4l2_m2m_buf_queue(struct v4l2_m2m_ctx *m2m_ctx, struct vb2_buffer *vb); static inline unsigned int v4l2_m2m_num_src_bufs_ready(struct v4l2_m2m_ctx *m2m_ctx) { - return m2m_ctx->cap_q_ctx.num_rdy; + return m2m_ctx->out_q_ctx.num_rdy; } /** @@ -150,7 +150,7 @@ unsigned int v4l2_m2m_num_src_bufs_ready(struct v4l2_m2m_ctx *m2m_ctx) static inline unsigned int v4l2_m2m_num_dst_bufs_ready(struct v4l2_m2m_ctx *m2m_ctx) { - return m2m_ctx->out_q_ctx.num_rdy; + return m2m_ctx->cap_q_ctx.num_rdy; } void *v4l2_m2m_next_buf(struct v4l2_m2m_queue_ctx *q_ctx);