Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp6899432ybf; Fri, 6 Mar 2020 06:41:11 -0800 (PST) X-Google-Smtp-Source: ADFU+vs/1C/eJ4e9E1/0YKKofIBKzp4BbP7ye9ci3kQAedwMomoh+66GBXcrYM5vceXVSB1EW3aJ X-Received: by 2002:a9d:3c1:: with SMTP id f59mr2894595otf.170.1583505671213; Fri, 06 Mar 2020 06:41:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583505671; cv=none; d=google.com; s=arc-20160816; b=yo2cjs/B4uUCCGuIbCT6yq3dQd7XCr6JIYLiseWfIMnXN+jHoEIL/NTi0ssS5BeFaG 4bIvuYtx2fYEZ5moKXdApzVqXRvSdbHxjVhI6HVbYV73Z3Y75kYTuAqFj2mmP40tKp4K oHXyNWvTokRlbkNyIzugmHSmOE3Na3gLIiYZc8XpJhMaKkvwC/ebw8KHR2eNRtpXvVMs Iaz+2FK/I6A2761C5Fx04SCkAtnupRpscQ+7LmhBl3LgbvbrlENeqzbOQV9hbYTr/5a/ NfcpO9O3W+lbb9XHalmQDFY5tvQ5ickKjrJeFMfhaj7oa1CGLLZmtn7TEgvclZD47ypx ILPw== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:cc:organization:autocrypt:from:references:to:subject :dkim-signature; bh=UHD8Cjg7cxe0FqPGUpuHhNgIy9D9uE3DNlkPjJCU8G8=; b=T/1XgOiZYDbQenmBMwe47YcFCsWwlQjaWLDE7aQh1ltz4wS4xjGuFCSUm4TL9m7oWh 7IrQSOpDDLr2endPrdY3UXIkbUhsEND/Fmqh6m4yoTS49thhGAoywGTfND8O1fEGqE8e xPPFyxbIel8Hu2RcweZMgzocQHEsWUYWvTa8VHLRRE9+mvN+M9wqEs4CEs05+YUGS86q DBausm6EcxxWDgXhC5z4VPvgjRPLqSGxlS64/8cq8vx90CFjyG0UvFkYM6lMrMKBZRLA Yv8qEaB4OtDhYu0Z3NBT1/JJ1rTwUqxK2JxiEWnZE2Zxa/ru42ryUz8yD/ViI+SCYQXE uUgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="l9aV7/iI"; 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 m11si1452099otl.297.2020.03.06.06.40.56; Fri, 06 Mar 2020 06:41:11 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b="l9aV7/iI"; 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 S1726873AbgCFOkH (ORCPT + 99 others); Fri, 6 Mar 2020 09:40:07 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:39745 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726240AbgCFOkH (ORCPT ); Fri, 6 Mar 2020 09:40:07 -0500 Received: by mail-wm1-f65.google.com with SMTP id j1so2626277wmi.4 for ; Fri, 06 Mar 2020 06:40:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:autocrypt:organization:cc:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UHD8Cjg7cxe0FqPGUpuHhNgIy9D9uE3DNlkPjJCU8G8=; b=l9aV7/iIMZWP7WExZGHmYOkk4/U6qN4T0pes5Cu/n3yRVNNMvlqwXVjFL/eECPwcRC 0zfbRVw2vY3ZXn2qtFPJJfnYOaVr72U84zkD5uGe8cfrXdLT3SSjPnwe8G88GOrVFhuB p26/ZrbLxY/Hi4uovWbZoyYOG5/g2gZv3OUQdL8/RgRk/P1KVMOwQw4V1naKFzY97qEG zbUySt+FaP86FFKR6ypJkrZ7RjMRIfnccU7H2E3Hhm5yhH58GJ5hQBDG3IveGQwp51Zb JKCopBvF6mL6QBnRnjsTtDa2X3QkMPikLUpQvqYb4gpEP1zTXkREy1TV/LZuL1EiP1Q4 51Ww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:autocrypt :organization:cc:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=UHD8Cjg7cxe0FqPGUpuHhNgIy9D9uE3DNlkPjJCU8G8=; b=N95QycRDpykwxC8dLj2B9N0atcby6saVhl+jmWDjMEwwfj05sPtifE+Gou3tzy2xT3 e+r29WL8ujOPxE1P0Ob7XKeMp9CZ2RX/IwZWZiuV4x0XiIF7unNJNr3xMYpYK2rZf7D9 0+RWt93cJ+CpOvUVke2ZDjh+eba3h0/cGAfXom+MBEy4s6/f35yl01+N7wrhHbn7GY6x EY0Dz/0rqBZW37Lsi26WTUR9CKl8Bs2bY9EnIhZUydKRPIQ3e4Kyi1TRnyEzwaJ0kV2q I/pJNMloWQ5YdDNeuLFaVPlylTiGoXcS3zkuoS2+dxWKnP0HyOTELflJGMnfn7rxlp/g WOXQ== X-Gm-Message-State: ANhLgQ0YaOiTBm6NgCW7uyjVSNbKTFg8XKrW9FElg2sLAhZ1Zw0LsZSS /qzlF6JOmt9izbcc0fSt6G2v2A== X-Received: by 2002:a1c:7ec5:: with SMTP id z188mr4285735wmc.52.1583505603072; Fri, 06 Mar 2020 06:40:03 -0800 (PST) Received: from ?IPv6:2a01:e35:2ec0:82b0:5c5f:613e:f775:b6a2? ([2a01:e35:2ec0:82b0:5c5f:613e:f775:b6a2]) by smtp.gmail.com with ESMTPSA id d15sm47329840wrp.37.2020.03.06.06.40.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Mar 2020 06:40:02 -0800 (PST) Subject: Re: [PATCH 1/4] drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression To: Pekka Paalanen , Brian Starkey , Daniel Vetter 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> From: Neil Armstrong Autocrypt: addr=narmstrong@baylibre.com; prefer-encrypt=mutual; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklrr85/3NU3oti3nrIHmHABEB AAHNKE5laWwgQXJtc3Ryb25nIDxuYXJtc3Ryb25nQGJheWxpYnJlLmNvbT7CwHsEEwEKACUC GyMGCwkIBwMCBhUIAgkKCwQWAgMBAh4BAheABQJXDO2CAhkBAAoJEBaat7Gkz/iubGIH/iyk RqvgB62oKOFlgOTYCMkYpm2aAOZZLf6VKHKc7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PCOBir5m2J+96R2tI2XxMgMfyDXGJwFilBNs+fpttJlt2995A8 0JwPj8SFdm6FBcxygmxBBCc7i/BVQuY8aC0Z/w9Vzt3Eo561r6pSHr5JGHe8hwBQUcNPd/9l 2ynP57YTSE9XaGJK8gIuTXWo7pzIkTXfN40Wh5jeCCspj4jNsWiYhljjIbrEj300g8RUT2U0 FcEoiV7AjJWWQ5pi8lZJX6nmB0lc69Jw03V6mblgeZ/1oTZmOepkagwy2zLDXxihf0GowUif GphBDeP8elWBNK+ajl5rmpAMNRoKxpN/xR4NzBg62AjyIvigdywa1RehSTfccQARAQABwsBf BBgBAgAJBQJNWQbPAhsMAAoJEBaat7Gkz/iuteIH+wZuRDqK0ysAh+czshtG6JJlLW6eXJJR Vi7dIPpgFic2LcbkSlvB8E25Pcfz/+tW+04Urg4PxxFiTFdFCZO+prfd4Mge7/OvUcwoSub7 ZIPo8726ZF5/xXzajahoIu9/hZ4iywWPAHRvprXaim5E/vKjcTeBMJIqZtS4u/UK3EpAX59R XVxVpM8zJPbk535ELUr6I5HQXnihQm8l6rt9TNuf8p2WEDxc8bPAZHLjNyw9a/CdeB97m2Tr zR8QplXA5kogS4kLe/7/JmlDMO8Zgm9vKLHSUeesLOrjdZ59EcjldNNBszRZQgEhwaarfz46 BSwxi7g3Mu7u5kUByanqHyA= Organization: Baylibre Cc: Linux Kernel Mailing List , dri-devel , linux-amlogic@lists.infradead.org, nd , Linux ARM Message-ID: <27d09559-055a-7bf3-0f23-9948da0e1f76@baylibre.com> Date: Fri, 6 Mar 2020 15:40:01 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <20200306101328.GR2363188@phenom.ffwll.local> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Pekka, Brian, Daniel, On 06/03/2020 11:13, 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: >> >>> On Tue, 3 Mar 2020 12:37:16 +0100 >>> Daniel Vetter wrote: >>> >>>> On Tue, Mar 3, 2020 at 11:53 AM Brian Starkey wrote: >>>>> >>>>> Hi, >>>>> >>>>> On Tue, Mar 03, 2020 at 12:10:29PM +0200, Pekka Paalanen wrote: >>>>>> On Fri, 21 Feb 2020 10:08:42 +0100 >>>>>> Neil Armstrong wrote: >>>>>> >> ... >>>>>>> +/* >>>>>>> + * Amlogic Video Framebuffer Compression modifiers >>>>>>> + * >>>>>>> + * Amlogic uses a proprietary lossless image compression protocol and format >>>>>>> + * for their hardware video codec accelerators, either video decoders or >>>>>>> + * video input encoders. >>>>>>> + * >>>>>>> + * It considerably reduces memory bandwidth while writing and reading >>>>>>> + * frames in memory. >>>>>>> + * Implementation details may be platform and SoC specific, and shared >>>>>>> + * between the producer and the decoder on the same platform. >>>>>> >>>>>> Hi, >>>>>> >>>>>> after a lengthy IRC discussion on #dri-devel, this "may be platform and >>>>>> SoC specific" is a problem. This one is definitely only for the SCATTER modifier, not the DEFAULT and MEM_SAVING. >>>>>> >>>>>> It can be an issue in two ways: >>>>>> >>>>>> - If something in the data acts like a sub-modifier, then advertising >>>>>> support for one modifier does not really tell if the data layout is >>>>>> supported or not. It's clearly not. The DEFAULT and MEM_SAVING modifiers are clearly transferable, and their layout is extremely simple. While we don't have the memory compression algorithm, the memory layout is simple to describe and doesn't act as a sub-modifier. The complexity lies in the SCATTER modifier, which describe an instant live memory layout, that is not transferable and with an unknown and variable layout. >>>>>> >>>>>> - If you need to know the platform and/or SoC to be able to interpret >>>>>> the data, it means the modifier is ill-defined and cannot be used in >>>>>> inter-machine communication (e.g. Pipewire). It's not the case for the DEFAULT and MEM_SAVING modifiers. The SCATTER modifier is mandatory for the Amlogic G12A and G12B HW video decoder, but the same HW is capable of displaying the non-SCATTER buffer for example. >>>>>> >>>>> >>>>> 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 cross-driver >>>>> * sharing. It exists since on a given platform it does uniquely identify the >>>>> * layout in a simple way for i915-specific userspace. >>>> >>>> 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). >>>> >>>> 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 >>>> >>>>> Isn't the statement that this for sharing between producer and decoder >>>>> _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, and >>>>> those devices support all the same "flavours", I don't see what is >>>>> gained by making userspace care about internals. >>>> >>>> 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. This is not the case here, maybe I should explicit the "DEFAULT" modifier with a bit like "BASIC" to explicitly define support for the currently defined DEFAULT mode. >>>> >>>> Also eventually, maybe, perhaps ARM does grow up into the >>>> client/server space with add-on pcie graphics, and at least for client >>>> you very often end up with integrated + add-in pcie gpu. At that point >>>> you really can't have magic per-soc modifiers anymore. >>> >>> Hi, >>> >>> 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] Transferring AFBC buffers doesn't sound like a good idea to me.... >>> >>> If that is something that must not be done with DRM modifiers, then >>> please contact them and document that. >> >> Sorry, it's waypipe, not pipewire: >> https://gitlab.freedesktop.org/mstoeckl/waypipe/ > > 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). The AFBC, and Amlogic FBC are not size optimized compressions, but really layout and memory access optimized compressions, without a proper network size compression, transferring plain NV12 would be the same. > > 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. I'd like too. > > 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. Only the "SCATTER" is not transferable, the other options are definitely transferable, and across 6 families and at least between a minimum of 15 different upstream supported SoCs. Should it be in the modifier description ? should I add a reserved bit in the Amlogic modifier space describing it's non-transferable nature ? > -Daniel > Neil