From patchwork Thu Apr 3 11:47:17 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 3932481 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 61CE79F2F7 for ; Thu, 3 Apr 2014 11:47:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E742202E5 for ; Thu, 3 Apr 2014 11:47:28 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7AF8720220 for ; Thu, 3 Apr 2014 11:47:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4F9586E91C; Thu, 3 Apr 2014 04:47:23 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by gabe.freedesktop.org (Postfix) with ESMTP id B7E386E91B for ; Thu, 3 Apr 2014 04:47:20 -0700 (PDT) Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N3G00IA0E2UV880@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 03 Apr 2014 20:47:18 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.116]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id 57.64.10364.54A4D335; Thu, 03 Apr 2014 20:47:18 +0900 (KST) X-AuditID: cbfee690-b7f266d00000287c-1c-533d4a45b274 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 27.5B.28157.54A4D335; Thu, 03 Apr 2014 20:47:17 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.75.62]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N3G006AIE2T6Y90@mmp2.samsung.com>; Thu, 03 Apr 2014 20:47:17 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v4] drm/exynos: add super device support Date: Thu, 03 Apr 2014 20:47:17 +0900 Message-id: <1396525637-3745-1-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1396514191-13054-1-git-send-email-inki.dae@samsung.com> References: <1396514191-13054-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrBLMWRmVeSWpSXmKPExsWyRsSkRNfNyzbYYNZHRotb686xWvSeO8lk ceXrezaLSfcnsFicbXrDbnF3w1lGBzaP2Q0XWTy2f3vA6nG/+ziTR9+WVYwBLFFcNimpOZll qUX6dglcGW8/JBcc7WGuWHX0C2MD46STTF2MnBwSAiYSy5+uZIGwxSQu3FvPBmILCSxllPhx RhquZvUWoHouoPh0Rom9TWtYIZxuJol5d6cyglSxCahKTFxxH6xbRMBUomPSUqCpHBzMAjkS Vzfwg5jCAhYSH14KglSwAFVfXLsGrIJXwFni6U8lEFNCQEFiziQbkApOAVeJ2cvbmCGucZHY 83kJM0RJP7tEjzzEEAGJb5MPsUCEZSU2HWCGuFdS4uCKGywTGIUXMDKsYhRNLUguKE5KLzLR K07MLS7NS9dLzs/dxAgM5dP/nk3YwXjvgPUhxmSgcROZpUST84GxkFcSb2hsZmRhamJqbGRu aUaasJI4r9qjpCAhgfTEktTs1NSC1KL4otKc1OJDjEwcnFINjHY5QtvdK3+sTz14Rddoe36M nmxKxuwZdrmf86t/i4u+bi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Reflected Cc: a.hajda@samsung.com, kyungmin.park@samsung.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This patch adds super device support to bind sub drivers using device tree. For this, you should add a super device node to each machine dt files like belows, In case of using MIPI-DSI, display-subsystem { compatible = "samsung,exynos-display-subsystem"; ports = <&fimd>, <&dsi>; }; In case of using DisplayPort, display-subsystem { compatible = "samsung,exynos-display-subsystem"; ports = <&fimd>, <&dp>; }; In case of using Parallel panel, display-subsystem { compatible = "samsung,exynos-display-subsystem"; ports = <&fimd>; }; And if you don't add connector device node to ports property, default parallel panel driver, exynos_drm_dpi module, will be used. ports property can have the following device nodes, fimd, mixer, Image Enhancer, MIPI-DSI, eDP, LVDS Bridge, or HDMI With this patch, we can resolve the probing order issue without some global lists. So this patch also removes the unnecessary lists and stuff related to these lists. Previous RFC patch, http://www.spinics.net/lists/dri-devel/msg54671.html Changelog since RFC patch: - Register sub drivers and probe them at load(). In case of non sub drivers, sub driver probe is needed. - Enable runtime pm at fimd_probe() instead of fimd_bind(). runtime pm should be enabled before iommu device is attached to fimd device. - Do not return an error with component_master_add fail. - Remove super device support from mipi dsi driver which was in RFC. - Add super device support to parallel driver. Changelog v2: - Add super device support to mipi dsi driver. - Bind fimd driver only in case that a drm_panel for parallel panel driver is added to panel_list of drm_panel module. - Change super node name to 'display-subsystem' . 'exynos-drm' is specific to Linux so change it to generic name. - Change propery name of super node to 'ports' . crtcs and connectors propery names are also specific to Linux so change them to generic name. Changlog v3: - Do not probe/remove dpi module if fimd node has no port node. Changelog v4: - Move some codes for getting resources from each bind function to each probe function. . if -EPROBE_DEFER is returned at bind context, components will be bound and unbound repeatedly by deferred probe feature. Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_dp_core.c | 45 ++++--- drivers/gpu/drm/exynos/exynos_drm_core.c | 216 +++++------------------------- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 17 +++ drivers/gpu/drm/exynos/exynos_drm_crtc.h | 4 + drivers/gpu/drm/exynos/exynos_drm_dpi.c | 16 ++- drivers/gpu/drm/exynos/exynos_drm_drv.c | 202 +++++++++++++++------------- drivers/gpu/drm/exynos/exynos_drm_drv.h | 73 +++++----- drivers/gpu/drm/exynos/exynos_drm_dsi.c | 110 +++++++++------ drivers/gpu/drm/exynos/exynos_drm_fimd.c | 87 +++++++++--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 61 +++++++-- drivers/gpu/drm/exynos/exynos_hdmi.c | 59 +++++--- drivers/gpu/drm/exynos/exynos_mixer.c | 54 ++++++-- 12 files changed, 499 insertions(+), 445 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_dp_core.c b/drivers/gpu/drm/exynos/exynos_dp_core.c index a59bca9..cb9aa58 100644 --- a/drivers/gpu/drm/exynos/exynos_dp_core.c +++ b/drivers/gpu/drm/exynos/exynos_dp_core.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include