From patchwork Thu Apr 17 05:50:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 4005751 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CE013BFF02 for ; Thu, 17 Apr 2014 05:50:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D1B452034F for ; Thu, 17 Apr 2014 05:50:54 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C063620351 for ; Thu, 17 Apr 2014 05:50:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F37C96EAFB; Wed, 16 Apr 2014 22:50:51 -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 41EE86EAFB for ; Wed, 16 Apr 2014 22:50:47 -0700 (PDT) Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4500F1PUW89730@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Thu, 17 Apr 2014 14:50:32 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.115]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 9D.31.12635.8AB6F435; Thu, 17 Apr 2014 14:50:32 +0900 (KST) X-AuditID: cbfee68d-b7fcd6d00000315b-5f-534f6ba86830 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id C7.AC.28157.8AB6F435; Thu, 17 Apr 2014 14:50:32 +0900 (KST) Received: from daeinki-desktop.10.32.193.11 ([10.252.83.67]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0N4500C1SUW6AQ10@mmp2.samsung.com>; Thu, 17 Apr 2014 14:50:32 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH 5/5] drm/exynos: separate dpi from fimd Date: Thu, 17 Apr 2014 14:50:29 +0900 Message-id: <1397713829-25776-6-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1397713829-25776-1-git-send-email-inki.dae@samsung.com> References: <1397713829-25776-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrLLMWRmVeSWpSXmKPExsWyRsSkWHdFtn+wwdW7Oha31p1jteg9d5LJ 4srX92wWk+5PYLF4ce8ii8XZpjfsFjPO72OyuLvhLKPFjMkv2Rw4PWY3XGTx2P7tAavH/e7j TB59W1YxenzeJBfAGsVlk5Kak1mWWqRvl8CV8Wz3NKaC17YVE1ZXNDBONu5i5OSQEDCRmDVv DhuELSZx4d56MFtIYCmjxM7vjDA1+z98Ze5i5AKKT2eUeDJxPpTTzSRx78wXVpAqNgFViYkr 7oN1iwiYSnRMWsoCUsQscIhRYt2tr2AJYQFzia6d18FsFqCG81tvMIHYvAIuErNnPQeyOYDW KUjMmWQDEuYUcJXYtWsjG0hYCKikfWIhxEGr2CVOz7GDmCIg8W3yIRaITlmJTQeYIUokJQ6u uMEygVF4ASPDKkbR1ILkguKk9CJDveLE3OLSvHS95PzcTYzAoD/971nvDsbbB6wPMSYDjZvI LCWanA+MmrySeENjMyMLUxNTYyNzSzPShJXEeZMeJgUJCaQnlqRmp6YWpBbFF5XmpBYfYmTi 4JRq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SnJFoqMVc VJwIAH0+P5bvAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: linux-samsung-soc@vger.kernel.org, sw0312.kim@samsung.com, 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.9 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 From: Andrzej Hajda The patch separates dpi related routines from fimd. Changelog v2: - Rename ctx->dpi to ctx->display Signed-off-by: Andrzej Hajda Signed-off-by: Inki Dae --- drivers/gpu/drm/exynos/exynos_drm_dpi.c | 40 +++++------ drivers/gpu/drm/exynos/exynos_drm_drv.h | 15 ++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 109 ++++++++++++------------------ 3 files changed, 69 insertions(+), 95 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_dpi.c b/drivers/gpu/drm/exynos/exynos_drm_dpi.c index ac206e7..03cb126 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_dpi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_dpi.c @@ -40,20 +40,10 @@ exynos_dpi_detect(struct drm_connector *connector, bool force) { struct exynos_dpi *ctx = connector_to_dpi(connector); - /* panels supported only by boot-loader are always connected */ - if (!ctx->panel_node) - return connector_status_connected; - - if (!ctx->panel) { - ctx->panel = of_drm_find_panel(ctx->panel_node); - if (ctx->panel) - drm_panel_attach(ctx->panel, &ctx->connector); - } + if (!ctx->panel->connector) + drm_panel_attach(ctx->panel, &ctx->connector); - if (ctx->panel) - return connector_status_connected; - - return connector_status_disconnected; + return connector_status_connected; } static void exynos_dpi_connector_destroy(struct drm_connector *connector) @@ -291,8 +281,10 @@ static int exynos_dpi_parse_dt(struct exynos_dpi *ctx) return -ENOMEM; ret = of_get_videomode(dn, vm, 0); - if (ret < 0) + if (ret < 0) { + devm_kfree(dev, vm); return ret; + } ctx->vm = vm; @@ -305,27 +297,35 @@ static int exynos_dpi_parse_dt(struct exynos_dpi *ctx) return 0; } -int exynos_dpi_probe(struct drm_device *drm_dev, struct device *dev) +struct exynos_drm_display *exynos_dpi_probe(struct device *dev) { struct exynos_dpi *ctx; int ret; ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL); if (!ctx) - return -ENOMEM; + return NULL; ctx->dev = dev; exynos_dpi_display.ctx = ctx; ctx->dpms_mode = DRM_MODE_DPMS_OFF; ret = exynos_dpi_parse_dt(ctx); - if (ret < 0) - return ret; + if (ret < 0) { + devm_kfree(dev, ctx); + return NULL; + } + + if (ctx->panel_node) { + ctx->panel = of_drm_find_panel(ctx->panel_node); + if (!ctx->panel) + return ERR_PTR(-EPROBE_DEFER); + } - return exynos_drm_create_enc_conn(drm_dev, &exynos_dpi_display); + return &exynos_dpi_display; } -int exynos_dpi_remove(struct drm_device *drm_dev, struct device *dev) +int exynos_dpi_remove(struct device *dev) { struct drm_encoder *encoder = exynos_dpi_display.encoder; struct exynos_dpi *ctx = exynos_dpi_display.ctx; diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index 3aee01b..d955f60 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -334,17 +334,12 @@ int exynos_platform_device_ipp_register(void); void exynos_platform_device_ipp_unregister(void); #ifdef CONFIG_DRM_EXYNOS_DPI -int exynos_dpi_probe(struct drm_device *drm_dev, struct device *dev); -int exynos_dpi_remove(struct drm_device *drm_dev, struct device *dev); -struct device_node *exynos_dpi_of_find_panel_node(struct device *dev); +struct exynos_drm_display * exynos_dpi_probe(struct device *dev); +int exynos_dpi_remove(struct device *dev); #else -static inline int exynos_dpi_probe(struct drm_device *drm_dev, - struct device *dev) { return 0; } -static inline int exynos_dpi_remove(struct drm_device *drm_dev, - struct device *dev) { return 0; } -static inline struct device_node - *exynos_dpi_of_find_panel_node(struct device *dev) -{ return NULL; } +static inline struct exynos_drm_display * +exynos_dpi_probe(struct device *dev) { return 0; } +static inline int exynos_dpi_remove(struct device *dev) { return 0; } #endif /* diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index bab870c..a6d6386 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -24,7 +24,6 @@ #include