From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751885AbcGRIBu (ORCPT ); Mon, 18 Jul 2016 04:01:50 -0400 Received: from metis.ext.4.pengutronix.de ([92.198.50.35]:58514 "EHLO metis.ext.4.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbcGRIBt (ORCPT ); Mon, 18 Jul 2016 04:01:49 -0400 Date: Mon, 18 Jul 2016 10:01:39 +0200 From: Michael Olbrich To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Subject: Re: [PATCH] [media] vb2: map dmabuf for planes on driver queue instead of vidioc_qbuf Message-ID: <20160718080139.GA22269@pengutronix.de> Mail-Followup-To: linux-kernel@vger.kernel.org, linux-media@vger.kernel.org References: <1468599966-31988-1-git-send-email-javier@osg.samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1468599966-31988-1-git-send-email-javier@osg.samsung.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 09:49:36 up 53 days, 18:14, 39 users, load average: 0.14, 0.16, 0.17 User-Agent: Mutt/1.5.23 (2014-03-12) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: mol@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Fri, Jul 15, 2016 at 12:26:06PM -0400, Javier Martinez Canillas wrote: > The buffer planes' dma-buf are currently mapped when buffers are queued > from userspace but it's more appropriate to do the mapping when buffers > are queued in the driver since that's when the actual DMA operation are > going to happen. > > Suggested-by: Nicolas Dufresne > Signed-off-by: Javier Martinez Canillas > > --- > > Hello, > > A side effect of this change is that if the dmabuf map fails for some > reasons (i.e: a driver using the DMA contig memory allocator but CMA > not being enabled), the fail will no longer happen on VIDIOC_QBUF but > later (i.e: in VIDIOC_STREAMON). > > I don't know if that's an issue though but I think is worth mentioning. And for mem2mem devices? Does this mean that the second VIDIOC_STREAMON will fail? That would make it impossible detect if the buffers on the capture or the output side are incorrect. It's already quite difficult to handle these issues gracefully and without loosing any data. This would make it even worse. Regards, Michael -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |