Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp296367ybl; Fri, 24 Jan 2020 00:06:18 -0800 (PST) X-Google-Smtp-Source: APXvYqx6BNVq6CHknKn/MO7YPaq1Kw4mynYKju093qJPXC/iKO/6WF3/FR3RGjSDKoCJGjIVkQa0 X-Received: by 2002:a05:6808:1c5:: with SMTP id x5mr1277629oic.57.1579853178112; Fri, 24 Jan 2020 00:06:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579853178; cv=none; d=google.com; s=arc-20160816; b=FabtLFEuZcoS8+Infsra506WIVU9m5I4qDXHGGLB3IvRiVH1uYahwBW3ygs5/1DA6j cxV43G9r1SIvgfGTgLSuN0DmVSjnfiEEHCQML9uaeU7lj2QO+40qS/yOTOL8qi+cDnnx vnblRCBVKzJY+dAV7/+dGhUzshx8GmcBh4XeYjOkKgVTxOQVZVS02hEZifxZZofV6SqG jMcsLbTSMAvXNRkB6RLAmADoPPeNLYlBBgmytGBf/vQLt7v9d9r4dazY6rH6977mX1uj enNMCQuwh5i/qL1ouRoDloso0Ezp3FYk/+S3Ls56xE3ABVsDcsTTvHl2pnn5HKE/QpiL Trpg== 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=XMan5I+mKArqobbqFNZ+gUF18xHrDU9k/d4NqHI6zu4=; b=yUOfsePVlP7+uXNwziIOXdI9NORvpWznuA7LUW/A4GeNsLsBypVKPNLK6Gro5oygGV WKZRp9MTawPvMnETNi5t9l4CXJ/XGGPKX4mft28nLJH7dep9lyBTCjt9OhSZF0KRY+tx mEjTVYkEDWBbtlffYS3DOFNDdfwcQcEcyVeHV05KbLrei9wX0Y7jv/MBMQR82b8PMJnh sluvRSpEFmhsUkJrv/fZThBmRzpM3pKhAPGOmCt9e98hOXNlNEcVyqJZzZ8m/ObUXaLy FqZmaWLCgceGxyZNfXTr/d/yOK9fSgbajMDPphPDMbaxdMSQBwxQI61fBaTHd5WrGUMb JcGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=XNlEkrtB; 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 s3si2051384oic.108.2020.01.24.00.05.54; Fri, 24 Jan 2020 00:06:18 -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=XNlEkrtB; 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 S1730126AbgAXHcx (ORCPT + 99 others); Fri, 24 Jan 2020 02:32:53 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:42848 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbgAXHcx (ORCPT ); Fri, 24 Jan 2020 02:32:53 -0500 Received: by mail-pg1-f194.google.com with SMTP id s64so567355pgb.9 for ; Thu, 23 Jan 2020 23:32:53 -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=XMan5I+mKArqobbqFNZ+gUF18xHrDU9k/d4NqHI6zu4=; b=XNlEkrtB5WyC+6KEfcv9h47Qsg6EErvwdpfmokrUteEgzL60mkvaZxTq6BbI6ETlBX XdjnC0mX6AeVz20ETbOKynfAkVrQyiIFqpPZoCPcSunnwy6rizJ0b6eKupQONUPo1Rkr 9Yi3IZ+BzIJwT7Bb5XadFn5dcRZGLuSB5NixY= 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=XMan5I+mKArqobbqFNZ+gUF18xHrDU9k/d4NqHI6zu4=; b=kSNo2lncjGnduSl5nWjTqm7uTYkmYpIqzi4/JKuNbJd6ZGUUVt8IUn0TT+9LZnhyd1 Wr8HZrUDmK2dgFpkC5vVMG635za5L03qyw/eLa0HO/SQUqGRacX8OePBzBH+Y47qGM2r LfO4FHQJFwxEMi8jceaNYxf57akp4FDObV+BrBQzJCPcRcdQpuZaBlgwFdLwAI282F36 XB7IRRtPpA5Wy6LOaJ41utGnt5a72A/cxLYFlk5OVa58hwbagm8zk5hOwyqNMLjbYuiA acyf7akLpjB51qZoUh5nHBrWicUYMfZz86qHabdr1yiA/bLwxklP1ihJyxyGY6kJe8Ta Y2Kw== X-Gm-Message-State: APjAAAVNhrBLxZ8t54MUzKKv9UiKK65OSfpqn2Zkh+RNp5x05X5L4Vqf sc2HWwg6FOtfb6g4zrfkA+4eEw== X-Received: by 2002:a63:b64a:: with SMTP id v10mr2701819pgt.145.1579851172840; Thu, 23 Jan 2020 23:32:52 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id p5sm5517224pga.69.2020.01.23.23.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2020 23:32:52 -0800 (PST) Date: Fri, 24 Jan 2020 16:32:50 +0900 From: Sergey Senozhatsky To: Hans Verkuil Cc: 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, Sergey Senozhatsky Subject: Re: [RFC][PATCH 13/15] videobuf2: do not sync buffers for DMABUF queues Message-ID: <20200124073250.GA100275@google.com> References: <20191217032034.54897-1-senozhatsky@chromium.org> <20191217032034.54897-14-senozhatsky@chromium.org> <2d0e1a9b-6c5e-ff70-9862-32c8b8aaf65f@xs4all.nl> <20200122050515.GB49953@google.com> <57f711a0-6183-74f6-ab24-ebe414cb6881@xs4all.nl> <20200124022544.GD158382@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200124022544.GD158382@google.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (20/01/24 11:25), Sergey Senozhatsky wrote: [..] > > > Then, if q->allow_cache_hint is set, then default to a cache sync (cache clean) > > in the prepare for OUTPUT buffers and a cache sync (cache invalidate) in the > > finish for CAPTURE buffers. > > We alter default cache sync behaviour based both on queue ->memory > type and queue ->dma_dir. Shall both of those cases depend on > ->allow_cache_hints, or q->memory can be independent? > > static void set_buffer_cache_hints(struct vb2_queue *q, > struct vb2_buffer *vb, > struct v4l2_buffer *b) > { > if (!q->allow_cache_hints) > return; > > /* > * 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; > } I personally would prefer this to be above ->allow_cache_hints check, IOW to be independent. Because we need to skip flush/invalidation for DMABUF anyway, that's what allocators do in ->prepare() and ->finish() currently. -ss