Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4264805ybl; Mon, 27 Jan 2020 20:37:47 -0800 (PST) X-Google-Smtp-Source: APXvYqz26SULH7eM1ZJbG+rabkNhaq1Uz3PL3Go7qUX8DMr0EWNj72iudJQFLtWBoEOJ1BKBxOwR X-Received: by 2002:aca:cc07:: with SMTP id c7mr1587455oig.165.1580186267830; Mon, 27 Jan 2020 20:37:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580186267; cv=none; d=google.com; s=arc-20160816; b=uTy66iZt65kSE94ItyIRNU8KaTvPcDRTTB28FNwo1ZvW0SY1rhFwHebD5NfZJDnbua F+E9SEyQswF++LJXlRJsUWIh3cyUaIq4oOmfietK6lkGTVtImExfRdheH3juVbdoJS3K 7AzCo0GIM3XMTdXTuTQvupCUbiAhyNXeb1SbXajWijhc9FimuPfX/CAi8LCJUBxBlwA5 q1PLMkJ+orDQsckhDW1xsoyuQDBzJaMfNUcZPwaZCPXBopPt1n2grugQGLPkmgHLhWd2 cDVzTdc4j5LP11BaVDhzv8/8uMZ35x0fvyyNRBI+/2HilNAWv1TuRtAqCYY7IikXJJHS GFfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Y7WDQ8mNe+wTvHSQNys0Gz2BA37V8tfgf8BXSaFDUrw=; b=O43k/YW+ifIr372m7KsNgb9fQ941EQTVbVU8d9Y2TPm8wC2N9YYGPGUKF8MNEvHe1O Ftgfj//2voONFjiLiNttPiHt44J5kdfsfH/R3G7BojXaY5XmoNfUVF32+hkIhfQtaEbN LVq/z3ZBWyOZ53sl3rnrFFBGbVfUR5lDAZNARgLuwhOYEt0JwCLlaT4GzB0Iz6XFIpDJ PylluQuVUTb6XRWsaQ7debcgdmZ/lGk6QlzEKegb6C2LRBKM/9n892Y5/udMdNIp3sCu 2TlDCfiLGFrLNaJbtIOiFmB4qPq4Ky0K+THdOU/+JkBBtV7oGtxhdUPOULYNJ8wPc1uo zcGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=kCQIevLR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r1si8112243otn.150.2020.01.27.20.37.30; Mon, 27 Jan 2020 20:37:47 -0800 (PST) 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; dkim=pass header.i=@chromium.org header.s=google header.b=kCQIevLR; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbgA1EgG (ORCPT + 99 others); Mon, 27 Jan 2020 23:36:06 -0500 Received: from mail-ed1-f66.google.com ([209.85.208.66]:39510 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726267AbgA1EgF (ORCPT ); Mon, 27 Jan 2020 23:36:05 -0500 Received: by mail-ed1-f66.google.com with SMTP id m13so13248599edb.6 for ; Mon, 27 Jan 2020 20:36:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=Y7WDQ8mNe+wTvHSQNys0Gz2BA37V8tfgf8BXSaFDUrw=; b=kCQIevLRhxAg4UVMkdBxxATDymmTLAjaMvHwJsThMEk/YBCOMHlA3IP+01gzEtYU/k jF2EubEsqlfuQvucRuh17bk0kMaWvLEJqjdeqpY2dqVEfE/E2R87NsToHMvY/3HAL3Nn sVcayrty7WiA0gu+kfHdMhrDJeV3kfSq3YOL0= 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; bh=Y7WDQ8mNe+wTvHSQNys0Gz2BA37V8tfgf8BXSaFDUrw=; b=EX+IWwQLxHaiSN6xAqyHqJUpI+IYqHPbagCnw9fJ5fU5bqW9l1nsBBQvVQ3dFmsZDr j+WpG+JNG1ze1+/rJU+AAtP8jOMOzyr+DDWHii2Hk+QAvE75YVBvXx5VZ29O4IU1ob/z PdWlQlqeVaAH32EAb1u13FUcybwEVVARsXTBNmw6jm5WOcX7GEazJVzzZrUsDf+DIjcu kep67w+ztZYMu6BqQ9wjmhIfRlfYmKxAs77LRZ93EX7RVNhCTg66BQsqbeVxCcymZUzx 01d8ET6lqzc4eFvJacIwjg8WCC0Z69tvoCp/jbJKebtzon2s7+6Qct06z6rEk8Onf/6d imVg== X-Gm-Message-State: APjAAAX2jORSObZfDWtU5+FB90gnwuOkRW81H7PzyfABX+XAafuOpgcn YFM46GdnRrT58CFRt39KBRMW0R7PXAkNng== X-Received: by 2002:a17:906:560e:: with SMTP id f14mr1515893ejq.300.1580186163322; Mon, 27 Jan 2020 20:36:03 -0800 (PST) Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com. [209.85.128.52]) by smtp.gmail.com with ESMTPSA id cw15sm424069edb.44.2020.01.27.20.36.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 27 Jan 2020 20:36:01 -0800 (PST) Received: by mail-wm1-f52.google.com with SMTP id a9so1025090wmj.3 for ; Mon, 27 Jan 2020 20:36:01 -0800 (PST) X-Received: by 2002:a7b:c750:: with SMTP id w16mr2306669wmk.46.1580186160717; Mon, 27 Jan 2020 20:36:00 -0800 (PST) MIME-Version: 1.0 References: <20191217032034.54897-1-senozhatsky@chromium.org> <20191217032034.54897-3-senozhatsky@chromium.org> <20200122013937.GC149602@google.com> <20200122025351.GF149602@google.com> In-Reply-To: <20200122025351.GF149602@google.com> From: Tomasz Figa Date: Tue, 28 Jan 2020 13:35:49 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC][PATCH 02/15] videobuf2: handle V4L2 buffer cache flags To: Sergey Senozhatsky Cc: Hans Verkuil , Hans Verkuil , Mauro Carvalho Chehab , Kyungmin Park , Marek Szyprowski , Sakari Ailus , Laurent Pinchart , Pawel Osciak , Linux Media Mailing List , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 22, 2020 at 11:53 AM Sergey Senozhatsky wrote: > > On (20/01/22 10:39), Sergey Senozhatsky wrote: > > [..] > > > > } > > > > > > > > +static void set_buffer_cache_hints(struct vb2_queue *q, > > > > + struct vb2_buffer *vb, > > > > + struct v4l2_buffer *b) > > > > +{ > > > > + vb->need_cache_sync_on_prepare = 1; > > > > + > > > > + if (q->dma_dir != DMA_TO_DEVICE) > > > > > > What should be done when dma_dir == DMA_BIDIRECTIONAL? > > > > [..] > > > We probably cannot enforce any other behavior here. Am I missing > > something? > > Never mind. I got your point. DMA_BIDIRECTIONAL by default needs sync on both prepare and finish. need_cache_sync_on_prepare is initialized to 1. Since DMA_BIDIRECTIONAL != DMA_TO_DEVICE, need_cache_sync_on_finish would also be set to 1. Is anything still missing?