Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp90491ima; Sat, 20 Oct 2018 03:25:15 -0700 (PDT) X-Google-Smtp-Source: ACcGV62246P5Ao5phQUp67HUEYzA6Q9proMJpUg9QPq8uEkF8oRESMx6CP2JcYnMKZ1zqwsPLK1a X-Received: by 2002:a62:b286:: with SMTP id z6-v6mr38779911pfl.79.1540031115837; Sat, 20 Oct 2018 03:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540031115; cv=none; d=google.com; s=arc-20160816; b=qd0RqdwsUQ8on8XEEFvMd+TABV4DLYCRyFVfHBKE3y3fio3KMEvf5q+tb6M7FhLSSg 1KR8TdxS2u32kJbRNlqUikjTilQxGLWYRTfqDFNzk/tQIac/Dgkx1eUWBQMdeL429+y7 s9dDgjmFj5bgagI58xvlQu0Zpk6DKTA5wRPqHtFi4pMSVmpE8zh0iKQ5c0ys6CxZ4HL0 CF8o1kHweaoQu2kVYzg027YjSQRV5Xwii7/LOuZuSlbtYhcKwBPPHMeKARS6yvh6mGS7 oKI6LATHqN9E0gipwIe8FKED7RUe2nIGRpZP5rXkyieoB6XjaWgP4lCgA2KQt2+iLece vSUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=zhpX4f9IquPfi/JWkvSofHU1xjzBa5f9b6VXogAlsFc=; b=AaDcHt6fjQ+7JyShOd8tPHvG2B6M/rOWEAwNkkMoAZG6ip+FQtmo03nznulv0fOTz/ 9rdU7HJ/S6YVkoJ7IUEGzNiVKY0z2vxm3Pcsv+maLiJ/Gffo7D1OSkCpxJCDlEh6Z/YE JDZgn5L7XvAIRNpJzlLOP1aQE8mirtP0NJxivAx4zZXFsbIJfZNIWz4H3m+qDLiAs/T6 NWg6GtI7k5U68JXkSyoKku44VJ1ku5JFNEmjtNngBrtAyZAnIopTLp8QiHJQ0kvTc0n8 SbpU8khZcE+k7Me8jqlFDf2dBO/QiSCGDf4+XcgDTsWq3k7yJ3n7ZE8La9dVF2wEZl61 gZ5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=ITPue7gH; 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 o15-v6si27163311pgh.61.2018.10.20.03.24.59; Sat, 20 Oct 2018 03:25:15 -0700 (PDT) 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=ITPue7gH; 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 S1727411AbeJTSeg (ORCPT + 99 others); Sat, 20 Oct 2018 14:34:36 -0400 Received: from mail-yb1-f195.google.com ([209.85.219.195]:34147 "EHLO mail-yb1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727178AbeJTSef (ORCPT ); Sat, 20 Oct 2018 14:34:35 -0400 Received: by mail-yb1-f195.google.com with SMTP id 184-v6so14270387ybg.1 for ; Sat, 20 Oct 2018 03:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zhpX4f9IquPfi/JWkvSofHU1xjzBa5f9b6VXogAlsFc=; b=ITPue7gHkoAIPd0Cn7ZHw08lqxLFNA4WaZYgGr9J6J20h88eAPIBllyPyqoBOS3a6E eSFe5ovZiJMaUobdKx4v8DPwIH+Ls1BYp7PcaOOoxqB95kIoW0VfrX8fSycwVMWTy11+ KFg8iVsgAeLiHFKPi0Nsi5Q1eaiUlBBPgn/vI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zhpX4f9IquPfi/JWkvSofHU1xjzBa5f9b6VXogAlsFc=; b=E59MVU/RFW3z/8fqFHXoVWsPHH0A193TXKtBz+0kR9JupqzeDk1kxtPeuDjtKUko7l 7MDYCAjTQrKgm65hXvB6ByjAC9k2a+tsqH6JlxnLiGud6bkWVZUTHCI6u2jRODoiIu1T 6Ol/T8rxMdsaZAl3oKCyGrFRXTez+W1Gip9GVS6qDx+XJvZ1DKWuOR1OzmAO+s3FzyCp EHoGt6bdynmkPw3wa0440PbemKgNjGSU/Xg8gzVmyNRSWeRNBF/X/cFaqoOD2Mj2FyMc aMsppyE9l8Jv5lq6hlM4zqp9L9jo8YtmTrNsqZTXVCiMGtEkoDJcB2B0dXPhLg/obEWM b6jw== X-Gm-Message-State: ABuFfohGKrVwse6A1ej256b6K1qU0pRdn8zRFYTm75mfFvnJur2q2toX omjvgkumqkYzvLyvnavwMfYXw0sfQo4= X-Received: by 2002:a5b:acd:: with SMTP id a13-v6mr14677226ybr.421.1540031077712; Sat, 20 Oct 2018 03:24:37 -0700 (PDT) Received: from mail-yw1-f52.google.com (mail-yw1-f52.google.com. [209.85.161.52]) by smtp.gmail.com with ESMTPSA id 132-v6sm6271712ywt.2.2018.10.20.03.24.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 20 Oct 2018 03:24:35 -0700 (PDT) Received: by mail-yw1-f52.google.com with SMTP id a197-v6so14155364ywh.9 for ; Sat, 20 Oct 2018 03:24:34 -0700 (PDT) X-Received: by 2002:a81:3d8d:: with SMTP id k135-v6mr25966997ywa.415.1540031074207; Sat, 20 Oct 2018 03:24:34 -0700 (PDT) MIME-Version: 1.0 References: <20180724140621.59624-1-tfiga@chromium.org> <20180724140621.59624-2-tfiga@chromium.org> <9696282.0ldyWdpzWo@avalon> In-Reply-To: From: Tomasz Figa Date: Sat, 20 Oct 2018 19:24:20 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] media: docs-rst: Document memory-to-memory video decoder interface To: Laurent Pinchart Cc: Linux Media Mailing List , Linux Kernel Mailing List , Stanimir Varbanov , Mauro Carvalho Chehab , Hans Verkuil , Pawel Osciak , Alexandre Courbot , kamil@wypas.org, a.hajda@samsung.com, Kyungmin Park , jtp.park@samsung.com, Philipp Zabel , =?UTF-8?B?VGlmZmFueSBMaW4gKOael+aFp+ePiik=?= , =?UTF-8?B?QW5kcmV3LUNUIENoZW4gKOmZs+aZuui/qik=?= , todor.tomov@linaro.org, nicolas@ndufresne.ca, Paul Kocialkowski , dave.stevenson@raspberrypi.org, Ezequiel Garcia Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 18, 2018 at 7:03 PM Tomasz Figa wrote: > > Hi Laurent, > > On Wed, Oct 17, 2018 at 10:34 PM Laurent Pinchart > wrote: > > > > Hi Tomasz, > > > > Thank you for the patch. > > Thanks for your comments! Please see my replies inline. > > > > > On Tuesday, 24 July 2018 17:06:20 EEST Tomasz Figa wrote: [snip] > > > +4. At this point, decoding is paused and the driver will accept, but not > > > + process any newly queued ``OUTPUT`` buffers until the client issues > > > + ``V4L2_DEC_CMD_START`` or restarts streaming on any queue. > > > + > > > +* Once the drain sequence is initiated, the client needs to drive it to > > > + completion, as described by the above steps, unless it aborts the process > > > + by issuing :c:func:`VIDIOC_STREAMOFF` on ``OUTPUT`` queue. The client > > > + is not allowed to issue ``V4L2_DEC_CMD_START`` or ``V4L2_DEC_CMD_STOP`` > > > + again while the drain sequence is in progress and they will fail with > > > + -EBUSY error code if attempted. > > > > While this seems OK to me, I think drivers will need help to implement all the > > corner cases correctly without race conditions. > > We went through the possible list of corner cases and concluded that > there is no use in handling them, especially considering how much they > would complicate both the userspace and the drivers. Not even > mentioning some hardware, like s5p-mfc, which actually has a dedicated > flush operation, that needs to complete before the decoder can switch > back to normal mode. Actually I misread your comment. Agreed that the decoder commands are a bit tricky to implement properly. That's one of the reasons I decided to make the return -EBUSY while an existing drain is in progress. Do you have any particular simplification in mind that could avoid some corner cases? Best regards, Tomasz