From patchwork Wed Jul 17 05:24:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hsiao Chien Sung via B4 Relay X-Patchwork-Id: 13735086 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1B9DC3DA4B for ; Wed, 17 Jul 2024 05:25:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Reply-To:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To: References:Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version: Subject:Date:From:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=GjGroEhVnmIIg0WLjMZ8/OSn7FA1sxV8DFh3mxl+FkU=; b=skm1G2mzQI0VfqDdOCr0bLdp+m mPUK80gSReDCaT8oCchEBVOs5vcGLkk2GvpfrCpgB9OWSlVBuM0hJ3TrXxuEkMgtKZQE6pQgh5dSv iAK0x2ekjLXL5NKffBjLpB7CthkZKJMlT0y/ard6xrHilk+yKzCNkM9Xawv5skCc7f2VWUVxDrTY9 A0TnYpP1NWSEYkOKezXMpp5LGTJwaRrI9eDnmnM6TD6GPnkMcVxCp2PXhlrKjuEFBPVNADVd6kg7l dB39szCo0M3Ho0KzS/5dLZBThS+DexMvqYfK1Fp1nuQcKmkgv104JyILnSt8Xf/E9s7op18tnJtOp jyKWMSeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTxAi-0000000Cha6-2BTq; Wed, 17 Jul 2024 05:25:48 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sTx9l-0000000Ch9M-1qO5; Wed, 17 Jul 2024 05:24:51 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 946A9CE167D; Wed, 17 Jul 2024 05:24:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 2FFE7C4AF09; Wed, 17 Jul 2024 05:24:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1721193886; bh=k+m/j/ZZUAf19tVJ68uEgaeMiuJbGDy2Tlswzrloros=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=Ufq6kxXW0VOHP10v4bw7ec3Vedm/wbB8ObnCM/O12eHEcBqBkoXpz8YwhlcA14gzO aLMOVy5Ra4Y8ecRONg6WVsr+EzRQ8iC8Fjsr6PeP6UDLV491KXzTVMmnn+pwoOiaRR G+YX4ZZMGxZ3YGgw261BldeNotcuR0qGboURcssAt5XqsDtY5qSumiUxaWAMqZrOR3 5yzSnmm8myskoBp4QflzhS7NAvJNx9A6aM6X/oB9hZLmy2/KaI6ZXEiT2bbv+Qveko FdbGCvzmslmSQUDrNxqFkbpDumt02jWI9kLSNTJ9pcDNGu9cLQKUjmMKCNbiQXhNTF K2PEvr1Csfx1g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 185C3C3DA61; Wed, 17 Jul 2024 05:24:46 +0000 (UTC) From: Hsiao Chien Sung via B4 Relay Date: Wed, 17 Jul 2024 13:24:42 +0800 Subject: [PATCH v4 2/5] drm/mediatek: Support "None" blending in Mixer MIME-Version: 1.0 Message-Id: <20240717-alpha-blending-v4-2-4b1c806c0749@mediatek.com> References: <20240717-alpha-blending-v4-0-4b1c806c0749@mediatek.com> In-Reply-To: <20240717-alpha-blending-v4-0-4b1c806c0749@mediatek.com> To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno Cc: dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Hsiao Chien Sung , Hsiao Chien Sung X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1721193884; l=1164; i=shawn.sung@mediatek.com; s=20240710; h=from:subject:message-id; bh=UnuJItDahJeCC5tgEfQnqRNWpQwYQbCGuIsN6s/jhSQ=; b=YwJtfVG+IrzyvVX0K/tSkhi9+eVqQWIX79akZkka6VlXm0pJ1//CgmZinvv49UCjjB+6lm3X2 xxFJnXo0pRyAlKuarorwaY6Og/totKcaGBIBY3qaO4GBOyKYk1FsTYs X-Developer-Key: i=shawn.sung@mediatek.com; a=ed25519; pk=VRlGZ3diQkQtpDd8fCL9/mx+TpZStm08pg8UPaG1NGc= X-Endpoint-Received: by B4 Relay for shawn.sung@mediatek.com/20240710 with auth_id=184 X-Original-From: Hsiao Chien Sung X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240716_222449_709223_7ECA2F46 X-CRM114-Status: GOOD ( 10.67 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: shawn.sung@mediatek.com Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Hsiao Chien Sung Support "None" alpha blending mode on MediaTek's chips. Reviewed-by: AngeloGioacchino Del Regno Signed-off-by: Hsiao Chien Sung Reviewed-by: CK Hu --- drivers/gpu/drm/mediatek/mtk_ethdr.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_ethdr.c b/drivers/gpu/drm/mediatek/mtk_ethdr.c index 9dfd13d32dfa..80ccdad3741b 100644 --- a/drivers/gpu/drm/mediatek/mtk_ethdr.c +++ b/drivers/gpu/drm/mediatek/mtk_ethdr.c @@ -3,6 +3,7 @@ * Copyright (c) 2021 MediaTek Inc. */ +#include #include #include #include @@ -175,7 +176,8 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx, alpha_con |= state->base.alpha & MIXER_ALPHA; } - if (state->base.fb && !state->base.fb->format->has_alpha) { + if ((state->base.fb && !state->base.fb->format->has_alpha) || + state->base.pixel_blend_mode == DRM_MODE_BLEND_PIXEL_NONE) { /* * Mixer doesn't support CONST_BLD mode, * use a trick to make the output equivalent