Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp330914ybv; Wed, 19 Feb 2020 00:15:28 -0800 (PST) X-Google-Smtp-Source: APXvYqxC2hyigGgPCxgJmtq28irPlSUlVFBFAhkWMMmpdWTPfDQydSEBWWQxjif4d6CM/3WuPF01 X-Received: by 2002:aca:5303:: with SMTP id h3mr3701119oib.109.1582100128529; Wed, 19 Feb 2020 00:15:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582100128; cv=none; d=google.com; s=arc-20160816; b=oklSntntdVUGiqjHgUi4oRphWYI+mh63x3uOh8rDlOkEFZ1ujDc2Rdn4e/Xrbd2t6K ieNY4ju75PnIY9iL5kgkWMSK1BcDdvUJX9jTReZgGkGd0j8VTKeDsUpXgNI9heiLTAsu OZhBp8JF04q9AVS7l96hJcXwXi8LqMCDaqFh03ZGWZ7BtrFjbQnjpgsWJgE4YDwXLxHA R6QzXDavCeQ1cmo41FrHAKDI3BImgGHacyNeEAbfSXFKY1k5fkM9DCt2DBZbIkVhMFwM Tne5fELry2hUks5dIWJFysofmdA65PhpHj7EglavEdZPxjxS72ZwffoU3mVTW7kA9yDH 1cRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=gLBIj+fuH4bNJ6zllKwalYU+iG961kfhyRRqPAduohs=; b=KW8ltA6qoCejoYWyX1XkyHWsiFV7XEfJBe+AK6DUBF7+qJYrzcy+qoAo1lU59+vuOF BLg9Db2q5fH7rplJQ5QZxKpXsLcJWjebLENhtOWDLI0TbxpGU60Jc6DwbYz2y5fsktqS aOLBaY7/kjF3nFVv4Larfy68iuQKQTYTsd/3FhKdVnAr3kAO4RR26YGDnqrCPuKrq/a1 C6QylppdfOwq9uK/cZkPiG848bbG2gEXNm5cbiEjOgEePNaQuUtyzD7Ga2AWlDEoZ/KA f83mYoJSeympUl425EID/Klbx+y5Hl9JYo2tUFaiOdlrb8xm0dw3xhIhmxFKoFk0mWxR +MvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=cVTHzOlf; 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 l65si8665384oih.23.2020.02.19.00.15.16; Wed, 19 Feb 2020 00:15:28 -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=cVTHzOlf; 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 S1726645AbgBSINo (ORCPT + 99 others); Wed, 19 Feb 2020 03:13:44 -0500 Received: from mail-pg1-f175.google.com ([209.85.215.175]:43847 "EHLO mail-pg1-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbgBSINn (ORCPT ); Wed, 19 Feb 2020 03:13:43 -0500 Received: by mail-pg1-f175.google.com with SMTP id u12so11971200pgb.10 for ; Wed, 19 Feb 2020 00:13:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=gLBIj+fuH4bNJ6zllKwalYU+iG961kfhyRRqPAduohs=; b=cVTHzOlfDltrvNuUVa8kzzACQJWj0n5H39jmoyykMIcLCjAOEcF+AE3MR0swAyYLs/ Duv5AnjAlKFUiGZK038MzN1WkgdcCBfuMXFO4Qns27SqZcbXvVIOVUv1r4FFd+BpstgP 44vxbNzl/meJyidKYLrxdrRXANxFpFKMQvFno= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=gLBIj+fuH4bNJ6zllKwalYU+iG961kfhyRRqPAduohs=; b=tAY09V/VjtoLawMzaWlRY90In6TC+TyKhrYIA3r6EqwVZAiYw9w3fAzioTc7ikNs8S WzFFKEaO1Fuio0Z/uXeBZyFu37O+efPblvESGbCt9IAJVAOFPH02c3ToCcN9MNdUgnXO /VHoZ50nPHuxHipf16GdVzycKcvFMC1RiHXvScFToED5g4wKzxEUJRMKBxjXLjWoTVY8 mIle9294mHP5GOeQ9WSS2VG2zTPFLARJbpou3gg7405/C2KWWEQY+08ZWv423GgdbiDc WfVks7ogJ9W2brcovKypiqEgsywcd4hxw36XwG5bY3J8YUt75skYyoeQg5rAzUs55O3K kNRg== X-Gm-Message-State: APjAAAWwXq09y/08Ubuv+horwhZnQDMXBJjGD3vXX6fEWa3GTwQvxSKM XwpQ/ew89vi2TdGFJDQ51lftzQ== X-Received: by 2002:a65:5ccc:: with SMTP id b12mr26622426pgt.124.1582100023146; Wed, 19 Feb 2020 00:13:43 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id z64sm1776228pfz.23.2020.02.19.00.13.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 00:13:42 -0800 (PST) Date: Wed, 19 Feb 2020 17:13:40 +0900 From: Sergey Senozhatsky To: Hans Verkuil Cc: Sergey Senozhatsky , Hans Verkuil , Tomasz Figa , Mauro Carvalho Chehab , Kyungmin Park , Marek Szyprowski , Sakari Ailus , Laurent Pinchart , Pawel Osciak , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCHv2 02/12] videobuf2: handle V4L2 buffer cache flags Message-ID: <20200219081340.GA122464@google.com> References: <20200204025641.218376-1-senozhatsky@chromium.org> <20200204025641.218376-3-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.2 (2019-09-21) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/02/19 09:07), Hans Verkuil wrote: [..] > > +static void set_buffer_cache_hints(struct vb2_queue *q, > > + struct vb2_buffer *vb, > > + struct v4l2_buffer *b) > > +{ > > + /* > > + * DMA exporter should take care of cache syncs, so we can avoid > > + * explicit ->prepare()/->finish() syncs. For other ->memory types > > + * we always need ->prepare() or/and ->finish() cache sync. > > + */ > > + if (q->memory == VB2_MEMORY_DMABUF) { > > + vb->need_cache_sync_on_finish = 0; > > + vb->need_cache_sync_on_prepare = 0; > > + return; > > + } > > + > > + if (!q->allow_cache_hints) > > + return; > > + > > + vb->need_cache_sync_on_prepare = 1; > > This needs a comment explaining why prepare is set to 1 by default. I remember > we discussed this earlier, and the conclusion of that discussion needs to be > documented here in a comment. Please ignore this patch. There is a follow up which sets _both_ flags by default. The purpose is to preserve the existing behaviour, we can do all sorts of incremental changes (clear flags in more cases, etc.) later on. Do you want me to document this in the code? -ss