From patchwork Wed Jun 19 16:38:53 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: 13704250 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 790F8C2BB85 for ; Wed, 19 Jun 2024 16:39:55 +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=3Vn05ZdzueZ5gWrHpBXyshyutauSS3iBtuHLr076fZs=; b=4YHmT32VX3ytyGJugGSIHjkGgN JEHwq5pGWrt0twXIfBA14eYXt4Invsa6vdNAZqZAg8mtta+r2crqmAM7S0nn275dMVa6oAS+lA4Wk 4VddTwO5ogJQjgxMmdgBvVuiihfYDtyS/Az4LgxIYm75/Q47ZlN/0RPeCCP9CTIIOlAXVYeT8t3fu wBVcMHxclCsqF04mPapkrkJaj6+322OFeW6ABXnM/vm2FV4gwjCXcVWWBw0MT7dR8AzOqJQa3Mcqv Qz5uLDvWN1lFEeHfkddB4pDfOFm5s/qqVkOMOBNZmDJHid74UABd2iAJ2cTd1HyAHslGLZSkn0lDu pTeDL1gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJyLi-000000024wN-2ydY; Wed, 19 Jun 2024 16:39:54 +0000 Received: from sin.source.kernel.org ([2604:1380:40e1:4800::1]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sJyKk-0000000242i-0lNw; Wed, 19 Jun 2024 16:38:56 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id B5A38CE207D; Wed, 19 Jun 2024 16:38:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 82AE4C4AF1B; Wed, 19 Jun 2024 16:38:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718815125; bh=Zr9NDsq7PgN7FZcmmMvcG9xbkaiZgoKF0Pjn/kMasDo=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=fRaKuPxXvGl2Mjo2jeS/peKbK6rxV2eA08bhPkcGigAHdGDP+GbYJWQkhRDiQB8cd jfCLIb/hFfWtSNwPMrE+jtvXrNs0mDIlg2QC4vhvObwxcXPnVXpGzwfBFszQGot3Oo 0z13Zmaop9DP9nF+GMylYiOehmpbqgpTfLa4MeY+DNJihBCFtwjxgBJaf5uhm8939O 3krJy2EBDo/yw2oD9zi5iv0OPQ5bqLm+UApevBvH1jOhSm/c2HFVFsvDQBZIpMUzV2 tT0uLjevctdFO4ssW0Zd6D6oAviISS8U5zthf4x1EH/dOMZu496i3rYvZMnJLIzpmN j2KwENFKeLyCw== 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 77F2BC2BC81; Wed, 19 Jun 2024 16:38:45 +0000 (UTC) From: Hsiao Chien Sung via B4 Relay Date: Thu, 20 Jun 2024 00:38:53 +0800 Subject: [PATCH v3 13/14] drm/mediatek: Support DRM plane alpha in OVL MIME-Version: 1.0 Message-Id: <20240620-igt-v3-13-a9d62d2e2c7e@mediatek.com> References: <20240620-igt-v3-0-a9d62d2e2c7e@mediatek.com> In-Reply-To: <20240620-igt-v3-0-a9d62d2e2c7e@mediatek.com> To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , CK Hu , Bibby Hsieh , Daniel Kurtz , Mao Huang , "Nancy.Lin" Cc: YT Shen , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Hsiao Chien Sung X-Mailer: b4 0.14.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1718815123; l=1153; i=shawn.sung@mediatek.com; s=20240616; h=from:subject:message-id; bh=yJNhIn0leRAVKcGRNcbL93uhE9Lt8lpjWo3NwzELbK8=; b=ey4V7ZgnVkAT+IPbPvkrrbBhXKhF5T2jheFXSgN7mCj3Yk/HpJxoD+F1ELcHtWB3rR6HZPlHY Y1ToI4iAKc/CUf5K2JaddictYM2RP4QqaOFcclAJNfHYqLhmgjEPIAM X-Developer-Key: i=shawn.sung@mediatek.com; a=ed25519; pk=lq1w8BuWDINX+4JHjGHhhbAU5ICP+cL9VCj7wn+cEDA= X-Endpoint-Received: by B4 Relay for shawn.sung@mediatek.com/20240616 with auth_id=172 X-Original-From: Hsiao Chien Sung X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240619_093854_737041_35115CA8 X-CRM114-Status: UNSURE ( 9.17 ) X-CRM114-Notice: Please train this message. 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 Set the plane alpha according to DRM plane property. Reviewed-by: CK Hu Reviewed-by: AngeloGioacchino Del Regno Fixes: 119f5173628a ("drm/mediatek: Add DRM Driver for Mediatek SoC MT8173.") Signed-off-by: Hsiao Chien Sung --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 943db4f1bd6b..4b370bc0746d 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -458,8 +458,10 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx, } con = ovl_fmt_convert(ovl, fmt); - if (state->base.fb && state->base.fb->format->has_alpha) - con |= OVL_CON_AEN | OVL_CON_ALPHA; + if (state->base.fb) { + con |= OVL_CON_AEN; + con |= state->base.alpha & OVL_CON_ALPHA; + } /* CONST_BLD must be enabled for XRGB formats although the alpha channel * can be ignored, or OVL will still read the value from memory.