Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754256AbdHUONf (ORCPT ); Mon, 21 Aug 2017 10:13:35 -0400 Received: from mail-wr0-f177.google.com ([209.85.128.177]:36495 "EHLO mail-wr0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753969AbdHUONb (ORCPT ); Mon, 21 Aug 2017 10:13:31 -0400 Subject: Re: [PATCH 1/7 v3] media: vb2: add bidirectional flag in vb2_queue To: Marek Szyprowski , Mauro Carvalho Chehab , Hans Verkuil Cc: Pawel Osciak , Kyungmin Park , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20170818141606.4835-2-stanimir.varbanov@linaro.org> <20170821113410.17542-1-stanimir.varbanov@linaro.org> <9757cfb2-66b3-7c8e-bb60-25b14706fbe9@samsung.com> From: Stanimir Varbanov Message-ID: <0137b1b9-1eb1-cff6-0e0e-fed446ccca64@linaro.org> Date: Mon, 21 Aug 2017 17:13:28 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <9757cfb2-66b3-7c8e-bb60-25b14706fbe9@samsung.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1525 Lines: 44 Hi Marek, On 08/21/2017 03:21 PM, Marek Szyprowski wrote: > Hi Stanimir, > > On 2017-08-21 13:34, Stanimir Varbanov wrote: >> This change is intended to give to the v4l2 drivers a choice to >> change the default behavior of the v4l2-core DMA mapping direction >> from DMA_TO/FROM_DEVICE (depending on the buffer type CAPTURE or >> OUTPUT) to DMA_BIDIRECTIONAL during queue_init time. >> >> Initially the issue with DMA mapping direction has been found in >> Venus encoder driver where the hardware (firmware side) adds few >> lines padding on bottom of the image buffer, and the consequence >> is triggering of IOMMU protection faults. >> >> This will help supporting venus encoder (and probably other drivers >> in the future) which wants to map output type of buffers as >> read/write. >> >> Signed-off-by: Stanimir Varbanov > > Thanks for the patch. > > Acked-by: Marek Szyprowski Thanks! > > While touching this, I would love to unify set_page_dirty_lock() > related code in videobuf2-dc, videobuf2-sg and videobuf2-vmalloc. > > IMHO the pattern used in videobuf2-vmalloc should be copied to > videobuf2-sg (currently checks for dma_dir for every single page) > and videobuf2-dc (currently it lacks any checks and calls > set_page_dirty_lock() unconditionally). If you have a little bit > of spare time, please prepare a separate patch for the above > mentioned fix. Sure, I'll unify set_page_dirty_lock invocations in separate patch. -- regards, Stan