Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp544780lqs; Thu, 13 Jun 2024 19:49:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV/KA4XmMnpZRYWL2pliIIXDdFXhZvsA9KRNCa+bdY0GpF+YRvIvgsZEA0Z7l4eOU9KMURz/kPQmgzpq02mWv0hw6+zuYPwPszeqD2meQ== X-Google-Smtp-Source: AGHT+IFPuZ0yKDCWDnaI/u56GZpKj6QG9EiVACendpLWFINPmUYEMIabMATXOPWA2PVRAO0AnJzh X-Received: by 2002:a17:906:7215:b0:a65:7643:3849 with SMTP id a640c23a62f3a-a6f60de5f9bmr85625466b.73.1718333343517; Thu, 13 Jun 2024 19:49:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718333343; cv=pass; d=google.com; s=arc-20160816; b=NksIUmiNSV7ymF0i+ElVO6UlfQHTSjXNZeYawPlGiwa2+A2/F6336vhDjA9yzHGyrH tn5XPVvoIaCL4CsFrZxKC6Hd+FpRQvdzFz0q/Chy3BDfBk1IZS+gqh+NdLqHY107iO4R jJ+lxtyyTGFCjpbfm1+eQclCQ3CGox1Cu7MFSrczMHvBBgmvBLiI4cDtLujMFiD7PSDw 1Ef960k99QWrZe1xLhRffgXhKLCdMfPiACJCHM4CJAnzir0cI5JUQGJVkKdOXqGLDJxe qDbnbqyHH9WBlJFBi2R3snseFQto0zUFI4f8ItV84O61mv0UvJsR9WWCrEkWQdhnMPWW 6neg== 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=DjFKUi2wtajmjAzUBQErieaH7TUuWPwc9BP5pjVN8B0=; fh=q/Ppq8/frEfcA3kotGB0IrpJr8gO0uNs3CtN4uoBAAY=; b=cWIkINuYWPM24lPiV3vW/eBAcM5bV4YUjKGoVRh/35ZU/djEsTRy+awrYwacA1y3SN HUc46RVKGUXL383q4jI93HeC0SfuYtpFr9E+ftc6NjKjz6422Oefo2dpxafUgz6Oqo2s CbGDQy7qQrOjIo4KMdbsXTgJFDxmQ3f06+xos/TDhsdkG616lq3qelvgmuyjLRVoHNXd 5f/jd2Hm2eTrbYlwZHFy/9sHXtgmXC87PVNOpPumA42i4nA+qgjOjt6/gTJrT4odii7x DomhWVwSAwydXpxkgnKph0S28/HxGLcTYBdNjY0abvowyV0Xv53EJRjnv50MGsAf/zoy bEKg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=BJg6bZuq; 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-214262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214262-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 a640c23a62f3a-a6f56e26f29si121999466b.704.2024.06.13.19.49.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 19:49:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-214262-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=BJg6bZuq; 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-214262-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-214262-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 3F9941F21970 for ; Fri, 14 Jun 2024 02:49:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 79470188CDD; Fri, 14 Jun 2024 02:46:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="BJg6bZuq" 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 CD7971850B3 for ; Fri, 14 Jun 2024 02:46:32 +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=1718333194; cv=none; b=cJ+fargGIFkV89TCTxqxL54ouul9ESzVHHmiMu4pRezBRea6O/ZYezpvimCVRZwGA4lp4n8tjEqWO8zEuR9WW3M7TIH0NcxbnlgNrarGzkggAoiLs31i8oB9ky2hUGnYukVwLXU8A9JbBuzD+Fvn1byuvjUll64t0p9wiGzE29k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718333194; c=relaxed/simple; bh=+iPBECd+g2hUqYzlijq8QgoWl7j2fHLJQBlqQspzKO0=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=gBaqlkxfbzXXDxXfvOjuLMBIVD6Ya7NgkQbA9YADRuhZuCKgfuMlfCFmBQYNQglxozIAANDprI9KA9PYjP+4lpjTmkQ6a0e4WWwsm3q4AEgHvSxUAZ5HwNTMfOMAvKl87hTuxNRDhJ3CRE0NozcJkUExBhRXH6xenBwWViklD0s= 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=BJg6bZuq; 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: 49e7a5f229f811efa54bbfbb386b949c-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=DjFKUi2wtajmjAzUBQErieaH7TUuWPwc9BP5pjVN8B0=; b=BJg6bZuq69GHhvKGH5rFMYJ7NvZk2eEmL87TQGcySarIjIbSM5H7ETFc76hj6ItY+B2zFcviwl4F22jlgKr3SURr8jM1M+AF+fdZBHdn5y5UK+oM3164nrTpVohuX9HF19Sb1sYJE07OK9YsrO5l3r5GsK6Lr5bqp7buMaH1AIQ=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.39,REQID:6c6e3b65-9400-441b-8817-62a19cea6f43,IP:0,U RL:0,TC:0,Content:-5,EDM:-30,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTI ON:release,TS:-35 X-CID-META: VersionHash:393d96e,CLOUDID:c4df9188-8d4f-477b-89d2-1e3bdbef96d1,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:102,TC:nil,Content:0,EDM:2,IP:nil,UR L:0,File:nil,RT:nil,Bulk:nil,QS:nil,BEC:nil,COL:0,OSI:0,OSA:0,AV:0,LES:1,S PR: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: 49e7a5f229f811efa54bbfbb386b949c-20240614 Received: from mtkmbs09n1.mediatek.inc [(172.21.101.35)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 234012777; Fri, 14 Jun 2024 10:46:24 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS09N2.mediatek.inc (172.21.101.94) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 13 Jun 2024 19:46:23 -0700 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:23 +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 10/21] drm/mediatek: Fix XRGB setting error in Mixer Date: Fri, 14 Jun 2024 10:46:09 +0800 Message-ID: <20240614024620.19011-11-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 Although the alpha channel in XRGB formats can be ignored, ALPHA_CON must be configured accordingly when using XRGB formats or it will still affects CRC generation. Fixes: d886c0009bd0 ("drm/mediatek: Add ETHDR support for MT8195") Signed-off-by: Hsiao Chien Sung --- drivers/gpu/drm/mediatek/mtk_ethdr.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_ethdr.c b/drivers/gpu/drm/mediatek/mtk_ethdr.c index 9796fd1d51f2..902dec03a7dd 100644 --- a/drivers/gpu/drm/mediatek/mtk_ethdr.c +++ b/drivers/gpu/drm/mediatek/mtk_ethdr.c @@ -153,6 +153,7 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx, unsigned int offset = (pending->x & 1) << 31 | pending->y << 16 | pending->x; unsigned int align_width = ALIGN_DOWN(pending->width, 2); unsigned int alpha_con = 0; + bool replace_src_a = false; dev_dbg(dev, "%s+ idx:%d", __func__, idx); @@ -172,8 +173,15 @@ void mtk_ethdr_layer_config(struct device *dev, unsigned int idx, if (state->base.fb && state->base.fb->format->has_alpha) alpha_con = MIXER_ALPHA_AEN | MIXER_ALPHA; - mtk_mmsys_mixer_in_config(priv->mmsys_dev, idx + 1, alpha_con ? false : true, - MIXER_ALPHA, + if (state->base.fb && !state->base.fb->format->has_alpha) { + /* + * Mixer doesn't support CONST_BLD mode, + * use a trick to make the output equivalent + */ + replace_src_a = true; + } + + mtk_mmsys_mixer_in_config(priv->mmsys_dev, idx + 1, replace_src_a, MIXER_ALPHA, pending->x & 1 ? MIXER_INX_MODE_EVEN_EXTEND : MIXER_INX_MODE_BYPASS, align_width / 2 - 1, cmdq_pkt); -- 2.18.0