Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp367670ybv; Wed, 19 Feb 2020 01:07:54 -0800 (PST) X-Google-Smtp-Source: APXvYqyo35U6QZq8BrFpkcekG8eP2xK64sXSvDizdKUT5sl2AOM8qG53bJDiIPjqfVpK/crpjynu X-Received: by 2002:aca:d4ca:: with SMTP id l193mr4143442oig.133.1582103274059; Wed, 19 Feb 2020 01:07:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582103274; cv=none; d=google.com; s=arc-20160816; b=TSbE/sF7MFD1B3tiArwx7cI9hwuZ6FpSmFFYF7dOwKdrkdSTlkN4t71DGR1VVb/+9T 9oFfNI/f2A/eDXPCmj5yoGdpAQDgF3AvjUDwqKgHBitT/UoRuDLo2WjsIuET29WCXoOi w6zxlP4sl42vzIPf7vFdO/ZAG6TMte/blRtlbynIZYLTbfGWXPWbVJjQOR7Hawj1oLFu Inl6m5J5HdqJM75lqzRL06NWWhh/4ZUKuracsvcaiNOilqDyr8i0iuYXXeyFnvQ7/Oxl ZP0uMe5gST7VnmlN9pQgkFElVcrVMVDkylXnOd1DrkRk2kTJ9RMoHi0O9GfxS121+hA1 7p2Q== 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=MHb/19gJYPsAg71KRRWbuzDnz+m/m3K8W3L6MyDMF70=; b=CkG37b+tjQctV0az1y2n+Fd+TaoO+FTBtklHDrEuVp78ydaVtNot29igyb3iKLLYrq YqbZM49gfVpNt/QsIrwtdQR7FFsemIV6YljNzQAUEvkQs3j+ShcPgkvu8omaeKGSZb2B +upB5s+NAYFXVlI8iH2amBAlzUUiZhW+WgccvuJk5/HmAu/CPMEB+rUc4QJ6HULde2dC PrgBrLy6F/IreRAdSLaEntnMirhVMXiZH45YkwQnaqLhy/wSU52U3r65ZFn5/BPdv0Jb iA0bn4RVMtTm2kyVMm3H6s5uCfy7aZStuTwl6Qib+iKfjtcxVqGw+O48u3t76P7f7QnG IHMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PEl5zJNP; 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 g72si9876944oib.157.2020.02.19.01.07.41; Wed, 19 Feb 2020 01:07:54 -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=PEl5zJNP; 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 S1726453AbgBSJFv (ORCPT + 99 others); Wed, 19 Feb 2020 04:05:51 -0500 Received: from mail-pj1-f51.google.com ([209.85.216.51]:52623 "EHLO mail-pj1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726163AbgBSJFv (ORCPT ); Wed, 19 Feb 2020 04:05:51 -0500 Received: by mail-pj1-f51.google.com with SMTP id ep11so2299050pjb.2 for ; Wed, 19 Feb 2020 01:05:50 -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=MHb/19gJYPsAg71KRRWbuzDnz+m/m3K8W3L6MyDMF70=; b=PEl5zJNPTZ13sh03vuG3STMRi7yYdWvxlSO9I6m9T7ca225tueehBwEzPvdWyTLf2c 6GLBPw9n6bXaRHgrc3gHz9+N53a7dDq7MUxrRXociwiVomLYcBF0m92XNKkw8IGBKg+x +9yYIHshuaTpCTfOyXzjuKxpbVWr38aNboCzE= 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=MHb/19gJYPsAg71KRRWbuzDnz+m/m3K8W3L6MyDMF70=; b=KHSRGoBi+3nG2iJg4f+kn3CWQTOikFxnfIaQ8WRWqUGhd/BOpaGArFXsKD+/7HX7Fi cJenBd2qPF++qtsESgcWNWJhzzerRl1zvRnlwjSLFEwYL4qf0FHmFD4f1wbK0X9MV8q8 fOWlLpgKto3QPmQlkbzc2GL4F7fqHhO7TFiNFufCfA97KWDyJL+qMu1LnUTKBBzfOlnK 5AfNSsaJ4SIf+RlOeHJNlFrpXa74YqeRV/Et76+vgo+2snxZaLg6fdRVYsayNsF7yyd+ R7NJ5joN6RmwIQCE5Go3tffRl0TuDRYk2LKGLHelplF5R6rRAKO1zZsGbP3+omT3WvQ/ l/8Q== X-Gm-Message-State: APjAAAWuaYv64FoI8UkZmJUF+JsrInIh6RxfdIJ4QzomhgIVq2woHxSb HQltagDRCrsNkRYltQNB7y4KBQ== X-Received: by 2002:a17:902:7442:: with SMTP id e2mr25802611plt.158.1582103150121; Wed, 19 Feb 2020 01:05:50 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:5bbb:c872:f2b1:f53b]) by smtp.gmail.com with ESMTPSA id a69sm1984743pfa.129.2020.02.19.01.05.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Feb 2020 01:05:49 -0800 (PST) Date: Wed, 19 Feb 2020 18:05:47 +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 05/12] videobuf2: handle V4L2_FLAG_MEMORY_NON_CONSISTENT flag Message-ID: <20200219090547.GF122464@google.com> References: <20200204025641.218376-1-senozhatsky@chromium.org> <20200204025641.218376-6-senozhatsky@chromium.org> <83147032-25a4-9450-d455-437e82e09dc8@xs4all.nl> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <83147032-25a4-9450-d455-437e82e09dc8@xs4all.nl> 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:48), Hans Verkuil wrote: [..] > > int vb2_reqbufs(struct vb2_queue *q, struct v4l2_requestbuffers *req) > > { > > int ret = vb2_verify_memory_type(q, req->memory, req->type); > > + bool consistent = true; > > + > > + if (req->flags & V4L2_FLAG_MEMORY_NON_CONSISTENT) > > + consistent = false; > > There is no check against allow_cache_hints: if that's 0, then > the V4L2_FLAG_MEMORY_NON_CONSISTENT flag should be cleared since it is > not supported. The check is in set_queue_consistency() static void set_queue_consistency(struct vb2_queue *q, bool consistent_mem) { if (!q->allow_cache_hints) return; if (consistent_mem) q->dma_attrs &= ~DMA_ATTR_NON_CONSISTENT; else q->dma_attrs |= DMA_ATTR_NON_CONSISTENT; } I don't explicitly clear DMA_ATTR_NON_CONSISTENT attr for !->allow_cache_hints queues just in case if the driver for some reason sets that flag. ->allow_cache_hints is, thus, only for cases when user-space asks us to set or clear it. -ss