From patchwork Tue Jan 9 10:56:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 123877 Delivered-To: patch@linaro.org Received: by 10.80.140.226 with SMTP id r31csp305865edr; Tue, 9 Jan 2018 02:57:27 -0800 (PST) X-Google-Smtp-Source: ACJfBovPTdk4xkMI/gQHUkLlvCo5Eh/0luDV9lPR+XUganjVG73HmHVQgZM692vWfDI7rxwJreUc X-Received: by 10.84.168.35 with SMTP id e32mr15281873plb.355.1515495447302; Tue, 09 Jan 2018 02:57:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1515495447; cv=none; d=google.com; s=arc-20160816; b=SZciFKHsUWld+8hgyXt6yY+unQkozoIG50Xp1iCm7DbfLgkR98ceZ6kdbm00F14Amn AL0oqcF9jWpJ6OWokIjIbhkPc2W0PZQvyIr5j0libSSx3SFDujJ99meuNp7iHeDqUahr S5bOqLXSj200qHu1YLl0cLRQDIC/kjsAE+IPvdBxlaXljpX3Y67unjPk7RvLOK6JuwpH O0zpyBHmS8MaLoikalM5e/aiVuwcGUSAaIR3Zvk9bR7+jy+villPPKsIRXhKQU5/pulZ G9PlK0a1knlc9ZLIE9H8ZExc0dxJGMewTlYkkznd5eMtWEZZxlMeGHVCmrvQGnN5w4Yl FiLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:cc:message-id:date:subject:to:from:delivered-to :arc-authentication-results; bh=FD0vIrPOVtjYEBXpAFLqRul3fwYte4rA9cNH8QMV6QI=; b=xjguGtJiffcep8iQHQdPBfD060Bv3HCeO/lbdnlOYSy1CJlxhfPtfTDWhuIXaJpZM8 Cm5VP1aSnu2rGvxhi8FdmdIhjT/Dmdofa5ur9Y5ajDnj7ZgfLULRFnFLAoWeG3COhSZr tGs04F1rhVQQZyccgsF+I280EOuFhoYeyHc7A/zzSJQsr3NjgKcLZneEZMmQMDrdXEnO 9+spi3TRGQk8o9kkJmNs2t2EbgJKtPvqXHfM0V55LPtrpck/V074FkdGkwZkSHl2nY+H l5mrlFW1xRKGcPyalFGyY27cyibzCQGdiw5jMtblomxzRgM55obhMnUKzCfBr0lpTeAh IFKA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [131.252.210.177]) by mx.google.com with ESMTPS id a74si9888788pfe.391.2018.01.09.02.57.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 Jan 2018 02:57:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) client-ip=131.252.210.177; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 131.252.210.177 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6C9BA89F03; Tue, 9 Jan 2018 10:56:54 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by gabe.freedesktop.org (Postfix) with ESMTP id C9BFA89D60 for ; Tue, 9 Jan 2018 10:56:52 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 1A880209A0; Tue, 9 Jan 2018 11:56:51 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.free-electrons.com (Postfix) with ESMTPSA id E236F2037A; Tue, 9 Jan 2018 11:56:40 +0100 (CET) From: Maxime Ripard To: Chen-Yu Tsai , Maxime Ripard , Daniel Vetter , Jani Nikula , Sean Paul Subject: [PATCH 00/19] drm/sun4i: Support more planes, zpos and plane-wide alpha Date: Tue, 9 Jan 2018 11:56:19 +0100 Message-Id: X-Mailer: git-send-email 2.14.3 Cc: linux-arm-kernel@lists.infradead.org, Thomas Petazzoni , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, thomas@vitsch.nl X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Hi, This serie aims at enhancing the support for our planes in the current drm driver on the first generation of Allwinner's display engine. This also introduces a few generic stuff, as well as some conversion for some other drivers. This series basically implements three things that look orthogonal, but due to the way the hardware works are kind of related. The main feature is that instead of implementing 2 planes per backend, we are now able to use the planes that are available in hardware. This was unsupported before because of the way the composition works in the hardware. Indeed, the planes are first grouped into 2 pipes that are doing a basic composition, in case of overlapping planes, it just takes whatever plane has the highest priority (=> zpos). Then, the alpha blending is done between the two pipes. This was simplified so far by only using two planes, one for each pipe, which was allowing us to have an illusion of proper alpha blending. This is further complicated by the bug/feature that the lowest plane must not have any alpha at all, otherwise the pixel will turn black, no matter what the value of alpha is. This basically means that we can have a plane with alpha only in the second pipe. However, as we have more and more blocks being worked on, 2 planes are getting really limited and we need to support all 4 of them. This is mostly possible by extending our atomic_check and to make sure that we enforce those constraints, and assign the pipes automatically. This is done by looking at the number of planes using an alpha component, and we then end up in various scenarios: - 0 plane with alpha => we don't care for the pipes at all. All the planes are assigned to the first pipe - 1 plane with alpha => we assign all the planes without alpha below the plane with alpha to the first pipe, and then all the remaining planes to the second pipe. The plane with alpha will be the lowest plane on that pipe, which means that whatever plane is above it will have precedence, but the alpha component will remain and will be used on pixels that are not overlapping - 2-4 planes with alpha => we can't operate that way, we just reject the configuration. In addition to the formats that embed an alpha component, we also add support for plane-wide alpha property, and in order to tweak the configuration the way we want to, we also add support for configurable zpos. Let me know what you think, Maxime Maxime Ripard (19): drm/fourcc: Add a function to tell if the format embeds alpha drm/atmel-hlcdc: Use the alpha format helper drm/exynos: Use the alpha format helper drm/rockchip: Use the alpha format helper drm/vc4: Use the alpha format helper drm/blend: Add a generic alpha property drm/atmel-hclcdc: Convert to the new generic alpha property drm/rcar-du: Convert to the new generic alpha property drm/sun4i: backend: Fix structure indentation drm/sun4i: backend: Fix define typo drm/sun4i: framebuffer: Add a custom atomic_check drm/sun4i: backend: Move the coord function in the shared part drm/sun4i: backend: Set a default zpos in our reset hook drm/sun4i: backend: Add support for zpos drm/sun4i: backend: Check for the number of alpha planes drm/sun4i: backend: Assign the pipes automatically drm/sun4i: backend: Make zpos configurable drm/sun4i: Add support for plane alpha drm/sun4i: backend: Remove ARGB spoofing Documentation/gpu/kms-properties.csv | 2 +- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_dc.h | 13 +-- drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 109 ++------------- drivers/gpu/drm/drm_atomic.c | 4 +- drivers/gpu/drm/drm_atomic_helper.c | 1 +- drivers/gpu/drm/drm_blend.c | 32 ++++- drivers/gpu/drm/drm_fourcc.c | 43 ++++++- drivers/gpu/drm/exynos/exynos_mixer.c | 14 +-- drivers/gpu/drm/rcar-du/rcar_du_drv.h | 1 +- drivers/gpu/drm/rcar-du/rcar_du_kms.c | 5 +- drivers/gpu/drm/rcar-du/rcar_du_plane.c | 15 +-- drivers/gpu/drm/rcar-du/rcar_du_plane.h | 2 +- drivers/gpu/drm/rcar-du/rcar_du_vsp.c | 42 +------ drivers/gpu/drm/rcar-du/rcar_du_vsp.h | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 13 +-- drivers/gpu/drm/sun4i/sun4i_backend.c | 126 +++++++++++++++-- drivers/gpu/drm/sun4i/sun4i_backend.h | 11 +- drivers/gpu/drm/sun4i/sun4i_framebuffer.c | 18 +- drivers/gpu/drm/sun4i/sun4i_layer.c | 84 ++--------- drivers/gpu/drm/sun4i/sun4i_layer.h | 1 +- drivers/gpu/drm/vc4/vc4_plane.c | 19 +-- include/drm/drm_blend.h | 1 +- include/drm/drm_fourcc.h | 1 +- include/drm/drm_plane.h | 6 +- 24 files changed, 289 insertions(+), 276 deletions(-) base-commit: 53b519deaf2e507b121b64abcb4ba0da075bd6a7 Reviewed-by: Laurent Pinchart