Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7192467ybi; Mon, 8 Jul 2019 16:35:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1JZ20/eExoB2FhWomLFlEEgJxcUdrab2ElPJP8x1zOgBbshuYeD6yhKB7kfhUjQgKK8tF X-Received: by 2002:a17:902:f082:: with SMTP id go2mr29318493plb.25.1562628931956; Mon, 08 Jul 2019 16:35:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562628931; cv=none; d=google.com; s=arc-20160816; b=KXl6yFOLbfGgq3KdtPFtp9Ow0qsqLsIhi5yQ5Q1UbbQXeEnRhCG7rnV6Nj5+zzOsoO L5dX+a7P89P5pyRtO5T6o8kqY4Se/6f1Lqhzlbzx6KGMXLoqJY1vHISrdQkLMFRdZ0pV +qetZ4lrP7gbhrNEa+Zi4ZCsGYG4m0ClhoOefmWSY+BRBThhx2a0rt5fPJFi+yh3poHF 2r2I3MwQrUlwzOJmWJnLiKj8ZIjoZwvP5cVWtFxNPKDu4sXatuzU3320rB+1Vj4mgtjz nPkycTF06CO18CB2tnaw/hGQZfTPbCC5k3/VJn22UwQ7UwHX42EFJQNFk03IjRl0xsxC Y/UQ== 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=lqXxFs8FrnyMNuqLv9lEas/DLH6hRLsU6bBfZIcaTmg=; b=bERuGw2IRbTTvqvAF2BSZi1tHeIsK3sgXrXYjqePDJjyuEdvn1gmAoy7mQsYZOeaHi mbxy/7si4qsboHNl34J2lfEkJu/JHIly+FdUvvH4+1OEx4xTxeCIe6Xq1KO6THg0rC0j RY0fkB6rcnxRYWH0EJanl1WiqxY0wxgNPqYJI0iKUZ0jUbpdLQqdRXumV7G/6lb9CBkm dAswpJ7b9cl13EK9b5T2TUD61y2huwuoS+pzaz/JKCCdT/JhIfyQ00k5D7nlUE7aRmO+ KsXAQ4WZ+Kie9mlkjBGT01eWuEA76xVZ1HWr8YClF1B5hnuPPjcqszTppDHP1qJA3YYZ f+dQ== 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 r4si19344863pgp.249.2019.07.08.16.35.16; Mon, 08 Jul 2019 16:35:31 -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 S1727762AbfGHWew (ORCPT + 99 others); Mon, 8 Jul 2019 18:34:52 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:25910 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727547AbfGHWer (ORCPT ); Mon, 8 Jul 2019 18:34:47 -0400 X-UUID: fb0084a53d9a47c688ff393d58f992c6-20190709 X-UUID: fb0084a53d9a47c688ff393d58f992c6-20190709 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 686714619; Tue, 09 Jul 2019 06:34:40 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Tue, 9 Jul 2019 06:34:38 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Tue, 9 Jul 2019 06:34:37 +0800 From: To: CK Hu , Philipp Zabel , Rob Herring , Matthias Brugger CC: David Airlie , Daniel Vetter , Mark Rutland , , , , , , Yongqiang Niu Subject: [PATCH v4, 20/33] drm/medaitek: add layer_nr for ovl private data Date: Tue, 9 Jul 2019 06:34:00 +0800 Message-ID: <1562625253-29254-21-git-send-email-yongqiang.niu@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty In-Reply-To: <1562625253-29254-1-git-send-email-yongqiang.niu@mediatek.com> References: <1562625253-29254-1-git-send-email-yongqiang.niu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 474F5C3AC966225E64CB4C579BF51C6090B072D4768532445A60A59DD61B83942000: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 Reviewed-by: CK Hu --- 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