Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6782706ybf; Fri, 6 Mar 2020 04:31:55 -0800 (PST) X-Google-Smtp-Source: ADFU+vvk1X8zOx7TnoLPhoMqoE00RZ1A9ch3DvXsVBC61dSsTZRzIAp1R0s8yRXK5p6DARJkTbBw X-Received: by 2002:aca:5109:: with SMTP id f9mr1354383oib.14.1583497911028; Fri, 06 Mar 2020 04:31:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583497911; cv=none; d=google.com; s=arc-20160816; b=OXhvlCU49JKKVOTIx4zzrAld4eZKoA2sjMUkw+D5Ec4OEZctBRPhWfNXLogOstsYFB RIcKBARKBhwz7Hz3nMjrIjEsPSzj3dNFOccvm2O7Nn++ZVA33ksCz3n69jz+UpLXHAM5 WUA8shvLJlAo6uj/cbliyPcUjBdvLqXuOHIVQEaHa5dzWde2tAPVDWszatO9iXjlvECi a7hCsZK+SGXkYCjvSwSjUdcHQqVu2MYOwmA3oEdxdDkOEzOSTt8jxoUxp/kyUWoCoPy7 arUchut3huW5J0UNAfC5bWjfH3UVKeSEV/xdjxjcMZQ5OYmNDFaSXX94Pdvbh6HqD1sH XGUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:dkim-signature; bh=to7bU+MtbuWq2zSmrshAa2RS+7lmc+xLVoJxUf+INQ0=; b=EMP+1IhjziXrJ5VMQaNOBm5LhQh8IE+fqBNgcrk/VIEbT4NmyduVSrvT0LVE4xK5pZ liyAh8Ju159pE3jRNU6VWy80s6LTnl9Uq6iD+TBLMRYSnHRK4bkV1PkrTgO/4GMUcvwT uC8qDR99sIDI2W3S3lfeeyAa9lbShRMuK27p39WdZavW2b+Mt8gITE19YpeBYqFAlAzf 3vweY/OXnGTwBKcp7hvMAfJRtuGlUcqAAwaUpV+OredGOHAGEdMTdSJHjjseKheaFAEw vlxMdwB5sCKK9C8Pq1mUk5vd77QhCJZy4viZb4tsBnQLLXtC2qbgC11MpBLOi2PAgzc9 zm0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=l0EQ6qPc; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v19si1335010otn.100.2020.03.06.04.31.38; Fri, 06 Mar 2020 04:31:51 -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=@gmail.com header.s=20161025 header.b=l0EQ6qPc; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726378AbgCFMbM (ORCPT + 99 others); Fri, 6 Mar 2020 07:31:12 -0500 Received: from mail-lj1-f196.google.com ([209.85.208.196]:43432 "EHLO mail-lj1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726212AbgCFMbM (ORCPT ); Fri, 6 Mar 2020 07:31:12 -0500 Received: by mail-lj1-f196.google.com with SMTP id r7so2011066ljp.10 for ; Fri, 06 Mar 2020 04:31:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:in-reply-to:references :mime-version; bh=to7bU+MtbuWq2zSmrshAa2RS+7lmc+xLVoJxUf+INQ0=; b=l0EQ6qPcS14s2kGTIH/cVFg+M+r1om0oVHrp2ziFTs3W5dZo7pIDCpOuV3oEpxwQKI FEaAttqwy0EDA2gpyd6VO4XVaFUXSJ2Piiwn0K/lkpbfgJfIfdFrNxwqpGGlsqKnjuE1 brEh3Lcq4oQ+ApN96M2bp4SkOCiW0hElG2AJUIyA4cKIjPFvyOiz2ox1AucBB3FDunAI Q4TZ1fR8oyRRaOAyvrf7JmCEdx7t0SdR1dtQEjJYHnOJxhoHdiYybr/KZfusEKlnnq/i zgGlREj08Ql/Pi+N6uAseYkxvj+szMrdMSWnKhZCfjfrzpHzEFTL1tMAjUFlIPGVqaz7 ldWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:in-reply-to :references:mime-version; bh=to7bU+MtbuWq2zSmrshAa2RS+7lmc+xLVoJxUf+INQ0=; b=Wd4vSygjYJw/o8b523baHNF8BIqLqqrWe0DkMgVxm1f0SnAzH+L12MIgCx9n87m4Bo Ok09o8E5ceHSrenMWysHSnewp+4yjsL2oqMp466mPrR8wbAo+wxylplZMTcgYpvK0yMA PEwwsqia+XKtc+TXX9ItA0DG83giF3GXHwFERpOAhu766gwfklhB1aCFJPefOVvzwcpL eFgeM144EWeI9/C8B4KKEs0k5VucD82rbhDdU8OhYR9LTBQnX/0FDIWDcSx+GDJtx5t1 AxbtFXRGjO2ZzAVwWkzYB/AprrV1A8vc2HybLtUFK4n3YdvjzhRsIFULWj7xtwlBsjHS wUYw== X-Gm-Message-State: ANhLgQ3rqgEJEWaWLFOcZ1dqrpQQa4Jx0kJnZbmP3BFU/6XC0D9z3LNs LGJ1LJfa6vFBUbe8pXenFT0= X-Received: by 2002:a2e:9008:: with SMTP id h8mr1902762ljg.217.1583497867526; Fri, 06 Mar 2020 04:31:07 -0800 (PST) Received: from eldfell.localdomain ([194.136.85.206]) by smtp.gmail.com with ESMTPSA id u4sm2691157lfo.79.2020.03.06.04.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Mar 2020 04:31:07 -0800 (PST) Date: Fri, 6 Mar 2020 14:30:57 +0200 From: Pekka Paalanen To: Daniel Vetter Cc: Brian Starkey , Neil Armstrong , Linux Kernel Mailing List , dri-devel , linux-amlogic@lists.infradead.org, nd , Linux ARM Subject: Re: [PATCH 1/4] drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression Message-ID: <20200306143057.1506cac3@eldfell.localdomain> In-Reply-To: <20200306101328.GR2363188@phenom.ffwll.local> References: <20200221090845.7397-1-narmstrong@baylibre.com> <20200221090845.7397-2-narmstrong@baylibre.com> <20200303121029.5532669d@eldfell.localdomain> <20200303105325.bn4sob6yrdf5mwrh@DESKTOP-E1NTVVP.localdomain> <20200303152541.68ab6f3d@eldfell.localdomain> <20200303173332.1c6daa09@eldfell.localdomain> <20200306101328.GR2363188@phenom.ffwll.local> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; boundary="Sig_/r_fP+nfVOoASHK7UVgVRJ0U"; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --Sig_/r_fP+nfVOoASHK7UVgVRJ0U Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable On Fri, 6 Mar 2020 11:13:28 +0100 Daniel Vetter wrote: > On Tue, Mar 03, 2020 at 05:33:32PM +0200, Pekka Paalanen wrote: > > On Tue, 3 Mar 2020 15:25:41 +0200 > > Pekka Paalanen wrote: > > =20 > > > On Tue, 3 Mar 2020 12:37:16 +0100 > > > Daniel Vetter wrote: > > > =20 > > > > On Tue, Mar 3, 2020 at 11:53 AM Brian Starkey wrote: =20 > > > > > > > > > > Hi, > > > > > > > > > > On Tue, Mar 03, 2020 at 12:10:29PM +0200, Pekka Paalanen wrote: = =20 > > > > > > On Fri, 21 Feb 2020 10:08:42 +0100 > > > > > > Neil Armstrong wrote: > > > > > > =20 > > ... =20 > > > > > > > +/* > > > > > > > + * Amlogic Video Framebuffer Compression modifiers > > > > > > > + * > > > > > > > + * Amlogic uses a proprietary lossless image compression pro= tocol and format > > > > > > > + * for their hardware video codec accelerators, either video= decoders or > > > > > > > + * video input encoders. > > > > > > > + * > > > > > > > + * It considerably reduces memory bandwidth while writing an= d reading > > > > > > > + * frames in memory. > > > > > > > + * Implementation details may be platform and SoC specific, = and shared > > > > > > > + * between the producer and the decoder on the same platform= . =20 > > > > > > > > > > > > Hi, > > > > > > > > > > > > after a lengthy IRC discussion on #dri-devel, this "may be plat= form and > > > > > > SoC specific" is a problem. > > > > > > > > > > > > It can be an issue in two ways: > > > > > > > > > > > > - If something in the data acts like a sub-modifier, then adver= tising > > > > > > support for one modifier does not really tell if the data lay= out is > > > > > > supported or not. > > > > > > > > > > > > - If you need to know the platform and/or SoC to be able to int= erpret > > > > > > the data, it means the modifier is ill-defined and cannot be = used in > > > > > > inter-machine communication (e.g. Pipewire). > > > > > > =20 > > > > > > > > > > Playing devil's advocate, the comment sounds similar to > > > > > I915_FORMAT_MOD_{X,Y}_TILED: > > > > > > > > > > * This format is highly platforms specific and not useful for cr= oss-driver > > > > > * sharing. It exists since on a given platform it does uniquely = identify the > > > > > * layout in a simple way for i915-specific userspace. =20 > > > >=20 > > > > Yeah which we regret now. We need to now roll out a new set of > > > > modifiers for at least some of the differences in these on the > > > > modern-ish chips (the old crap is pretty much lost cause anyway). > > > >=20 > > > > This was kinda a nasty hack to smooth things over since we have epic > > > > amounts of userspace, but it's really not a great idea (and no one > > > > else really has epic amounts of existing userspace that uses tiling > > > > flags everywhere, this is all new code). > > > > -Daniel > > > > =20 > > > > > Isn't the statement that this for sharing between producer and de= coder > > > > > _on the same platform_ a similar clause with the same effect? > > > > > > > > > > What advantage is there to exposing the gory details? For Arm AFBC > > > > > it's necessary because IP on the SoC can be (likely to be) from > > > > > different vendors with different capabilities. > > > > > > > > > > If this is only for talking between Amlogic IP on the same SoC, a= nd > > > > > those devices support all the same "flavours", I don't see what is > > > > > gained by making userspace care about internals. =20 > > > >=20 > > > > The trouble is if you mix&match IP cores, and one of them supports > > > > flavours A, B, C and the other C, D, E. But all you have is a single > > > > magic modifier for "whatever the flavour is that soc prefers". So > > > > someone gets to stuff this in DT. > > > >=20 > > > > Also eventually, maybe, perhaps ARM does grow up into the > > > > client/server space with add-on pcie graphics, and at least for cli= ent > > > > you very often end up with integrated + add-in pcie gpu. At that po= int > > > > you really can't have magic per-soc modifiers anymore. =20 > > >=20 > > > Hi, > > >=20 > > > I also heard that Pipewire will copy buffers and modifiers verbatim > > > from one machine to another when streaming across network, assuming > > > that the same modifier means the same thing on all machines.[Citation= needed] > > >=20 > > > If that is something that must not be done with DRM modifiers, then > > > please contact them and document that. =20 > >=20 > > Sorry, it's waypipe, not pipewire: > > https://gitlab.freedesktop.org/mstoeckl/waypipe/ =20 >=20 > I do think this is very much something we want to make possible. They > might pick a silly modifier (compression modifiers only compress bw, by > necessity the lossless ones have to increase storage space so kinda dumb > thing to push over the network if you don't add .xz or whatever on top). >=20 > I'm also hoping that intel's modifiers are definitely the one and only > that we ever screwed up, and we should be getting those fixed in the near > future too. >=20 > So maybe what we should do instead is add a comment to the modifier docs > that this stuff _is_ supposed to be transferrable over networks and work. Personally I was not sure if it was so. Good to hear it is. Writing it down would be much appreciated. While at it, could you also write down something about the requirements of memory layout documentation? What I mean is, is it required that the memory layout is publicly specified *somewhere* if not in the modifier doc itself? It's not necessary for anyone to actually know the memory layout when the use cases only involve hardware access, but if there is no public spec I fear it would be easy to adapt an incompatible layout somewhere and never be able to notice until some rare case of interoperability mysteriously produces garbage. Thanks, pq --Sig_/r_fP+nfVOoASHK7UVgVRJ0U Content-Type: application/pgp-signature Content-Description: OpenPGP digital signature -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEJQjwWQChkWOYOIONI1/ltBGqqqcFAl5iQoEACgkQI1/ltBGq qqfCGxAAox4nO+w/VXB7GvaaUnfq9XR88+4sxGBKVIkfOVSsxxnE7oA+DAPrzq3C FqWKzbVYJhYTD84jea8tM029FeGPAlQbxZAph4YRM1kfCKqduxoPwoLOqR5k3W9X vkLo0T0m6oKslV2Gico/FFIRwCMZjHPh++ye8Ka9e/b+cNTTsYFH03gyAmyfiHa5 wmt91K/ubByRZTmY9QoihQto4M1W7t5V76hl2yjVRDkU6BVM1K8DB0K1VhPBTDfZ ratG+r1scmAM2bsbsFWwxaTiv1zF9Z1zvUZcSSKFkWbbsU+AF+rmdYBs+M9/Wnny INwPZIMg7GqzwV4z6J++E4TajjFLeku/pqmZSX2ITGu7f4WtOV64m5+aQDdohNuh kUepGl2CCFtWaAOLUwdpwfGw8SFA74g4ac1xTyBGgNECewmt44fkP785imtmtYAn BiTchituR4jNrOTEo9WiZ4+bDC5dgjhp9dfZdWSEe7l0r3HgDOdFYcNbaCap3tKt 5PE6MqyXXOD6yxqwfgpuFp/hja0T73RfzutNi6s84Bdx7M00lAg0owl3JrHx2Zou buqgRbNYYUYD7qmoYMUvpYlEsTCXClURVawf9G+Gh5Uc3bW5lGIR/DdzAw3tdPwW 9TkR0C7rUWVWIotYUxwUujYoq4FXWv1mD4C2t/F2FXD8WAiVBqs= =eeJ1 -----END PGP SIGNATURE----- --Sig_/r_fP+nfVOoASHK7UVgVRJ0U--