Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp3973961imm; Mon, 20 Aug 2018 07:47:35 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzc6JD2oH7Bdl/+iUmUksU9CymKIPdvvMKlQKGiPN/zNMwtSY+AAR859W18XV67WZRj7Hy1 X-Received: by 2002:a17:902:9693:: with SMTP id n19-v6mr45578766plp.282.1534776455643; Mon, 20 Aug 2018 07:47:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534776455; cv=none; d=google.com; s=arc-20160816; b=gAxQ+D3NMSUcX4NtNxgHJ/V60HvcJb5557XCqIL3p5Gi2xAkGRwFWMax9Q7V+1W9Tx ELbIzSD+leh1wfTJXJTSmhH6AklQsXmNGCBnWMYqs4ULnMGYgeXwW/gCWAKB4d6dho9t LJ2z8RiU3050EY6ksyL2NFLaq+cWbSiBVB6VC+ly5/97iM9oFfbWa+xiAPfDzFYkhyKa ItXCAyE1OEXzu93BC0cb+pJowfDw6iqGfb2urCEmcFs+VHmzuMAK3d+mERfM9dAOtqx+ L08v1afZ9PDrGcTG75hizPQdRfoEOWqMTx3daxz1p58fLJAc29SxiuJ7h00I/kw9YJA9 Xmsg== 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:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=BM9Ie2+eJODCdbVHivmhl1LsuWphQTjL7i4PqcByZQs=; b=FxRJ43PPEm7ITcq4c0WlX3wFwVddrtiVEyluwgfh8i8fQO6f6hWON+J+5gJSWmCo0y 6nS/MiXur3yBefH08D7bzccP9SScxcSviFIeeWtNE6fjG6A+++I3MXifWoqZMoKxVs/I 0/uKrnOFXmm94QQpLWAtzrNLWWb2I0iYOJdaXNSbo+eoJqWz+PkTw+Qn91EkDrjr47jN EVeCIVDy2YRqy094yIuJ8Tpq8K9UTMTQkCJV2WUlJIflH+pdHA8rsL30pLh7KkGgE0ZW DQXYl7MFiqyiWjx5UPvVBJOWejv4KFD5VmlGN0Tw3ZqCWnw6XSNhJTD1+JcToumqvIZu DxEQ== ARC-Authentication-Results: i=1; mx.google.com; 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 h29-v6si9421572pgb.53.2018.08.20.07.47.20; Mon, 20 Aug 2018 07:47:35 -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; 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 S1726617AbeHTR3O (ORCPT + 99 others); Mon, 20 Aug 2018 13:29:14 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:43307 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726590AbeHTR3N (ORCPT ); Mon, 20 Aug 2018 13:29:13 -0400 Received: from lupine.hi.pengutronix.de ([2001:67c:670:100:3ad5:47ff:feaf:1a17] helo=lupine) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1frkvr-0001ZA-LD; Mon, 20 Aug 2018 16:13:23 +0200 Message-ID: <1534774398.5445.32.camel@pengutronix.de> Subject: Re: [PATCH 1/2] media: docs-rst: Document memory-to-memory video decoder interface From: Philipp Zabel To: Tomasz Figa 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, Tiffany Lin =?UTF-8?Q?=28=E6=9E=97=E6=85=A7=E7=8F=8A=29?= , Andrew-CT Chen =?UTF-8?Q?=28=E9=99=B3=E6=99=BA=E8=BF=AA=29?= , todor.tomov@linaro.org, nicolas@ndufresne.ca, Paul Kocialkowski , Laurent Pinchart , dave.stevenson@raspberrypi.org, Ezequiel Garcia Date: Mon, 20 Aug 2018 16:13:18 +0200 In-Reply-To: References: <20180724140621.59624-1-tfiga@chromium.org> <20180724140621.59624-2-tfiga@chromium.org> <1534770242.5445.13.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:100:3ad5:47ff:feaf:1a17 X-SA-Exim-Mail-From: p.zabel@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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz, On Mon, 2018-08-20 at 22:12 +0900, Tomasz Figa wrote: > On Mon, Aug 20, 2018 at 10:04 PM Philipp Zabel wrote: > > > > On Tue, 2018-07-24 at 23:06 +0900, Tomasz Figa wrote: > > [...] > > > +Seek > > > +==== > > > + > > > +Seek is controlled by the ``OUTPUT`` queue, as it is the source of > > > +bitstream data. ``CAPTURE`` queue remains unchanged/unaffected. > > > + > > > +1. Stop the ``OUTPUT`` queue to begin the seek sequence via > > > + :c:func:`VIDIOC_STREAMOFF`. > > > + > > > + * **Required fields:** > > > + > > > + ``type`` > > > + a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT`` > > > + > > > + * The driver must drop all the pending ``OUTPUT`` buffers and they are > > > + treated as returned to the client (following standard semantics). > > > + > > > +2. Restart the ``OUTPUT`` queue via :c:func:`VIDIOC_STREAMON` > > > + > > > + * **Required fields:** > > > + > > > + ``type`` > > > + a ``V4L2_BUF_TYPE_*`` enum appropriate for ``OUTPUT`` > > > + > > > + * The driver must be put in a state after seek and be ready to > > > + accept new source bitstream buffers. > > > + > > > +3. Start queuing buffers to ``OUTPUT`` queue containing stream data after > > > + the seek until a suitable resume point is found. > > > + > > > + .. note:: > > > + > > > + There is no requirement to begin queuing stream starting exactly from > > > + a resume point (e.g. SPS or a keyframe). The driver must handle any > > > + data queued and must keep processing the queued buffers until it > > > + finds a suitable resume point. While looking for a resume point, the > > > > I think the definition of a resume point is too vague in this place. > > Can the driver decide whether or not a keyframe without SPS is a > > suitable resume point? Or do drivers have to parse and store SPS/PPS if > > the hardware does not support resuming from a keyframe without sending > > SPS/PPS again? > > The thing is that existing drivers implement and user space clients > rely on the behavior described above, so we cannot really change it > anymore. My point is that I'm not exactly sure what that behaviour is, given the description. Must a driver be able to resume from a keyframe even if userspace never pushes SPS/PPS again? If so, I think it should be mentioned more explicitly than just via an example in parentheses, to make it clear to all driver developers that this is a requirement that userspace is going to rely on. Or, if that is not the case, is a driver free to define "SPS only" as its "suitable resume point" and to discard all input including keyframes until the next SPS/PPS is pushed? It would be better to clearly define what a "suitable resume point" has to be per codec, and not let the drivers decide for themselves, if at all possible. Otherwise we'd need a away to inform userspace about the per-driver definition. > Do we have hardware for which this wouldn't work to the point that the > driver couldn't even continue with a bunch of frames corrupted? If > only frame corruption is a problem, we can add a control to tell the > user space to seek to resume points and it can happen in an > incremental patch. The coda driver currently can't seek at all, it always stops and restarts the sequence. So depending on the above I might have to either find and store SPS/PPS in software, or figure out how to make the firmware flush the bitstream buffer and restart without actually stopping the sequence. I'm sure the hardware is capable of this, it's more a question of what behaviour is actually intended, and whether I have enough information about the firmware interface to implement it. regards Philipp