Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1266667ybt; Thu, 2 Jul 2020 00:48:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxkqm9kr+UKrkOoHF/VCo0fNzjJgiZtp32guB2foubbN2/deTQnTaJyqtLGSfF+zFr8zr6m X-Received: by 2002:a17:906:8392:: with SMTP id p18mr27999366ejx.24.1593676118072; Thu, 02 Jul 2020 00:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593676118; cv=none; d=google.com; s=arc-20160816; b=TaZROw/h1GVrUbTwll1JPuugXWfgKl3pfoSIyPzgyllhUP1DK2ZORPFDncCkhsA2Ci pelFqNvQfjooa83fluKrixKRaxQ+AnnGvl7KG65KqvMwlwWioAivvNQ6EDfQRyKylhTk J0LnMavLmHDGasMd4hSpW1eqNIm8zj8+Lx9azlrM00nCRflCJ3ru0ooKfbbwvnlOAzZd 2dwaU4rvJeKbSGEUHveLk7ovaUm8VGoxBTftH0zzQPU8lTE8qoRpl6/rDSEPJKcnL7nW V9a+06MZkF6wXBhQn/W7QLlg9RKf7MmgSXnwuKASXakit5YjUvsYmkh94eHY8sFNAhsV VSHA== 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=8M+mFGruIPk3CS9J1xbXhvwkPs322aITgShX5ewQVTQ=; b=FqjdH8NFy3HNF6rWeJpl8zXfGaO7rL/5iqI4c81Undz3h7EAVTv4Lp1KNIjjJ7J4+U Rxv2enzIxsiZFfUJy+UqnXILmjvmWyIJPB1U1KufGvRBJY6gvDV4ppAYFnrxzWOOF6aX EBSzzJ6Z18IYkqlGvSX3/jh6i9WARiO9aliCcMYGoW2+RSpQGaelSzqQBx5gG/2MiOSo gYVnarnyA3uHKNFvZOo+Ij4b+4ThFsgzTxmLxRrgr/aRABJqvoEykBXZEySCBko9+eDB yfPZymUlCxna2SDA6IVlxYKATtIYGmlP09j9ujj+lQdrE5NKS4zQ0C0+LwjVudriKJOC Eksw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=cJyoYcdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a19si1319514eje.150.2020.07.02.00.48.14; Thu, 02 Jul 2020 00:48:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=cJyoYcdt; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbgGBHsE (ORCPT + 99 others); Thu, 2 Jul 2020 03:48:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726089AbgGBHsE (ORCPT ); Thu, 2 Jul 2020 03:48:04 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C119AC08C5C1 for ; Thu, 2 Jul 2020 00:48:03 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id o11so26958623wrv.9 for ; Thu, 02 Jul 2020 00:48:03 -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=8M+mFGruIPk3CS9J1xbXhvwkPs322aITgShX5ewQVTQ=; b=cJyoYcdt4qoPTsDOKgbH8BDy1hkTA/lU8+OoimqiKhJuvup+eJ5pShA3oQLtmM790u k0taMEOv17PPxFh1QUb4TjyW+sV4RFR7CWqsJ5SSxPRYUUWWm3zrKaZU1Ic5fOQKPk2T 9aTDQZIig2oovyHfnrrwP68+s/Qn8FkNG+anTz5kbO1hMCjgd1DACAGD+nXuyCnTjqEr IERyt7j3A7oZFIuXaHb5Vj/CkYlr8HxzA3LO/T6j4PQfjHsIlX+GHjHjlbduIxiw+Xap 0lKy2nYdiq7knHZhIe6P9MLhGi6NeDcLfGrItHHRUv10LYyFcOcDK0MRol834AURfg15 DWUQ== 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=8M+mFGruIPk3CS9J1xbXhvwkPs322aITgShX5ewQVTQ=; b=p0cd0+NM9rBTE8nDz8X9OLhRGjn+qJJ8HXZ69MaBvNdrjNXv7PGCOF6J9dApCgtRGD B6mrGDCPUQ7CfRTRmUGHziGV892N2bUDculikj74jJuG1LEMwNYHw13xjSUg8WWGtMOB sDabfLkoNvm9aJ+cpMbv29XlgE/jMvLr6oM8dsGVVHM6FxUYQKHhlCk8cLTEoiENKgk5 QaRR6daQA9XXD/JA90s+QQE54dXfUARgxfrTOWRGvCAtJked0W47jyBfGRP77jkNET1F N584PNKsbNBvJEfLEYJx957Pn6HCvHh25eJAo0BUtwYaSe6ciLesTKTKmF6byDsqEIBX pvxw== X-Gm-Message-State: AOAM531e5qUDfFUCP+oNttJ9bWiRB+zjMnKq0w0wlc+cra9dwMyhfwsm J7a6pPEaJ1AfDHLXaKCxAdC06w== X-Received: by 2002:a5d:65cd:: with SMTP id e13mr33073968wrw.213.1593676082299; Thu, 02 Jul 2020 00:48:02 -0700 (PDT) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:7023:727a:c688:cf9b]) by smtp.gmail.com with ESMTPSA id z1sm10001882wru.30.2020.07.02.00.48.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 Jul 2020 00:48:01 -0700 (PDT) From: Neil Armstrong To: daniel@ffwll.ch, dri-devel@lists.freedesktop.org Cc: jianxin.pan@amlogic.com, Neil Armstrong , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v8 0/6] drm/meson: add support for Amlogic Video FBC Date: Thu, 2 Jul 2020 09:47:53 +0200 Message-Id: <20200702074759.32356-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 v7 at [7]: - rebased on drm-misc-next - removed spurious DEBUG in drivers/gpu/drm/meson/meson_overlay.c Changes since v6 at [6]: - rebased on drm-misc-next (after drm-misc-next-2020-05-14) - updated patch 1 commit log for completion Changes since v5 at [5]: - merged all fourcc patches in 1 - fixed fourcc definition to have only a single DRM_MOD_ - fixed 2 checkpatch issues Changes since v4 at [4]: - added layout and options mask - cosmetic changes in fourcc.h - fixed mod check using the masks - fixed plane apply using the masks Changes since v3 at [3]: - added dropped fourcc patch for scatter - fixed build of last patch 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 [3] https://patchwork.freedesktop.org/series/73722/#rev3 [4] https://patchwork.freedesktop.org/series/73722/#rev4 [5] https://patchwork.freedesktop.org/series/73722/#rev5 [6] https://patchwork.freedesktop.org/series/73722/#rev6 [7] https://patchwork.freedesktop.org/series/73722/#rev7 Neil Armstrong (6): 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: overlay: setup overlay for Amlogic FBC Memory Saving mode drm/meson: overlay: setup overlay for Amlogic FBC Scatter Memory layout drm/meson: crtc: handle commit of Amlogic FBC frames drivers/gpu/drm/meson/meson_crtc.c | 118 +++++++--- drivers/gpu/drm/meson/meson_drv.h | 16 ++ drivers/gpu/drm/meson/meson_overlay.c | 289 +++++++++++++++++++++++- drivers/gpu/drm/meson/meson_registers.h | 22 ++ include/uapi/drm/drm_fourcc.h | 74 ++++++ 5 files changed, 481 insertions(+), 38 deletions(-) -- 2.22.0