Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5000438img; Tue, 26 Mar 2019 23:22:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXmF9JJlIoyLJqMWrJpLP89LZmCsPX3uIZasKQBMKU0UvlVf/NcWaJpw4UzHuCJRijRc45 X-Received: by 2002:a63:cc03:: with SMTP id x3mr32370381pgf.121.1553667745079; Tue, 26 Mar 2019 23:22:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553667745; cv=none; d=google.com; s=arc-20160816; b=iht+ynpzYb4BpkHVGu59sbt4sMB+4ygQw39nYjqy4JfVX5hRjBUuyyH/CnQp+29a1j lcOeBTKUyMj4OB+lyBSNBJ54XyRVjs3DOa1CzRCt4VMuLNRyBM51JmJ/I79bGGy/zKJ1 csrY1sTbNUeiP+pWcN+pgaKrAIRY7ifrAsTbEGlG0/m28wXPCQa7I9jt3ghUBdzuXPKh yPpn0KI1d7JBkIekzuT5+3Z4chiYVCdRjNS48j74OwTjSfw6AAp7119tAPEVQXxSfwLC RbqRjCNShaUYWLh81j/vGekhkT6WYEP/GdJSDcCLjhvgInLZjSlhPc8/G4rfqilU/0zH X5VA== 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=fXknyW2nvCCWmjFoa54Db1RToSyuJD1drLDLKZQ2ADc=; b=gYdTlRk7I2sf1q7NwoqxEq4i4iPTM+IanjFk9WuY+4PVhsIMfgWHoHlYKIfkibvO0e Bj234ptTQ0OHE5i7QgE7c8xLu/Sp78Xxgkx5GY+4bsSvqh701vVkDDdFw5GtlB1FX2cH hN+Pmof0cTHu/KAY5uU057H8m96KGDoYqVcy4oMfBJpGzpmlS/S13ESO2eBWaTGNJqPF ssZQAHOOqFhiJ7usPBcJDFR54vWzefyweLDUAN6Ji4IjvT32LaXF9oiDi38RxWErbwfe dH7i+lUQE/UHKI2RIn0A1v4VkaSSydyCBBMdCibBuw74lqjErjxD4PpkK17zJpp28THN LxLA== 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 y2si18091817pll.133.2019.03.26.23.22.10; Tue, 26 Mar 2019 23:22:25 -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 S2387479AbfC0GT5 (ORCPT + 99 others); Wed, 27 Mar 2019 02:19:57 -0400 Received: from mailgw01.mediatek.com ([210.61.82.183]:34663 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1733305AbfC0GTx (ORCPT ); Wed, 27 Mar 2019 02:19:53 -0400 X-UUID: 7e9f7f0fe8e0420c8d7dbd0f5e95b476-20190327 X-UUID: 7e9f7f0fe8e0420c8d7dbd0f5e95b476-20190327 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw01.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1222790980; Wed, 27 Mar 2019 14:19:44 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 27 Mar 2019 14:19:42 +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:41 +0800 From: To: , , , CC: , , , , , , , , , Yongqiang Niu Subject: [PATCH v2 14/25] drm/medaitek: add layer_nr for ovl private data Date: Wed, 27 Mar 2019 14:19:10 +0800 Message-ID: <1553667561-25447-15-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-TM-SNTS-SMTP: 98485D9212313C5302EB16667FBB041A23E38E559E59D27155AE05C422697C822000:8 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 layer_nr for ovl private data ovl_2l almost same with with ovl hardware, except the layer number for ovl_2l is 2 and ovl is 4. this patch is a preparation for ovl-2l and ovl share the same driver. Signed-off-by: Yongqiang Niu --- drivers/gpu/drm/mediatek/mtk_disp_ovl.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c index afb313c..a0ab760 100644 --- a/drivers/gpu/drm/mediatek/mtk_disp_ovl.c +++ b/drivers/gpu/drm/mediatek/mtk_disp_ovl.c @@ -60,6 +60,7 @@ struct mtk_disp_ovl_data { unsigned int addr; unsigned int gmc_bits; + unsigned int layer_nr; bool fmt_rgb565_is_0; }; @@ -137,7 +138,9 @@ static void mtk_ovl_config(struct mtk_ddp_comp *comp, unsigned int w, static unsigned int mtk_ovl_layer_nr(struct mtk_ddp_comp *comp) { - return 4; + struct mtk_disp_ovl *ovl = comp_to_ovl(comp); + + return ovl->data->layer_nr; } static void mtk_ovl_layer_on(struct mtk_ddp_comp *comp, unsigned int idx) @@ -342,12 +345,14 @@ static int mtk_disp_ovl_remove(struct platform_device *pdev) static const struct mtk_disp_ovl_data mt2701_ovl_driver_data = { .addr = DISP_REG_OVL_ADDR_MT2701, .gmc_bits = 8, + .layer_nr = 4, .fmt_rgb565_is_0 = false, }; static const struct mtk_disp_ovl_data mt8173_ovl_driver_data = { .addr = DISP_REG_OVL_ADDR_MT8173, .gmc_bits = 8, + .layer_nr = 4, .fmt_rgb565_is_0 = true, }; -- 1.8.1.1.dirty