Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp1042476lqm; Thu, 2 May 2024 03:40:36 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXRabujFxhLwV/RoalwNM/6FIuAQ7c2IZQTjdC/Owu/Vt8xCyXKx1GkmKJdGfahv+TXXhEfyo3NLmkzvOwJJV3Jt30ZF50AqyxL2iKedg== X-Google-Smtp-Source: AGHT+IFFlTx5VyBeOJSHiCmLFakSJWPKfQ7uO1DweSSSl2mhb/EjL5ZebWFiKk0MHV9Xy5+aVZMi X-Received: by 2002:a05:6808:1791:b0:3c5:edee:7acf with SMTP id bg17-20020a056808179100b003c5edee7acfmr2477609oib.33.1714646436300; Thu, 02 May 2024 03:40:36 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714646436; cv=pass; d=google.com; s=arc-20160816; b=fubLeSFVZdWvSY/8cqqUdqzjKMQm7U8lMK6VU3X881bLWjKnwgvKRGymhhiruZEjqB IBZYfJF3vxPNHpVCvCVrC9RaJPe51aZJHyaB0cEk40l5lZuGkleb7fDfvL2+G8c0w2Pi yMeNxZRA2SiGyESIXYVlJoKAAHsv13Rw1HnlpoCFgqDEYevcVWTuTTGMDILW7rEG9cep 9R+uVxceEN9Y9Jq9JQV9qEZfUltNATJ4ATM6/QMs7CIdTkmv+SsmJrlj9gDUxIzqC0V3 ypN3c45W0SjcMwwD1TRFEGoRXleZehZU+cY7ZQMPKaLVCnIzXvS/kFiKFTN6MnD8ucTf jlqQ== 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=+XOaqvKKo60V5JWfLkrFv2Q93TBVwfFs5BEjU7vxWP0=; fh=cqg78MBO8cP6SLb/TWVgj1yGZGMGc3K34EILqL+DU6g=; b=gLHltCKutuusuN6deaY2lVVw17qjBYSOOemSdApLCfjdtS4FDR9Y7LGxg3vBQ6s769 RC6C3MgjBHG5N2z+/IWQvK1YIx6g3f3xxPLETFVrtTxKfxW8dFF5osrTB+KwizqhGITJ 81cIBD+nw8Sklf+ZCbL/xBB4UJR4enNOavAV+keUvfwMDvpg7cXKSnNaorqNaciFkDO4 4ozXecE4+hnhHY+rP127InG0Yz5FUmLL0poMe2H0oohiDN/3s64uXlqpvn7BET0WAOQh oPzSX8KZP0VKW529uRMp5dfKDxBrfJRZjgrwznZ1fhvHAO4zkTbuP6yfmzvyj6k+nK62 MuVg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="iM5BKa/5"; 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-166322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166322-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id vr11-20020a05620a55ab00b00790fa768cdfsi628135qkn.158.2024.05.02.03.40.36 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 02 May 2024 03:40:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-166322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="iM5BKa/5"; 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-166322-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-166322-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id E57661C21F73 for ; Thu, 2 May 2024 10:40:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1AACF80028; Thu, 2 May 2024 10:39:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=mediatek.com header.i=@mediatek.com header.b="iM5BKa/5" Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) (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 B0F0E5FBA0 for ; Thu, 2 May 2024 10:39:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=210.61.82.184 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714646346; cv=none; b=s4Eggqb0jT68dvlV6we5Lpu/2ODNs29eRF3DBqngTd1lbyAV40aG3K2tR5Q5jzaWGV0DytNoAL8nqNizHlVnzTULsAqxqvQDOmQlSVXdKj4tmMXnqqJkq0iyiPMbbX+CFxkLRDslOEEeKt0/G2rS1WTao2aSadjOj5KwHqHAqK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714646346; c=relaxed/simple; bh=wZj+0R1rJEOomUKrITrc5ffYGx9p/3A67OFqkkN8bXE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=UF2yvC3EnKE6RGkj2RZj3wbFxTLrUHeVGZb5Tt+pTaCTg6hlSlrWJYfbzSRkA3d5YkiLQ33D12Zy1c2FpF/K9btGoK5m2VdJfPC4rwL8Y8DMfJ9Qd2mOv4G5B/tSNWpQM1ijKZLudkozSpu0LIJ+BhRHTWdurW3nYlkN7PaBoE4= 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=iM5BKa/5; arc=none smtp.client-ip=210.61.82.184 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: 2ec77a9e087011ef8065b7b53f7091ad-20240502 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=+XOaqvKKo60V5JWfLkrFv2Q93TBVwfFs5BEjU7vxWP0=; b=iM5BKa/5A9DY6TJQPspsq72KlOaY/IZpBqrkxQLexcN4d/jGLtQcoi5YQuEGF1Y3YZCb05Je3IEi99dZ+Y8D7JSTjhKuDJ2x653xy1VM/OEdq40WxHn87YtRI30A2FXDQ9DKBEqQH1vrd7YE4C6stUdZBP3YM7v4/ML60LYVgKY=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.38,REQID:bdf097be-1bcf-4aa7-bd25-36fc8371cfa5,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:82c5f88,CLOUDID:0c5a4592-e2c0-40b0-a8fe-7c7e47299109,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 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR X-UUID: 2ec77a9e087011ef8065b7b53f7091ad-20240502 Received: from mtkmbs13n2.mediatek.inc [(172.21.101.108)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 667168338; Thu, 02 May 2024 18:38:58 +0800 Received: from mtkmbs13n1.mediatek.inc (172.21.101.193) by MTKMBS14N2.mediatek.inc (172.21.101.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Thu, 2 May 2024 18:38:56 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs13n1.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Thu, 2 May 2024 18:38:56 +0800 From: Shawn Sung To: Chun-Kuang Hu , AngeloGioacchino Del Regno CC: Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , Bibby Hsieh , CK Hu , "Nancy . Lin" , Fei Shao , Sean Paul , Jason Chen , , , , , "Hsiao Chien Sung" Subject: [PATCH v7 09/18] drm/mediatek: Support constant blending in OVL Date: Thu, 2 May 2024 18:38:39 +0800 Message-ID: <20240502103848.5845-10-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20240502103848.5845-1-shawn.sung@mediatek.com> References: <20240502103848.5845-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-TM-AS-Product-Ver: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-AS-Result: No-10--7.014400-8.000000 X-TMASE-MatchedRID: gZQz39yqSjfX3tqA7xZNm8ULzBBTAHAlEbxKVXd70tXfUZT83lbkEB8+ XHETeZCzN+7y0ElYiShN07ecPiYifxvVxZLseBRpo2n0EGDeHYTrwADV7fYz7Luqk4cq52pzje0 jgce+svLi8zVgXoAltsIJ+4gwXrEtwrbXMGDYqV8PXZPurZ0hSylldsFtwSYSfKx+pSd7fJSwt3 bU6fZRrk3qMEl8fGfE X-TM-AS-User-Approved-Sender: No X-TM-AS-User-Blocked-Sender: No X-TMASE-Result: 10--7.014400-8.000000 X-TMASE-Version: SMEX-14.0.0.3152-9.1.1006-23728.005 X-TM-SNTS-SMTP: A0B01D7939BDD3503480C7CABCABC8241FC2CC26E4F073973BEB098C26C588FB2000:8 X-MTK: N From: Hsiao Chien Sung Support constant alpha blending in OVL. Signed-off-by: Hsiao Chien Sung --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index 738244a6164e8..e41fd83e36e79 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -38,6 +38,7 @@ #define DISP_REG_OVL_PITCH_MSB(n) (0x0040 + 0x20 * (n)) #define OVL_PITCH_MSB_2ND_SUBBUF BIT(16) #define DISP_REG_OVL_PITCH(n) (0x0044 + 0x20 * (n)) +#define OVL_CONST_BLEND BIT(28) #define DISP_REG_OVL_RDMA_CTRL(n) (0x00c0 + 0x20 * (n)) #define DISP_REG_OVL_RDMA_GMC(n) (0x00c8 + 0x20 * (n)) #define DISP_REG_OVL_ADDR_MT2701 0x0040 @@ -428,6 +429,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 ignore_pixel_alpha = 0; unsigned int con; bool is_afbc = pending->modifier != DRM_FORMAT_MOD_LINEAR; union overlay_pitch { @@ -449,6 +451,9 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx, if (state->base.fb && state->base.fb->format->has_alpha) con |= OVL_CON_AEN | OVL_CON_ALPHA; + if (state->base.fb && !state->base.fb->format->has_alpha) + ignore_pixel_alpha = OVL_CONST_BLEND; + if (pending->rotation & DRM_MODE_REFLECT_Y) { con |= OVL_CON_VIRT_FLIP; addr += (pending->height - 1) * pending->pitch; @@ -464,8 +469,8 @@ void mtk_ovl_layer_config(struct device *dev, unsigned int idx, mtk_ddp_write_relaxed(cmdq_pkt, con, &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_CON(idx)); - mtk_ddp_write_relaxed(cmdq_pkt, overlay_pitch.split_pitch.lsb, &ovl->cmdq_reg, ovl->regs, - DISP_REG_OVL_PITCH(idx)); + mtk_ddp_write_relaxed(cmdq_pkt, overlay_pitch.split_pitch.lsb | ignore_pixel_alpha, + &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_PITCH(idx)); mtk_ddp_write_relaxed(cmdq_pkt, src_size, &ovl->cmdq_reg, ovl->regs, DISP_REG_OVL_SRC_SIZE(idx)); mtk_ddp_write_relaxed(cmdq_pkt, offset, &ovl->cmdq_reg, ovl->regs, -- 2.18.0