Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp338064ybv; Wed, 19 Feb 2020 00:26:00 -0800 (PST) X-Google-Smtp-Source: APXvYqzIDz6Z4uUt7PaKKZDdcV5vkPxkqb9TiR3RgT+XbGNiBalG/hE43QEsqJCoUNBb+R0xjFbX X-Received: by 2002:a05:6830:1011:: with SMTP id a17mr17701626otp.45.1582100760007; Wed, 19 Feb 2020 00:26:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582100759; cv=none; d=google.com; s=arc-20160816; b=Ks8zKRv6ZR7mxE0GvzK6FEg0gckmyaCDoN55YNRNkKv/l5eMCQIFz3NIdSSDZpruav uda7ro5xqUVBo9AHAuW69oAt5ZTrfuOmNNjT7EN34ymvCQSFrf9Wu6y8viV/wABEUhO7 kFrWrZpHk7xmsCinIaUVMH+fu9Bn7Itpd060v6pq8AdyxaN51+OahyvLszbAlw6+GTha qM/mjQVZOFWZe+dRY5uOaKP4DhEQ44moK2ZUP/1TBeSugVGRro03WhdFqa827KCXRH0R NPaSBcEv+SArJVJGaZez12BrESAD/lsE/ZB9aAA6L20LZxisXSfp8/2LIymR/kjUbwkg aq5Q== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=lUfUKWe2Bfb5gG+/BpstAHDP/koJsEO/B2fHNDWqcwk=; b=rDCloA6RYeHamVgb8O7I2Zw3Jj9M/SpL10sHrs5EDWglj7n5o4B92Fd6CRvySvdrZx rYfxavBty304+qBTr1/x5t8hLFQoGpFH3hk/L5+bQFJA6GDbJmjZFmGENHsORr5V7mah Xmhxx5Z7fv8P2BgQHUPVTwaws19Bwywx4BRslXrgWZSROzIMD0Fn9VgUhX3J58OOaDAX o1443z5OQpxjY7K+LKHJdXEB+zq16xbOWHEr6/LX2r3DexjFPU5PtszoXhDOWzRPkxvK OViTALlW1RmNQRD23FS6ZeTZgoc+sSVI8IdJYiJjPIH2YfQ+b/HPm23SpjfeM+pcZVu3 wtvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@xs4all.nl header.s=s1 header.b=EjuFXbBv; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t192si8843348oif.75.2020.02.19.00.25.47; Wed, 19 Feb 2020 00:25:59 -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=@xs4all.nl header.s=s1 header.b=EjuFXbBv; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726484AbgBSIZf (ORCPT + 99 others); Wed, 19 Feb 2020 03:25:35 -0500 Received: from lb3-smtp-cloud7.xs4all.net ([194.109.24.31]:55283 "EHLO lb3-smtp-cloud7.xs4all.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726001AbgBSIZf (ORCPT ); Wed, 19 Feb 2020 03:25:35 -0500 Received: from [192.168.2.10] ([46.9.235.248]) by smtp-cloud7.xs4all.net with ESMTPA id 4KfhjzHQMP9a94KfkjnNci; Wed, 19 Feb 2020 09:25:33 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xs4all.nl; s=s1; t=1582100733; bh=lUfUKWe2Bfb5gG+/BpstAHDP/koJsEO/B2fHNDWqcwk=; h=Subject:To:From:Message-ID:Date:MIME-Version:Content-Type:From: Subject; b=EjuFXbBv826Dc3lPLJk/1sxIR9LPn/85xPLT0VGdUpindqovQD37MQbGUz60XPuF0 1DN+ccN7xj8uytEXAbZUpg1JSpgyMwFptPs3gU+V+7HM/Mdhwf2NresdteyrsSG00C uOKhdlmRdAD2yIZiNtYR8xgLGtyNmBUDmIZ0KjpCx0aBxlMVqyjsQhIV+HzOBe6Vj1 mDrVg3Ja9XkDSk8PutYIbWE39kBENVeBBn5hPQ9eaGUdfqRftPPUy4zUYg4QoBac0+ B1+/A+8Pjk/KD9jnCmF9iItc8411PK0LoBlD0BkU8EnD64C/7TF2bhbvbaat0kJhW2 C+HGIXBpzjTjw== Subject: Re: [RFC][PATCHv2 02/12] videobuf2: handle V4L2 buffer cache flags To: Sergey Senozhatsky 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 References: <20200204025641.218376-1-senozhatsky@chromium.org> <20200204025641.218376-3-senozhatsky@chromium.org> <20200219081340.GA122464@google.com> From: Hans Verkuil Message-ID: <2b1d9855-48dd-ecfe-7a7c-5998f76c3cd8@xs4all.nl> Date: Wed, 19 Feb 2020 09:25:29 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.5.0 MIME-Version: 1.0 In-Reply-To: <20200219081340.GA122464@google.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-CMAE-Envelope: MS4wfPaMWB+gyd/iGbZ87NIpSQdHLRgYTF64QoSpcEusuJlAEEkiXMJp/ztxCKVPthP2mIGqQqB7X/kxumB4M+pkAxgbQLygyGMuG8aOAHkLy7Hl1xf2+bnH crAE548JR4mgOrlh3NjbNkVPaayoZp+3TJjy6VhA+N1T+CRTNKDZkZ7lRFjb8Nb8IbcnMuwX3qHjvtKic0l19+2tBN3udGHl/0vBAIosk6xNCak784tdXK08 oDiuYvhy4JsBhhPVyxwsnL22cFWaBAVPacsPZiTrjZJMdJ/yLNclaS1ysYJx4opAgUOywfrRlcrx2XQqtOZLn95FyrYN8QXbtNgul/Dwtc9wcH3753WBM0vt fbNs5XXqG6lcljJLonT5xJ7kwWUbg/z1y1WiO51bhe6vAlicMeq+jwb3A3hdi+nbQwNT/7OiUvqleR8811vg7ZneFP8GTsx90Dq1/XmzSfY1AGkaQcLNZnUA mnRJfQYMHux0/yq+SqZZBrb1raVD6lBUF0URh3tgAYsDrYc+NiKiykz30+ndL/IdXQjFuw6woVasjBzK Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/19/20 9:13 AM, Sergey Senozhatsky wrote: > 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? Yes please! Regards, Hans > > -ss >