Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4392340imu; Mon, 7 Jan 2019 22:35:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN7Vus6NQaqMuG+A2yaXhFhldr2S3mFHdOz4hFCxlhpnd5gBR4m+J0Vcik4D4PEm0KWpIG/j X-Received: by 2002:a63:e348:: with SMTP id o8mr473855pgj.158.1546929328455; Mon, 07 Jan 2019 22:35:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546929328; cv=none; d=google.com; s=arc-20160816; b=aV4VxusGqI4la6hVk7kxFf4bP4BneYxkXrtNUmc715JVrw75nGsH7BeM5fS1aDq1i/ y8vPYkb/0LKmQk6WkG3xWzcPwKbxTUAwbdhD8+PvICHzHtFECAJ8GQxpxudHrZcFRQIl gaqbsL2Z58ry5SuWYQ5eGrI4CS6YwQzd4LZ9YzLcJffXk131ZcTpq+nNEwtQlC786UQw Bg7vIM0y485qGNw/fjFxmGZ8+fuDXjeqlXFTj6sA13yVs957P39IuchYae6+gOsIe7lH fR/633xUEXj+O4YIqC6PISQ45qE7CWOXVhvWeNnc21eBx3z3e0GrZoo4YRiGLbMCRTjm KHpQ== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=5se9eY7y1Ym3hFdOMq25vpueA+u0CSGdgKEFNkPduC8=; b=xVV4tqGs5newzWevIh6c7DuQKKKpq1Rr6z62o7bSRUA8Z3n1FLWmfDU7pIJkdV/MEA GEIqjGVp4vP71IqsA8zWgD/04N05VGLNphnfcBXgDIoY7N1NAf5rQICXxazA3kNGVi80 Jr3F6pEPa/WOca79Hj8RYAoY6+3EvoNYQOXk1lMsgLfEo6Wlineuh/HePQsFTWjOeQdA 0hHeO7vfevjQid1M5xbQ0ZISy/daZCD18Wf/i3mOT2Y8dthEXNXH0pDV9pTCHTom5HQE 6q99BYK9PeB4Q766wnqqKph+S7sC8R+fDsJ6R/XRthhGZSiGda1pPOcBA3Qe8Qf39Ohi eS2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=EZlFwg9d; 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 p186si8677683pgp.37.2019.01.07.22.35.12; Mon, 07 Jan 2019 22:35:28 -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=EZlFwg9d; 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 S1727813AbfAHGeE (ORCPT + 99 others); Tue, 8 Jan 2019 01:34:04 -0500 Received: from mail-ot1-f68.google.com ([209.85.210.68]:45258 "EHLO mail-ot1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727538AbfAHGeE (ORCPT ); Tue, 8 Jan 2019 01:34:04 -0500 Received: by mail-ot1-f68.google.com with SMTP id 32so2555451ota.12 for ; Mon, 07 Jan 2019 22:34:03 -0800 (PST) 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:content-transfer-encoding; bh=5se9eY7y1Ym3hFdOMq25vpueA+u0CSGdgKEFNkPduC8=; b=EZlFwg9drOm9lYYarTO0yDRZt6A5nSZavlsxxTbNY3d2aFBHx6ettvSprbgLDWMMNc 8Bh52f2GhPgxN+HDTg5UecEZ6ybhyrjGvLUd95D0BqSeGwuEEq3BP1Kc1MQbygRnh/MK XW4SlUit3Cfvq6zjlT/n/Xh85ZnOjwgnmNMOs= 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:content-transfer-encoding; bh=5se9eY7y1Ym3hFdOMq25vpueA+u0CSGdgKEFNkPduC8=; b=B9Cx8FX/2+L+Zrpb5Z8+/GfdVa4c6sHoVU99tiXvO//CLb1X4aVZpV4eyPSLrw7swK POz9T6IBIBIM9VtCCfz6Yp85mzf9keV2I+umeEOGjp/nm0GH9Qys/fZH2ItYONH+i2et ZTclmlGo6IOQr7uwJiE+CzvQ64SBYikwfRLacW/hLDGMYGrDkxEOEsWVLHXK0mmP2xuw KkPejp2BKtrnHUQopU1ypT3424vX2ikby7/BCR2+DHM0R7IWApg8DalJtMSt86HzYR+N acv9SylUJEFkxM2Z6kA/qItPXmjaB/TVOtdCMQUzZefw1n7fm+MVTV9LggEJgwKAKnI+ c+FA== X-Gm-Message-State: AJcUukcwlXxlRxzuWK4r0BqUMv5E/BKwItqR2u+yTL/DPkjTdVGNX/ub Qfn5W6t7e+GzRy60eOcKtUoRBRu9drHdVw== X-Received: by 2002:a9d:6c94:: with SMTP id c20mr359007otr.251.1546929242656; Mon, 07 Jan 2019 22:34:02 -0800 (PST) Received: from mail-oi1-f182.google.com (mail-oi1-f182.google.com. [209.85.167.182]) by smtp.gmail.com with ESMTPSA id r203sm32012282oih.11.2019.01.07.22.33.59 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Jan 2019 22:34:00 -0800 (PST) Received: by mail-oi1-f182.google.com with SMTP id i6so2466494oia.6 for ; Mon, 07 Jan 2019 22:33:59 -0800 (PST) X-Received: by 2002:aca:b882:: with SMTP id i124mr369829oif.127.1546929239276; Mon, 07 Jan 2019 22:33:59 -0800 (PST) MIME-Version: 1.0 References: <20190105183150.20266-1-ayaka@soulik.info> <20190105183150.20266-5-ayaka@soulik.info> <50db3bc3faea97182b7fe18b4d9677f7e1563eaa.camel@collabora.com> <85C6CA4D-CC54-422B-BC2B-25EA10701696@soulik.info> In-Reply-To: <85C6CA4D-CC54-422B-BC2B-25EA10701696@soulik.info> From: Tomasz Figa Date: Tue, 8 Jan 2019 15:33:48 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 4/4] arm64: dts: rockchip: add video codec for rk3399 To: Ayaka Cc: Ezequiel Garcia , Ezequiel Garcia , "open list:ARM/Rockchip SoC..." , Nicolas Dufresne , myy@miouyouyou.fr, Paul Kocialkowski , Mauro Carvalho Chehab , linux-media , Hans Verkuil , Heiko Stuebner , linux-arm-kernel , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 7, 2019 at 2:30 AM Ayaka wrote: > > Hello Ezequiel > > Sent from my iPad > > > On Jan 7, 2019, at 1:21 AM, Ezequiel Garcia wrote: > > > >> On Sun, 6 Jan 2019 at 13:16, Ayaka wrote: > >> > >> > >> > >> Sent from my iPad > >> > >>> On Jan 7, 2019, at 12:04 AM, Ezequiel Garcia = wrote: > >>> > >>> On Sun, 2019-01-06 at 23:05 +0800, Ayaka wrote: > >>>>> On Jan 6, 2019, at 10:22 PM, Ezequiel Garcia wrote: > >>>>> > >>>>> Hi Randy, > >>>>> > >>>>> Thanks a lot for this patches. They are really useful > >>>>> to provide more insight into the VPU hardware. > >>>>> > >>>>> This change will make the vpu encoder and vpu decoder > >>>>> completely independent, can they really work in parallel? > >>>> As I said it depends on the platform, but with this patch, the user = space would think they can work at the same time. > >>> > >>> > >>> I think there is some confusion. > >>> > >>> The devicetree is one thing: it is a hardware representation, > >>> a way to describe the hardware, for the kernel/bootloader to > >>> parse. > >>> > >>> The userspace view will depend on the driver implementation. > >>> > >>> The current devicetree and driver (without your patches), > >>> model the VPU as a single piece of hardware, exposing a decoder > >>> and an encoder. > >>> > >>> The V4L driver will then create two video devices, i.e. /dev/videoX > >>> and /dev/videoY. So userspace sees an independent view of the > >>> devices. > >>> > >> I knew that, the problem is that the driver should not always create a= decoder and encoder pair, they may not exist at some platforms, even some = platforms doesn=E2=80=99t have a encoder. You may have a look on the rk3328= I post on the first email as example. > > > > That is correct. But that still doesn't tackle my question: is the > > hardware able to run a decoding and an encoding job in parallel? > > > For rk3328, yes, you see I didn=E2=80=99t draw them in the same box. > > If not, then it's wrong to describe them as independent entities. > > > >>> However, they are internally connected, and thus we can > >>> easily avoid two jobs running in parallel. > >>> > >> That is what the mpp service did in my patches, handing the relationsh= ip between each devices. And it is not a easy work, maybe a 4k decoder woul= d be blocked by another high frame rate encoding work or another decoder se= ssion. The vendor kernel have more worry about this, but not in this versi= on. > > > > Right. That is one way to design it. Another way is having a single > > devicetree node for the VPU encoder/decoder "complex". > No, you can=E2=80=99t assume which one is in the combo group, it can be v= arious. you see, in the rk3328, the vdpu is paired with an avs+ decoder. Th= at is why I use a virtual device standing for scheduler. First of all, thanks for all the input. Having more understanding of the hardware and shortcomings of the current V4L2 APIs is really important to let us further evolve the API and make sure that it works for further use cases. As for the Device Tree itself, it doesn't always describe the hardware in 100%. Most of the time it's just the necessary information to choose and instantiate the right drivers and bind to the right hardware resources. The information on which hardware instances on the SoC can work independently can of course be described in DT (e.g. by sub-nodes of a video-codec complex OR a set of phandles, e.g. rockchip,shared-instances), but it's also perfectly fine to defer this kind of knowledge to the drivers themselves. Best regards, Tomasz