Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp544996lqs; Thu, 13 Jun 2024 19:50:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQ9j0gki4YVtyQkWpQRoRph0rR5PyMqsaMVumK0VV5yGTOJ/4YPBM/YikNgy23J0sf9wZi42GHhbN9XhRJbRN2GT/lhRrClCyXPk5Vvg== X-Google-Smtp-Source: AGHT+IF9zRHnXGbZBEYDJMxGrq+x296dC03lRFJvt9XUr7AHC3cBAl+x0jQLI56aV/gUsKyRj7qO X-Received: by 2002:a50:955a:0:b0:57c:ab4c:f05e with SMTP id 4fb4d7f45d1cf-57cbd68e5c0mr847856a12.20.1718333401131; Thu, 13 Jun 2024 19:50:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718333401; cv=pass; d=google.com; s=arc-20160816; b=ubHwjZR4MD1F8ig2hukPGKvUatxXuM3ACucl0iflsuOP7o7xfuW324+c0IP16Fwy+a +O9mOMgFkNmDiBBghlIzHecW/38HN1BUl8fnf6OJAgmc3NO2ogcLGji3dqtHCTRBY4F6 4ZRkcxI0v5anYPGM3lpcIR25Mj4eGYiHBzb/ALE5O7kFJXiyIelZCShtvVBuc9RyOdvL dkC5MeXFlXFbmVp+DUEG+eRFQoYN32X9/DPmpf+8jnboMm6e7GF/HqUkbicYbneZish8 3qlA+wtTN5uKFdDTaVcKnYh/7yfsjdUw3xit1fo7KoJtj7kEmkEzcKv0Vf4xgpyEQWy2 txmQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=toZI1eMYvUVCsfzTbCuF8F4eC4xSRVwzzC5k4uSZ54g=; fh=q/Ppq8/frEfcA3kotGB0IrpJr8gO0uNs3CtN4uoBAAY=; b=nPOHmFmCISGybjq29cnESDCka1tHQ6ZrBTNtdvNejSMQBJ7AxfIaEzn+YX8HkM8gMz PG6gbXxUDAZFIeBdN6+nuWP5qhkBxFFaOL8oKiaDv0BQCOFmv91VZCH8kk8w4hstK+7+ DGYubyBzl8nygvHT5Ro7cZytc4duLUx0ZKX/oJ8aUejP8WIvcwz4RkG4Y8Ng7VciQcVY QT1+puArwwTAyMpjMyIeGey/MATl7NxCUfa2OrZelYyJ0VxsyqARO5Lhp8Exg/oFyeRP c4bdaTglqe66GIXJ5M+CD/wzTpsZkXSdEsL1U2AEEr+t5ddykDLdAPrOdFCMuvvnpyQj srSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=jUVWhhfP; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-214266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57cb72e2aabsi1257911a12.203.2024.06.13.19.50.01 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 19:50:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=jUVWhhfP; arc=pass (i=1 spf=pass spfdomain=mediatek.com dkim=pass dkdomain=mediatek.com dmarc=pass fromdomain=mediatek.com); spf=pass (google.com: domain of linux-kernel+bounces-214266-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214266-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id D4C921F21E3C for ; Fri, 14 Jun 2024 02:50:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 597D41836CA; Fri, 14 Jun 2024 02:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="jUVWhhfP" Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id EF818187547 for ; Fri, 14 Jun 2024 02:46:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=60.244.123.138 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718333196; cv=none; b=hGfraQ7F/PUpLe6cN8NzZPf9GBNbH3uf/HFbld2yjJnU6GnfEPDyDCTkgRJ3BVddtabPoEBHkANZxo2/lpX35xWVef5Cqqo7+/X0GooKyaLAt5k3LwKjoS5emdBcuE9WxFjlo6yejYa0zkt8VELO2ABMXz4mMikkU9w/J2XWcmc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718333196; c=relaxed/simple; bh=REYsVMNMXZTTP7/Vw8gaZi+NbCMSXNkwGH5ntrVRidk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=eZxTIMT4zK3vJn7fF04qCg+ra7h2hBtH7cSlxL4Y7Ava9YFS8wR4rYbMHhndpFXMkqA/pxsBEZoF6EV2SK76g7RcvabrlkyVe2kb/R0ZwooSGMmJoYq5SbqWVsWyRI3LDbRK4Izj/KmR1fSGjXeQfJmaUTkFVP9tBJiQLxguX4s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com; spf=pass smtp.mailfrom=mediatek.com; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b=jUVWhhfP; arc=none smtp.client-ip=60.244.123.138 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=mediatek.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mediatek.com X-UUID: 4ab5dd4629f811efa54bbfbb386b949c-20240614 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=toZI1eMYvUVCsfzTbCuF8F4eC4xSRVwzzC5k4uSZ54g=; b=jUVWhhfPWTuWsQvuAbwaorZRfe2HQbN60Sd77eYtsjsAUWqHw+pPiLFr6D6gWE+HUkokZxpINj5I6TDV6xB//wJ4mH3lur4I3wgrQJJyrcYQ4FSPGGdc5NvNaeiNMirb0+bfk+lHyMKyp4vfGD10YOdgHaFt61JzQE2NkEJpsa4=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.39,REQID:c76c087d-8acc-4430-918c-f814330720d1,IP:0,U RL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTION :release,TS:-5 X-CID-META: VersionHash:393d96e,CLOUDID:e9fe1185-4f93-4875-95e7-8c66ea833d57,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:-3,IP:nil,U RL:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1, SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0,ARC:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 4ab5dd4629f811efa54bbfbb386b949c-20240614 Received: from mtkmbs11n2.mediatek.inc [(172.21.101.187)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 251409021; Fri, 14 Jun 2024 10:46:25 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs13n2.mediatek.inc (172.21.101.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Fri, 14 Jun 2024 10:46:24 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Fri, 14 Jun 2024 10:46:24 +0800 From: Shawn Sung To: Chun-Kuang Hu CC: Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Bibby Hsieh , CK Hu , "Nancy . Lin" , Sean Paul , Jason Chen , Fei Shao , , , , , Hsiao Chien Sung Subject: [PATCH v9 14/21] drm/mediatek: Support "None" blending in OVL Date: Fri, 14 Jun 2024 10:46:13 +0800 Message-ID: <20240614024620.19011-15-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20240614024620.19011-1-shawn.sung@mediatek.com> References: <20240614024620.19011-1-shawn.sung@mediatek.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-MTK: N From: Hsiao Chien Sung Support "None" alpha blending mode on MediaTek's chips. Signed-off-by: Hsiao Chien Sung --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 2316d4a6dca7..6567806cf4e2 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -431,6 +431,7 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx, unsigned int fmt = pending->format; unsigned int offset = (pending->y << 16) | pending->x; unsigned int src_size = (pending->height << 16) | pending->width; + unsigned int blend_mode = state->base.pixel_blend_mode; unsigned int ignore_pixel_alpha = 0; unsigned int con; bool is_afbc = pending->modifier != DRM_FORMAT_MOD_LINEAR; @@ -460,7 +461,8 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx, * For RGB888 related formats, whether CONST_BLD is enabled or not won't * affect the result. Therefore we use !has_alpha as the condition. */ - if (state->base.fb && !state->base.fb->format->has_alpha) + if ((state->base.fb && !state->base.fb->format->has_alpha) || + blend_mode == DRM_MODE_BLEND_PIXEL_NONE) ignore_pixel_alpha = OVL_CONST_BLEND; if (pending->rotation & DRM_MODE_REFLECT_Y) { -- 2.18.0