Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp4898999ybb; Tue, 24 Mar 2020 07:21:51 -0700 (PDT) X-Google-Smtp-Source: ADFU+vv0pMTR+t5xRMzlpUFx3+SKrC7J9BhDfZr9IdW06qugl85YSiA2r6cy9NlVPhlmeKl3ehh0 X-Received: by 2002:aca:4cd8:: with SMTP id z207mr3400201oia.155.1585059710858; Tue, 24 Mar 2020 07:21:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1585059710; cv=none; d=google.com; s=arc-20160816; b=djotBTq/RnIQ3w42+SrjlooraVfnoyX2BpWfXeYkMkujGwMZjDv2nKGJP6/BOa7CF3 djH77qFj3Vtln/GGf9WaeQvmBsEsNE8jUJSL8Ip4yfAZ0ARkQB6g1zRo+0p1HbivMqyo heFMjNTHhsCp+Xa2yjyMbv8EXpfYlhb2SHsNBfrO6R1f4Mijt05KWepE1uSLxD8+7X96 CjDxerNolo9b/bFQ4Bq28rxkG2uV3tUuHmeEtLxa6xhSNo6eG7t5xOj+6lXtCZHN6yZu 9zyI6twwFAXclzRlo8w/fra5XF8Z9l5MP8hxc9T6S1oW0UP36BprGe7Na9XpHIjGCYUK gN2g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=Pb0nOXTsvfnsHlBe6h+96Sc/Y2vhw/oF3Rb7LgSL9sA=; b=dPf3jgG3onsZ64HeSp74FGCVar6uWTJeS4hEibNyLaSZ15p32t+X1xvfOQr7omLzTv 2m2888kcQYeGnpcKzChdFlakb2kRWDrFk7Vj+upE65uyJVG1eyHgQWKeAsxP+8MVSdr4 0zXJZYhsHtK6JCkGCl9CCc06/QUl+LQV/1cBj5H8BiyU1Jq6UrRQIWPjb2vG3pptSCFD 23MpyefqBf+45nTiaHduM5QMHX4OIAFKgaJ7OSSZXVlmiEKtTF3oSq54Wxv6IR0ANAuB TByxYfAgKJ5/eacCz2LfAJD22xEeEatd2Gqa+l57c48CiMxfjerbIhjBiTWonIweVXrr WoeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=rsqJnKuH; 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 p3si10534774otk.212.2020.03.24.07.21.37; Tue, 24 Mar 2020 07:21:50 -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=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=rsqJnKuH; 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 S1727609AbgCXOUZ (ORCPT + 99 others); Tue, 24 Mar 2020 10:20:25 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:38461 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727273AbgCXOUZ (ORCPT ); Tue, 24 Mar 2020 10:20:25 -0400 Received: by mail-wr1-f67.google.com with SMTP id s1so21664335wrv.5 for ; Tue, 24 Mar 2020 07:20:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pb0nOXTsvfnsHlBe6h+96Sc/Y2vhw/oF3Rb7LgSL9sA=; b=rsqJnKuHuJQAYKkoP4MLaf+A11zN64qwqgkLFd3IWiVck21lSHX1ysKm/r30C/khku OVyPTf6lqP9Qpei8+lcLVc5pah1ULccIygs7LUSwT1020WvjwlGCYQYBU+BtX0whmHed ujnq4xAzQk4jzQCvis3sCQtC7fadrvw4lUtVS2YjRcPjDwnrLOOAYAxGXVJatcl2n98V CML/eF/8FdwfbJSZFfG6OPXKHNqgAhdGz3gRS3+wLmbXFKl7tnD4+C22jcgOk7YHFnSD DqpB+nqm/M+YwkBzyeq8Slsg2EsuiwS96qjd7ey4QJDLDPmstzzjkrnNLx8NkstHD2S/ YdGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=Pb0nOXTsvfnsHlBe6h+96Sc/Y2vhw/oF3Rb7LgSL9sA=; b=h3zoO+My5sX8lvqMlQm+j2A2ax9JenCsD1XgXOl2XY52nNVJIAYXecXnBdL54soUCN EV/TsI3pIRWUfBB3zVCF9SJcXTjowH/PNz3OMKneMnE9cBgEK+ZobUCYlODQ2i53j5rV aht2onq+LDQSkO6p2kZNxVU5dRz5iQmLGWuLMLCKtjQs1Fog0a9ae1LTVOyLDP0ejgao E5iYuWoocWpRtI7qckFsA2G7AmUxAM5UL7NEqs5akqUmiJqf9se1PGeyPpnsvzzmZ9OS 6x31lEZWyBabIGQutmqF4B2r623kgREKQfVe59Bn8S5s87RpenVdUPIPoW/EzI0ipVRS xxFA== X-Gm-Message-State: ANhLgQ1BWsvutYC0/r0zxTKGDJUxOHRAoTmXJL1IcdqLo2E9mdDZ48BJ bHNBKo2+FqPrNdnjV1SUCjdFLg== X-Received: by 2002:adf:fe4c:: with SMTP id m12mr37764304wrs.96.1585059623310; Tue, 24 Mar 2020 07:20:23 -0700 (PDT) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:5c5f:613e:f775:b6a2]) by smtp.gmail.com with ESMTPSA id o4sm28688472wrp.84.2020.03.24.07.20.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Mar 2020 07:20:22 -0700 (PDT) From: Neil Armstrong To: daniel@ffwll.ch, dri-devel@lists.freedesktop.org Cc: ppaalanen@gmail.com, mjourdan@baylibre.com, brian.starkey@arm.com, Neil Armstrong , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v3 0/7] drm/meson: add support for Amlogic Video FBC Date: Tue, 24 Mar 2020 15:20:09 +0100 Message-Id: <20200324142016.31824-1-narmstrong@baylibre.com> X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. The underlying storage is considered to be 3 components, 8bit or 10-bit per component, YCbCr 420, single plane : - DRM_FORMAT_YUV420_8BIT - DRM_FORMAT_YUV420_10BIT This modifier will be notably added to DMA-BUF frames imported from the V4L2 Amlogic VDEC decoder. At least two layout are supported : - Basic: composed of a body and a header - Scatter: the buffer is filled with a IOMMU scatter table referring to the encoder current memory layout. This mode if more efficient in terms of memory allocation but frames are not dumpable and only valid during until the buffer is freed and back in control of the encoder At least two options are supported : - Memory saving: when the pixel bpp is 8b, the size of the superblock can be reduced, thus saving memory. This serie adds the missing register, updated the FBC decoder registers content to be committed by the crtc code. The Amlogic FBC has been tested with compressed content from the Amlogic HW VP9 decoder on S905X (GXL), S905D2 (G12A) and S905X3 (SM1) in 8bit (Scatter+Mem Saving on G12A/SM1, Mem Saving on GXL) and 10bit (Scatter on G12A/SM1, default on GXL). It's expected to work as-is on GXM and G12B SoCs. Changes since v2 at [2]: - Added "BASIC" layout and moved the SCATTER mode as layout, making BASIC and SCATTER layout exclusives - Moved the Memory Saving at bit 8 for options fields - Split fourcc and overlay patch to introduce basic, mem saving and then scatter in separate patches - Added comment about "transferability" of the buffers Changes since v1 at [1]: - s/VD1_AXI_SEL_AFB/VD1_AXI_SEL_AFBC/ into meson_registers.h [1] https://patchwork.freedesktop.org/series/73722/#rev1 [2] https://patchwork.freedesktop.org/series/73722/#rev2 Neil Armstrong (7): drm/fourcc: Add modifier definitions for describing Amlogic Video Framebuffer Compression drm/meson: add Amlogic Video FBC registers drm/meson: overlay: setup overlay for Amlogic FBC drm/meson: crtc: handle commit of Amlogic FBC frames drm/fourcc: amlogic: Add modifier definitions for Memory Saving option drm/meson: overlay: setup overlay for Amlogic FBC Memory Saving mode drm/meson: overlay: setup overlay for Amlogic FBC Scatter Memory layout drivers/gpu/drm/meson/meson_crtc.c | 118 ++++++++--- drivers/gpu/drm/meson/meson_drv.h | 16 ++ drivers/gpu/drm/meson/meson_overlay.c | 257 +++++++++++++++++++++++- drivers/gpu/drm/meson/meson_registers.h | 22 ++ include/uapi/drm/drm_fourcc.h | 66 ++++++ 5 files changed, 441 insertions(+), 38 deletions(-) -- 2.22.0