Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5000379img; Tue, 26 Mar 2019 23:22:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqzvcKCJPRyMegw5mdm9iAJ5lIv1ggkPmK8zesDOm/S00xVsIKy4/G/h5bTY7PNFXvAoEu3f X-Received: by 2002:a63:66c1:: with SMTP id a184mr32720317pgc.60.1553667739599; Tue, 26 Mar 2019 23:22:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553667739; cv=none; d=google.com; s=arc-20160816; b=WhvydmVtTwyuIG7A3IO3u/LGpx22GL3e99v+zLQVhF9LseVt9+2hYu92EXoJN+LnB+ +4+DiAUl/rvfcmquZsEsTRqtvsPJXkSo7Xp9aXikQoIjeEhVlC0795nBjsgmWQD0GSwz 64tw09hSZ2Qfix5kJKJ3KNxGtSNQvumG3rbhAii9bhhgvQo9ZfF8pCdi6NtJ6TiF8+GE ar7hRVW56J8cbcm1nl/+WOfMkmBPX8lAVwAGLNOWJzpb8uugVxOpdZv8d/0BBO2DhuiR xJ+h8bOUzpgmRVs5NXpAK2h2RqNfjhzFjE/w8/wOD6lthyVjSAYOKf7sttoU5087z9BJ kx7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=bjAaUb6vNirrC7Hk+Nk18glAh9+AN7vUx75Zog878wE=; b=NxvQlztcXyl8PzDOfg8GAxmYKbKBOoLlV8WsguAfQXZ02oLeAtSc3jjUITAlehmTbY qUJFSUOb48DI/7zzMyEjLbvQO5QEm3ELtljbav9qAu3/aLX9xvwqcm+AJHrW5po8Y4FT 8qoUggR8bUmJLQGWIP13cS0TJwooCxzzBenSdkf3UsbZ3LOeE/coJc06f3wbWKJe7gMg LwmCQFtzK3s8A0Sb8rcpodRNwdx9Nl5/6uMIEeDuf1f0ipGSocWPxu3jLbgT+5sK7MNh LgA5AIwEAxD5LfhCOVMjslKpHj3Nox24uLR/5QZlmO21ZDSMmV1Szq74vKKLQcUnIO3J FkVA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b23si18121862pfd.182.2019.03.26.23.22.04; Tue, 26 Mar 2019 23:22:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387648AbfC0GUs (ORCPT + 99 others); Wed, 27 Mar 2019 02:20:48 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:64217 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S2387472AbfC0GT6 (ORCPT ); Wed, 27 Mar 2019 02:19:58 -0400 X-UUID: 2ad80cb419194d669f75ce4efcbf8448-20190327 X-UUID: 2ad80cb419194d669f75ce4efcbf8448-20190327 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1422708197; Wed, 27 Mar 2019 14:19:53 +0800 Received: from MTKMBS01DR.mediatek.inc (172.21.101.111) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 14:19:51 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01dr.mediatek.inc (172.21.101.111) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 14:19:51 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 27 Mar 2019 14:19:50 +0800 From: To: , , , CC: , , , , , , , , , Yongqiang Niu Subject: [PATCH v2 17/25] drm/mediatek: add background color input select function for ovl/ovl_2l Date: Wed, 27 Mar 2019 14:19:13 +0800 Message-ID: <1553667561-25447-18-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> References: <1553667561-25447-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; + + 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, -- 1.8.1.1.dirty