Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4434694ybl; Mon, 3 Feb 2020 18:58:42 -0800 (PST) X-Google-Smtp-Source: APXvYqwkdHrzP2xktS6Mx2ALetbDCeqy0T2gz+HbbFmVmRUxGZXp1J+Q/fNb9raIjJF5pQ6JNj7t X-Received: by 2002:a05:6808:3b4:: with SMTP id n20mr1810216oie.78.1580785122676; Mon, 03 Feb 2020 18:58:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580785122; cv=none; d=google.com; s=arc-20160816; b=m0hg+RW8MeB09XmGbGnO1bviyoImFRuxeTWQdFdZBQAQLV1IAhtX9YIKNKkonY5384 Mm6hSm4D7fkGAKRubE2aQ1P5lFINj54+VlTT3iyUJTrDky1er0eV68AWWe7eLALWSicz Ey4nC+jFfHor6weccGCBufIt6/ECkcvWpnAR4YtpqcsgEvL+zv9sMMgcWBQA4c4KLDY/ BCwptkGkZFxMbO8EAh5MKKz5Op4Jim3mVl00j6JeBrD1vN0JRzKHAr7PBWkx0riZfDPo AInVKoc0O9btypiYXmZLZEI+WTtG2i2pehGNKWaEd3PNeQVv9QY5j6hErtmapxdk02yw OPoA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3NyRU2xy1z/nYwBRLVUPtO+ZHRnpI9P9k60fSC2X+DE=; b=uH+Gvhct8t8HvSC5azMQ7DMQD5ORJjd1eu+v6is0ZPeR1ooV1VwcEKDZ4C5YRREXeJ x4OBZA772WNqqRZqd+bBqHbBVoeAigpocNEEZHpHKBq79QjhRwAeEE/kqp8TMUXRCi4B +85hRkP+62wRI9/pPpyBw4fCKR89DlXGeePzTTyeh0pbHADK6oFPo2Vn9G72MqWszkC7 fhiD1fteu385Ovd6V0nPFGhlkntp5C+gtHGvEI8wj2lroQFc4SaottRvxr9snieqx1bo Q4tPI5HIQtbqO/DqAOhyXgeBcxWYZNcUf82c1mfEYiEHWIa+/c5b7iRkPrnFSSYCtHsb 8eQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=j3Fq0i83; 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 g25si10898698otp.20.2020.02.03.18.58.30; Mon, 03 Feb 2020 18:58:42 -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=j3Fq0i83; 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 S1727311AbgBDC5S (ORCPT + 99 others); Mon, 3 Feb 2020 21:57:18 -0500 Received: from mail-pf1-f195.google.com ([209.85.210.195]:46376 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727296AbgBDC5O (ORCPT ); Mon, 3 Feb 2020 21:57:14 -0500 Received: by mail-pf1-f195.google.com with SMTP id k29so8651425pfp.13 for ; Mon, 03 Feb 2020 18:57:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3NyRU2xy1z/nYwBRLVUPtO+ZHRnpI9P9k60fSC2X+DE=; b=j3Fq0i83ztEE46oH9dTHoPUFBJ9tpWElVSi0sKJRUZcsRbsxCRK+bWgt1i6ZdvjhO8 ZV7hTIydDJatMj68kNoBQQ/DWG5kqPpCeiEGZheluT9CfCXmnX4rmfk92P97gjhc1IzM EFAdrs3PsNDg1PIBW0b1qc0dRsThBCU7KFkmQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3NyRU2xy1z/nYwBRLVUPtO+ZHRnpI9P9k60fSC2X+DE=; b=W5e2Wa2ehmf+kBXahKAxLzSgGO42aWXd0aSt2PPVMfeAGcxk87InIAbHGx+RdJKkJa acAokHSXc2ynnWP9h4j2wmCK6SE9FCFLQ4hPS8L/dQUVINWFSezKj/PU8Jm1tT3kGrVl 1WLEOtv+FwdywCDS9bcZbsF8PnSbvpy0hreu+/YqBkUxA1uTaMegvDI+QX0J08M9rwDe TKXYsiouJFvm7B49nRSAdFsqpltVp9iWzLmadfwbxNf7Xh70FCotCr/kNui+zTj2Yw+8 nCWZ5L2QtVT+sTyqf4eRnCiR+RZ7dHmlppUCIem9kUUo+Wh6Wq6wwZLGKn8eV7Dz2pkr 64VQ== X-Gm-Message-State: APjAAAVC32yxvltwPWtlzpGrPKaxaDmAnpiMhc12l3UNYZMT7rvLqZuf /HSQZtl/6o8WBwagqCSKo0y1XA== X-Received: by 2002:a63:ed4a:: with SMTP id m10mr25299793pgk.99.1580785034064; Mon, 03 Feb 2020 18:57:14 -0800 (PST) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id e1sm22491971pfl.98.2020.02.03.18.57.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 18:57:13 -0800 (PST) From: Sergey Senozhatsky To: Hans Verkuil , Tomasz Figa , Mauro Carvalho Chehab , Kyungmin Park , Marek Szyprowski Cc: Sakari Ailus , Laurent Pinchart , Pawel Osciak , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: [RFC][PATCHv2 07/12] videobuf2: do not sync caches when we are allowed not to Date: Tue, 4 Feb 2020 11:56:36 +0900 Message-Id: <20200204025641.218376-8-senozhatsky@chromium.org> X-Mailer: git-send-email 2.25.0.341.g760bfbb309-goog In-Reply-To: <20200204025641.218376-1-senozhatsky@chromium.org> References: <20200204025641.218376-1-senozhatsky@chromium.org> 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 Skip ->prepare() or/and ->finish() cache synchronisation if user-space requested us to do so (or when queue dma direction permits us to skip cache syncs). Change-Id: I37c89d666542ed8d536eac329953d921bb1c94b6 Signed-off-by: Sergey Senozhatsky --- drivers/media/common/videobuf2/videobuf2-core.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index 46be9c790ff6..c3637ca0c65b 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -304,8 +304,11 @@ static void __vb2_buf_mem_prepare(struct vb2_buffer *vb) { unsigned int plane; - for (plane = 0; plane < vb->num_planes; ++plane) - call_void_memop(vb, prepare, vb->planes[plane].mem_priv); + if (vb->need_cache_sync_on_prepare) { + for (plane = 0; plane < vb->num_planes; ++plane) + call_void_memop(vb, prepare, + vb->planes[plane].mem_priv); + } vb->synced = 1; } @@ -317,8 +320,11 @@ static void __vb2_buf_mem_finish(struct vb2_buffer *vb) { unsigned int plane; - for (plane = 0; plane < vb->num_planes; ++plane) - call_void_memop(vb, finish, vb->planes[plane].mem_priv); + if (vb->need_cache_sync_on_finish) { + for (plane = 0; plane < vb->num_planes; ++plane) + call_void_memop(vb, finish, + vb->planes[plane].mem_priv); + } vb->synced = 0; } -- 2.25.0.341.g760bfbb309-goog