Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1662389ybv; Fri, 21 Feb 2020 01:13:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxx3wWdlRsKO0Dupi/4gNw7XEVipYIWvzMmHcGV6fF90J+MOKXLbrzgiia5kN+7a1KMcr17 X-Received: by 2002:aca:62c4:: with SMTP id w187mr1178975oib.38.1582276434967; Fri, 21 Feb 2020 01:13:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582276434; cv=none; d=google.com; s=arc-20160816; b=PMpcZU3Mai725KIfrarkWfwqvBF5Ha1DwtE2dYoZHB9iqSF9H4sK8nM1vBMCpla92E YkFtjwebAypCAgXkwyJt1swE1j0e1t/j6kzS/fb6eU7oBSzsviJZK6phAmNuaFIXq5zT boHQoAjrkmfNmjaom6oB0Y1s5qrU3dKz0p0jHJkeiuub5HF4WrEVCh9G5kZmqG62rNUb U5N0LsL1OpzlxAk6dwhHTK5JTjzDQpmb5661DZEQbRmNKIZowxruEiLMBJ6x95WDir2u +ByYkt0SJ7mzCehPgSUo28GK+lRVPOqPB5m3yvcMFvcO/c76uJnmMJT+ZA9tvyxCGD/f 5ctg== 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=3kb32uRYkhezIHBTmj+5SdLW5ETiBbDtA9WwDv9jFqg=; b=R4oJLsN85cGd/J2ha6yJpZBa9GVnZWL2cCGa5IN5gv3BEUPY0wD6bNGJWYZLM+wmIZ qQpf47arPzmR34EcIbulXgX358FKmz7fjCDa25xfNY5SswDgX4McudHrdsTcG0ZFnFIP baCASQeniVGuWkXNXhWV09m0Svr2E4sC/XXy9p17BsSbuBvi2mXjzhP2xcd8ndIo5aWK HU4sjq3NR81dNPC8ZAzkUi2TzgfzFzOR907tc6c6ncs44BG/quDT54D55Hzt933j+B4E GZzFvmU8TPgi0m2ZW9SQTp9HcvGpqBoekgTjkEe34k+d/7z43hIhwt4+r3bPDLcmxjiv XJ0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@baylibre-com.20150623.gappssmtp.com header.s=20150623 header.b=MHq30fHL; 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 d19si1148900ote.3.2020.02.21.01.13.43; Fri, 21 Feb 2020 01:13:54 -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=MHq30fHL; 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 S1727954AbgBUJIw (ORCPT + 99 others); Fri, 21 Feb 2020 04:08:52 -0500 Received: from mail-wm1-f65.google.com ([209.85.128.65]:35536 "EHLO mail-wm1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727426AbgBUJIv (ORCPT ); Fri, 21 Feb 2020 04:08:51 -0500 Received: by mail-wm1-f65.google.com with SMTP id b17so855626wmb.0 for ; Fri, 21 Feb 2020 01:08:49 -0800 (PST) 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=3kb32uRYkhezIHBTmj+5SdLW5ETiBbDtA9WwDv9jFqg=; b=MHq30fHLCK1yAJBfIiqeZy2r0lRKlMQNNi0H+yiAO1uObLJy/V8lgFd0bW7GRlbdZA pVm+zKouDVsFeYirga2GLz6wxiIIIXU73yRTJnQWpy3+2jzqpfvbRD0GzW1r6Kfwahhq 9em/BTeVTo9+SWaF0nC8xs4UoEhcx2w7NhKWVJpP77auP3klD1qQPWIwj1tSXmIRUmPp rRm7bqD8lP+V5f8+tZn6Iy7XDqtZJXzu3n1VCNq0Nyq+cSXoXbaCPtApVhwnN2UFx/8a 8Pk7xV8Me2jOJ+nIvyIBR0AVtt5DEm/ZQQhklA60Qwjfv4CEyIeXbYS/rSRF5eBX9XZP 0wQw== 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=3kb32uRYkhezIHBTmj+5SdLW5ETiBbDtA9WwDv9jFqg=; b=grFQGNY8Xm9cIwkkVRGoGxnfSiWHbC6axlv/quRWzdl7H4fNxVSpI9Mys8H8UAjZUW fnqEh3CETfHSu0fXdy1k+Q5VAeCZdjdinELKdppU9tLNMncXwEJ2uZj2VIK2cBKLzSVn H6e2q8NaCJTJIPE/gt2Qoh0vJHYEXdNa28V6ytW3wQaN0jC5SUJr9ZN5Dvyx3M9CRA08 TiPFTGm/x3kyeMGcDJO6/Z2ItHG33AZQ71SbBBgdL1cbt+paQ2us/TpG5JNtxdUFcb8W zave8CXL3IaNL1/nBLD9freKina6EHlAoAB4IzwKo9DbR7245/ZgWwXo+ic6XjG+kyVW JEBQ== X-Gm-Message-State: APjAAAX8mUZtLgdedJf5OIvsypOOLnvbI83sAU8eeDpZY60z0s1ANXyE pWYrhZlfL1DDXusoqY1odmm0Dg== X-Received: by 2002:a05:600c:414e:: with SMTP id h14mr2419247wmm.179.1582276128899; Fri, 21 Feb 2020 01:08:48 -0800 (PST) Received: from bender.baylibre.local ([2a01:e35:2ec0:82b0:4ca8:b25b:98e4:858]) by smtp.gmail.com with ESMTPSA id h5sm3173288wmf.8.2020.02.21.01.08.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Feb 2020 01:08:48 -0800 (PST) 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 0/4] drm/meson: add support for Amlogic Video FBC Date: Fri, 21 Feb 2020 10:08:41 +0100 Message-Id: <20200221090845.7397-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 options are supported : - Scatter mode: 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 - 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 v1 at [1]: - s/VD1_AXI_SEL_AFB/VD1_AXI_SEL_AFBC/ into meson_registers.h [1] https://patchwork.freedesktop.org/series/73722/#rev1 Neil Armstrong (4): 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 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 | 56 ++++++ 5 files changed, 431 insertions(+), 38 deletions(-) -- 2.22.0