From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A1B1C10F13 for ; Tue, 16 Apr 2019 07:38:49 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 3C70D20857 for ; Tue, 16 Apr 2019 07:38:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="CO3bMepH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3C70D20857 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Date:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=3hAoqULIorFKBlCdlf64U50eptaiPxbVCXNS3gK7vgI=; b=CO3bMepH7MVKeW QuLzuf1sguqR2BZGx0u2DYRXOGqGJQMCxrsrQoQmCKLvorJXlTiVvq71a8Lx6+i6/9fb6Ngw0u5R0 u+iyh220MNjH+LaIXHxYJbnTdMDSIRMerIXRsFujWexSSd33okfAJ5oq9FOct5ExiROLA7F0oLQhy Wy4Y6HzD72o9cal29S/P0PsMm2EHA/QfzkXLkkSHhJAYBnU0zHj4k9f5PLP4fytNMxvYDE0iOINjq MP6KwYydFkjjp0LIk0imyVFF75PxZPl1IixY5jtU3dkQKtimjavEc1eY7paldOZrUgE45YMuMNBdo IQHvascZkJRTKIpI4yXQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGIg0-0005Vw-RQ; Tue, 16 Apr 2019 07:38:44 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hGIfx-0005VA-8e; Tue, 16 Apr 2019 07:38:42 +0000 X-UUID: a0056e89db0d4ea0a8185b27c7e1d18c-20190415 X-UUID: a0056e89db0d4ea0a8185b27c7e1d18c-20190415 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLS) with ESMTP id 363965059; Mon, 15 Apr 2019 23:38:34 -0800 Received: from MTKMBS01N2.mediatek.inc (172.21.101.79) by MTKMBS62N2.mediatek.inc (172.29.193.42) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 00:38:32 -0700 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 16 Apr 2019 15:38:24 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 16 Apr 2019 15:38:17 +0800 Message-ID: <1555400297.29874.2.camel@mtksdaap41> Subject: Re: [PATCH v2 17/25] drm/mediatek: add background color input select function for ovl/ovl_2l From: CK Hu To: Date: Tue, 16 Apr 2019 15:38:17 +0800 In-Reply-To: <1553667561-25447-18-git-send-email-yongqiang.niu@mediatek.com> References: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> <1553667561-25447-18-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 X-TM-SNTS-SMTP: 4C5F8F34B57783A584B4DE76991E398F3A27349D402B9A1526F939A8676668EF2000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190416_003841_352827_CAD520B6 X-CRM114-Status: GOOD ( 17.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, Bibby.Hsieh@mediatek.com, airlied@linux.ie, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, yt.shen@mediatek.com, robh+dt@kernel.org, linux-mediatek@lists.infradead.org, p.zabel@pengutronix.de, matthias.bgg@gmail.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, Yongqiang: On Wed, 2019-03-27 at 14:19 +0800, yongqiang.niu@mediatek.com wrote: > From: Yongqiang Niu > > This patch add background color input select function for ovl/ovl_2l > > ovl include 4 DRAM layer and 1 background color layer > ovl_2l include 4 DRAM layer and 1 background color layer > DRAM layer frame buffer data from render hardware, GPU for example. > backgournd color layer is embed in ovl/ovl_2l, we can only set > it color, but not support DRAM frame buffer. > > for ovl0->ovl0_2l direct link usecase, > we need set ovl0_2l background color intput select from ovl0 > if render send DRAM buffer layer number <=4, all these layer read > by ovl. > layer0 is at the bottom of all layers. > layer3 is at the top of all layers. > if render send DRAM buffer layer numbfer >=4 && <=6 > ovl0 read layer0~3 > ovl0_2l read layer4~5 > layer5 is at the top ot all these layers. > > the decision of how to setting ovl0/ovl0_2l read these layer data > is controlled in mtk crtc, which will be another patch > > Signed-off-by: Yongqiang Niu > --- > drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 24 ++++++++++++++++++++++++ > 1 file changed, 24 insertions(+) > > diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c > index a0ab760..c226284 100644 > --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c > +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c > @@ -27,6 +27,8 @@ > #define DISP_REG_OVL_EN 0x000c > #define DISP_REG_OVL_RST 0x0014 > #define DISP_REG_OVL_ROI_SIZE 0x0020 > +#define DISP_REG_OVL_DATAPATH_CON 0x0024 > +#define OVL_BGCLR_SEL_IN BIT(2) > #define DISP_REG_OVL_ROI_BGCLR 0x0028 > #define DISP_REG_OVL_SRC_CON 0x002c > #define DISP_REG_OVL_CON(n) (0x0030 + 0x20 * (n)) > @@ -245,6 +247,26 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, > mtk_ovl_layer_on(comp, idx); > } > > +static void mtk_ovl_bgclr_in_on(struct mtk_ddp_comp *comp, > + enum mtk_ddp_comp_id prev) > +{ > + int is_ovl = 0; > + > + if (prev == DDP_COMPONENT_OVL0 || > + prev == DDP_COMPONENT_OVL0_2L || > + prev == DDP_COMPONENT_OVL1_2L) > + is_ovl = 1; I think this logic should be moved to mtk crtc and OVL need not to care about which component is in front of it. Regards, CK > + > + mtk_ddp_write_mask((is_ovl << 2), comp, > + DISP_REG_OVL_DATAPATH_CON, OVL_BGCLR_SEL_IN); > +} > + > +static void mtk_ovl_bgclr_in_off(struct mtk_ddp_comp *comp) > +{ > + mtk_ddp_write_mask(0, comp, > + DISP_REG_OVL_DATAPATH_CON, OVL_BGCLR_SEL_IN); > +} > + > static const struct mtk_ddp_comp_funcs mtk_disp_ovl_funcs = { > .config = mtk_ovl_config, > .start = mtk_ovl_start, > @@ -255,6 +277,8 @@ static void mtk_ovl_layer_config(struct mtk_ddp_comp *comp, unsigned int idx, > .layer_on = mtk_ovl_layer_on, > .layer_off = mtk_ovl_layer_off, > .layer_config = mtk_ovl_layer_config, > + .bgclr_in_on = mtk_ovl_bgclr_in_on, > + .bgclr_in_off = mtk_ovl_bgclr_in_off, > }; > > static int mtk_disp_ovl_bind(struct device *dev, struct device *master, _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel