Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp302713ybz; Tue, 21 Apr 2020 09:17:57 -0700 (PDT) X-Google-Smtp-Source: APiQypLfsijv6xHzji14V5N4UqEfNGW2wCuobJ4IKZJSBcYTfuERHQVb29MjqjY9kbzIEKeAqaKB X-Received: by 2002:aa7:d64e:: with SMTP id v14mr19435370edr.19.1587485877759; Tue, 21 Apr 2020 09:17:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587485877; cv=none; d=google.com; s=arc-20160816; b=nGXdDWqqbGgvf+WXsDQAGNPeiNfz6nVksD0cXQqZuWOwdNfOjyL3CaimXIydceRAMb t5J5tXVmxo1U45rEKzHXWdstbXy4FZi2kgJuP0LAEb/9lvqu545Ad9Ga4KUcod1xWN2y O9MFY7T+5Vv6Fjo9w9Dpoi0YaHC/3/73HtTaJl/FLxbTUIl3XKtyFklPKN30R4/KZVP9 I1YjtXDcnG5WQjrST9a+bnYMd8opD7w4y92PZt53zfP6gcfjP8BKCZT85BdqUDbavdtr TuPY80KYV3jc4qg1B73LERQ0M6Tce4LkP5qOtWWzCO0MsQVGQIXOFWfafsWXMR84S6nD WzUQ== 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=oBXmUVijjl77qmlPJjceabUZhKXPDQu30ucjlCWJLm8=; b=klguhsFougyUrHqqj/nAJ2FC7zhgjvxX33vHtdHZcdq8R9umiUR2BATrVhSx6PPLCN WDJygTeHQQaMQnBHM2bJq8dtnwuBmanV1+Gnjnhl7Y7A+1HjM8Peq412kT8O969ShtiC k6Kss/jD0jqGgD1vC2g0lbsOCwEk0dca/U8Kjm/rAz2YZUVhEBwhoQuTl0EVQitCDVn/ m2EB3RHp4JxIPgEwrOen4+JLCqa5EvtetmRC4Of3f/L+Pt5tiwW3hfobcejv1sTmtJgT cQTZMwugD4thBI8dMcf0+jGxWn6943sovjqbObTHKkRYwlJ3086rlhQ0Er8iBPN+Kz+W Id9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=zTcqxvYV; 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 cx19si1849636edb.230.2020.04.21.09.17.34; Tue, 21 Apr 2020 09:17:57 -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=zTcqxvYV; 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 S1729168AbgDUQQH (ORCPT + 99 others); Tue, 21 Apr 2020 12:16:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726157AbgDUQQG (ORCPT ); Tue, 21 Apr 2020 12:16:06 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DBEBEC061A10 for ; Tue, 21 Apr 2020 09:16:05 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id e26so4192561wmk.5 for ; Tue, 21 Apr 2020 09:16:05 -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=oBXmUVijjl77qmlPJjceabUZhKXPDQu30ucjlCWJLm8=; b=zTcqxvYVH3V2nN32H6116A8cns9nt9Jpmu7xJFjkr0jvy37yVdA303M5a34KILWxLo Q8GI/lqn62BIwjr+5j0scfwmXHyc0OuPCGX21RH2ie71+C0W+LZ6Ogl0nNuwTE29Rq7u jlJJdCV1o8VjezXu7qMgqtzuC+2hqz6ObWTB1/MlnxfptH2SeO946uXbpzEg+QdchicC zxcESoE2lLWr/hK0JfVmRvMbVifObY85Yc6DOuDvVzZIWjtiVMDwZKNVcuIOwHwfORKD qKSimoTghbyjU0z/6qRjzKJjfiq8F4c6JDloqnUJWaLO8hKnip+dmiRGPjf7z5Dl0mtn CkQg== 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=oBXmUVijjl77qmlPJjceabUZhKXPDQu30ucjlCWJLm8=; b=thcRQlKkAlVm2AAVUnckYwK0S0/1IM1RlKMlma4vR5u4+5CzgSfNa84BwAroxulHtm 0E3fK2KSfqY4hR2UTOqjPJTl1yT8ezNexbWKkDRagJ3BfKkbo4IEdSsKDby8ViLL3dpS kSjAKXi6TCe6FFXDIwJkzz1upstnFXOUjbC68rrG0DAeDMiZl7tWdd26d2cym6aqmSnK LgG58p8sLon2w7+kFbshcbdxo3ZXvuyx3FSJ27d6hZAcpkNdtUn9NV1X0hrRmWxNbkAR nj66bYAq9N1t7VX+zRMP6I9E9He4Rh9M3+f3UHOUbzCGsRp1J0Hnaaoj43tXZ9JZq6YQ Lq8A== X-Gm-Message-State: AGi0Pubd2PbC8dCEkPneh7Kc4k9SrFs2Nvd47az1x80qW4pFDIVozgj2 VU45mTPTBIV3IJ7+Q0R+A8VwcV2ZUoo= X-Received: by 2002:a05:600c:414b:: with SMTP id h11mr5600881wmm.9.1587485764463; Tue, 21 Apr 2020 09:16:04 -0700 (PDT) Received: from localhost.localdomain ([2a01:e35:2ec0:82b0:39cc:a07:8b48:cc56]) by smtp.gmail.com with ESMTPSA id m8sm4410873wrx.54.2020.04.21.09.16.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Apr 2020 09:16:03 -0700 (PDT) From: Neil Armstrong To: daniel@ffwll.ch, dri-devel@lists.freedesktop.org Cc: Neil Armstrong , linux-amlogic@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/6] drm/meson: add support for Amlogic Video FBC Date: Tue, 21 Apr 2020 18:15:53 +0200 Message-Id: <20200421161559.2347-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 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 [4] https://patchwork.freedesktop.org/series/73722/#rev5 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 | 290 +++++++++++++++++++++++- drivers/gpu/drm/meson/meson_registers.h | 22 ++ include/uapi/drm/drm_fourcc.h | 74 ++++++ 5 files changed, 482 insertions(+), 38 deletions(-) -- 2.22.0