From patchwork Mon Apr 14 06:09:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Inki Dae X-Patchwork-Id: 3976551 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 B64A69F336 for ; Mon, 14 Apr 2014 06:10:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AEDA7201B4 for ; Mon, 14 Apr 2014 06:10:05 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8C5CA201DC for ; Mon, 14 Apr 2014 06:10:04 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C3936E6E7; Sun, 13 Apr 2014 23:10:02 -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 5CC1F6E6E1 for ; Sun, 13 Apr 2014 23:09:59 -0700 (PDT) Received: from epcpsbgr2.samsung.com (u142.gpu120.samsung.co.kr [203.254.230.142]) by mailout1.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0N4000G4TBSMAP60@mailout1.samsung.com> for dri-devel@lists.freedesktop.org; Mon, 14 Apr 2014 15:09:58 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.113]) by epcpsbgr2.samsung.com (EPCPMTA) with SMTP id 36.40.09028.6BB7B435; Mon, 14 Apr 2014 15:09:58 +0900 (KST) X-AuditID: cbfee68e-b7f566d000002344-bc-534b7bb64070 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 4D.A1.28157.6BB7B435; Mon, 14 Apr 2014 15:09:58 +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 <0N400097VBSIQI40@mmp2.samsung.com>; Mon, 14 Apr 2014 15:09:57 +0900 (KST) From: Inki Dae To: airlied@linux.ie, dri-devel@lists.freedesktop.org Subject: [PATCH v2 7/9] drm/exynos: separate dpi from fimd Date: Mon, 14 Apr 2014 15:09:52 +0900 Message-id: <1397455794-7759-8-git-send-email-inki.dae@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1397455794-7759-1-git-send-email-inki.dae@samsung.com> References: <1397455794-7759-1-git-send-email-inki.dae@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWyRsSkUHdbtXewwbuLEha31p1jteg9d5LJ Yv4RIOvK1/dsFv1vFrJanHu1ktFi0v0JLBYv7l1ksehdcJXN4mzTG3aLGef3MVksvX6RyWLC 9LUsFq17j7Bb3N1wltFixuSXbA4CHmvmrWH0mN1wkcXjcl8vk8fK5V/YPDat6mTz2P7tAavH /e7jTB59W1YxenzeJBfAGcVlk5Kak1mWWqRvl8CV0Xn5GnPBa9uKo3e62RoYJxt3MXJySAiY SExctJAdwhaTuHBvPVsXIxeHkMBSRonJW9vZYYoePXnJAmILCUxnlJj4WRWiqJtJYs+SL4wg CTYBVYmJK+6zgdgiAqYSHZOWsoAUMQs8ZJJYseIuWJGwgJVE955ZYFNZgBomP3sEFucVcJZ4 smI1UxcjB9A2BYk5k2xAwpwCLhItG06xg4SFgEomXS8GGSkh8Jdd4tr/V1BjBCS+TT7EAtEq K7HpADPEzZISB1fcYJnAKLyAkWEVo2hqQXJBcVJ6kZFecWJucWleul5yfu4mRmCcnf73rG8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rFQxrPrhd68/ZJe+5T50MHQvXdqm7+fm+nN 9jmGadZWlTkhG5nsc19u4Ch6qLgs4vyGC9OVnnq2TrB9n5Uovm/hKpFKSfWjR7dbKUTtXfT9 2oRZXGpnQoNuPVzJfTx253zBy9vnF+pPe52+5BWH8I99D4X2MRVXa05+/zCScWkuw/NpzEos xRmJhlrMRcWJAMn9eGcmAwAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Cc: mark.rutland@arm.com, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, pawel.moll@arm.com, ijc+devicetree@hellion.org.uk, sw0312.kim@samsung.com, a.hajda@samsung.com, kyungmin.park@samsung.com, robh+dt@kernel.org, galak@codeaurora.org, kgene.kim@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=-5.2 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 a589dfb..257ce09 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 b26b27e..dd8637b 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -24,7 +24,6 @@ #include