From patchwork Mon Aug 15 09:30:27 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Meng Yi X-Patchwork-Id: 9280895 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id B7949607FD for ; Mon, 15 Aug 2016 12:26:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F19B28C74 for ; Mon, 15 Aug 2016 12:26:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 91EE428C76; Mon, 15 Aug 2016 12:26:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 2144328C74 for ; Mon, 15 Aug 2016 12:26:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED7276E434; Mon, 15 Aug 2016 12:26:05 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-DM3-obe.outbound.protection.outlook.com (mail-dm3nam03on0042.outbound.protection.outlook.com [104.47.41.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7D6526E0E1 for ; Mon, 15 Aug 2016 09:57:52 +0000 (UTC) Received: from BN3PR0301CA0036.namprd03.prod.outlook.com (10.160.180.174) by MWHPR03MB2717.namprd03.prod.outlook.com (10.168.207.139) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.549.15; Mon, 15 Aug 2016 09:41:56 +0000 Received: from BN1BFFO11FD043.protection.gbl (2a01:111:f400:7c10::1:154) by BN3PR0301CA0036.outlook.office365.com (2a01:111:e400:4000::46) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.557.21 via Frontend Transport; Mon, 15 Aug 2016 09:41:56 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=nxp.com; gmail.com; dkim=none (message not signed) header.d=none; gmail.com; dmarc=fail action=none header.from=nxp.com; Received-SPF: Fail (protection.outlook.com: domain of nxp.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BN1BFFO11FD043.mail.protection.outlook.com (10.58.144.106) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.567.7 via Frontend Transport; Mon, 15 Aug 2016 09:41:56 +0000 Received: from titan.ap.freescale.net ([10.192.208.233]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id u7F9fr4i006653; Mon, 15 Aug 2016 02:41:53 -0700 From: Meng Yi To: , Subject: [PATCH] drm/fsl-dcu: Add multi layers support Date: Mon, 15 Aug 2016 17:30:27 +0800 Message-ID: <1471253427-6260-1-git-send-email-meng.yi@nxp.com> X-Mailer: git-send-email 2.1.0.27.g96db324 X-EOPAttributedMessage: 0 X-Matching-Connectors: 131157277169681003; (91ab9b29-cfa4-454e-5278-08d120cd25b8); () X-Forefront-Antispam-Report: CIP:192.88.168.50; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(5003940100001)(106466001)(86362001)(19580395003)(77096005)(50986999)(36756003)(229853001)(2906002)(586003)(4326007)(85426001)(189998001)(104016004)(97736004)(5001770100001)(50226002)(626004)(8936002)(8666005)(11100500001)(356003)(81166006)(305945005)(105606002)(81156014)(8676002)(48376002)(92566002)(47776003)(7846002)(33646002)(50466002)(87936001)(68736007)(19580405001)(7059030); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR03MB2717; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD043; 1:BT9p1bOR/ltFantIj16IS3XTSMQiq4MbQDSV3Re4eBX+WyI7V/6rLYowJ7a+Wx5zIFVsbgjfARhe4/5mL0+kT8U/qIka47SSfd+ANv1os/98IGGmVe3OoPV6ttR2o+waZwespjcBltf/yNX7oRHik60S0UvOKZhjMadxtIJQPaEPqcBpEfty0PQRLsn28gWOVAsCNwzGS0MLSQ6ALJLbuLA9USIWMXPqhLfcFVi3Jn1YINSlKrD8hGSGnm0Rq/D7G41uVrXbhGOGqAYd2KBVwC1r6B5JhdYm5xIwwbPti9yv+Za3ZLaxDc2ha7O5+lk3pTVAZYSlvYTl7YKyuyi9XccZTb7wlFHoOQ3RPWL8CIatWfzAsprx+xSAxfchjeFvL92Lgff7NvfGSvcOWovbamY2EAMGMVz9co0zvky2xnJd30qM/Zq15PCpdtTD+VwPP3crFmZoboPJZNoTqEHoRVbbgCLxoOwnfElvMF8AMPOIIjeA7pcW+DcLBxZ+O8m8Wrr6+eC0uYDY6/Xnh+H/tbQeSbyR3PcUfygDB+kBFr4x5puX5Dv0fIe8opUuZbC4TNPZMU2lbzqahFskqGYdfUB8m2pV7fOA3BBj9NThK1V0++rXfSpuSj8W1cLgjSJT MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 01185472-048a-4a82-026b-08d3c4f065df X-Microsoft-Exchange-Diagnostics: 1; MWHPR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EHjk6HdF4KWETsWXJtVtO/nAy7XiWMI5vPqXK6B4PFweNJyZTDVYhLT1ZjHPunLBVmai72jU9UHh+z061M8X0rG5IcK83ZcNs3xe0KBoEhTxfxS40h1K66Zc9VI4vn/2hqY=; 4:M6/9JYW9F8alZucO/JL9zEKxPiGmjP7YnILJqRRrEyfVQfVEYB2OhayFhCYz0QnG3qcVSlKGFeKXUu3VmnTtKePGMR7JThgq3Jn8Xvm5CVD6ZoNGcoxTQfHObEBA1PFu6B0EKP0suLVSAADdZmYKazP+EgFQTkatujKbkWaYlCxRCTkQ2TIy7/rTgVbFE9VZ0G0K0Eh41bbkX/n6j6kyl5zn8YUBMZn9X20XH+mS2fNRU69yZkW/+i1t8tu3wMG/g2WnoMWHW5mDwTQU++LSlqLyhreKmAdQ5WZoonsErtOwVrbUcRUmul9knyCx6jvh9HikVuJFR9tLk7oMuOngQbdHn+ZK/UdlDaGbttUFKmJrV39bFK9SHWwj0kkXo7rTjQGcT+7Gb8pJMBINQyfAcmbJ+BfyWRewJlAoIOD2xOHhyeD+I/vifSfUkRRpZ+cqJYxIhjZWJ+pwWBnIV4LeqHLUYo0fa8ouETpsRN4MU762dvaWikqrrcMTyCqLFGK93xCZadTYkfS0D0hB6itO+rmivFyjAtq0ZgWYfXUxo2s= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(185117386973197); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13023025)(5005006)(8121501046)(13024025)(13018025)(13017025)(13015025)(3002001)(10201501046)(6055026); SRVR:MWHPR03MB2717; BCL:0; PCL:0; RULEID:(400006); SRVR:MWHPR03MB2717; X-Forefront-PRVS: 0035B15214 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR03MB2717; 23:8lTLZUX9xOqG7xZG1mf3PkHpKAp8O8/MCaprH85wu?= =?us-ascii?Q?IRPDO+wV8M8IXJk80c5mtoYrDVZx/TMNgQGtHB2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amDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2016 09:41:56.7808 (UTC) X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2717 X-Mailman-Approved-At: Mon, 15 Aug 2016 12:26:05 +0000 Cc: Jianwei Wang , dri-devel@lists.freedesktop.org, Meng Yi X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For DCU support 16 layers(on ls1021a) or 64 layers(on vf610), add (total_layer - 1) overlay planes. Signed-off-by: Jianwei Wang Signed-off-by: Meng Yi --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c index e50467a..3c2b6b4 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_plane.c @@ -235,8 +235,9 @@ void fsl_dcu_drm_init_planes(struct drm_device *dev) struct drm_plane *fsl_dcu_drm_primary_create_plane(struct drm_device *dev) { - struct drm_plane *primary; - int ret; + struct fsl_dcu_drm_device *fsl_dev = dev->dev_private; + struct drm_plane *primary, *overlay; + int ret, i; primary = kzalloc(sizeof(*primary), GFP_KERNEL); if (!primary) { @@ -256,5 +257,25 @@ struct drm_plane *fsl_dcu_drm_primary_create_plane(struct drm_device *dev) } drm_plane_helper_add(primary, &fsl_dcu_drm_plane_helper_funcs); + for (i = 0; i < fsl_dev->soc->total_layer - 1; i++) { + overlay = kzalloc(sizeof(struct drm_plane), GFP_KERNEL); + if (!overlay) { + DRM_DEBUG_KMS("Failed to allocate overlay plane\n"); + continue; + } + + ret = drm_universal_plane_init(dev, overlay, 1, + &fsl_dcu_drm_plane_funcs, + fsl_dcu_drm_plane_formats, + ARRAY_SIZE( + fsl_dcu_drm_plane_formats), + DRM_PLANE_TYPE_OVERLAY, NULL); + if (ret) { + kfree(overlay); + continue; + } + drm_plane_helper_add(overlay, &fsl_dcu_drm_plane_helper_funcs); + } + return primary; }