From patchwork Fri Nov 28 11:14:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ajay Kumar X-Patchwork-Id: 5402901 Return-Path: X-Original-To: patchwork-linux-samsung-soc@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 149FABEEA8 for ; Fri, 28 Nov 2014 11:20:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D68F32012B for ; Fri, 28 Nov 2014 11:20:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7DBDE2011E for ; Fri, 28 Nov 2014 11:20:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751107AbaK1LUr (ORCPT ); Fri, 28 Nov 2014 06:20:47 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:62607 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbaK1LUq (ORCPT ); Fri, 28 Nov 2014 06:20:46 -0500 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NFQ00FREY6K9D40@mailout3.samsung.com>; Fri, 28 Nov 2014 20:20:44 +0900 (KST) Received: from epcpsbgm2.samsung.com ( [172.20.52.123]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id E2.11.17016.C8A58745; Fri, 28 Nov 2014 20:20:44 +0900 (KST) X-AuditID: cbfee68d-f79296d000004278-62-54785a8c4183 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 5C.D4.09430.B8A58745; Fri, 28 Nov 2014 20:20:44 +0900 (KST) Received: from chromebld-server.sisodomain.com ([107.108.73.106]) by mmp1.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NFQ00DFCY5T8B40@mmp1.samsung.com>; Fri, 28 Nov 2014 20:20:43 +0900 (KST) From: Ajay Kumar To: dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, inki.dae@samsung.com Cc: jy0922.shim@samsung.com, jg1.han@samsung.com, seanpaul@google.com, ajaynumb@gmail.com, bhushan.r@samsung.com, prashanth.g@samsung.com, Ajay Kumar Subject: [PATCH 1/2] drm/exynos: fimd: Remove drm_dev pointer from fimd_context Date: Fri, 28 Nov 2014 16:44:00 +0530 Message-id: <1417173241-27802-1-git-send-email-ajaykumar.rs@samsung.com> X-Mailer: git-send-email 1.7.9.5 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrKLMWRmVeSWpSXmKPExsWyRsSkWrcnqiLE4PcfPosD7w+yWGx4s5DZ YtnafywW84+cY7W48vU9m8Wk+xNYLC4vvMRq8eLeRRaLGef3MVmsOryB3WLuwVwHbo+ds+6y eyzYVOpxv/s4k0ffllWMHp83yQWwRnHZpKTmZJalFunbJXBl9NzrZS14JVVx5MdxtgbGPrEu Rk4OCQETiQ2LzzBB2GISF+6tZ+ti5OIQEljKKDHvYws7TNGyA48ZQWwhgUWMEidu5UAUTWCS mHVnMlgRm4C2xLbpN1lAbBGBKomrqx6DTWIW2MIo8aRjLdgKYQF/iRef/zGD2CwCqhLr2s+z gdi8Ah4SC76+AIpzAG1TkJgzyQakV0JgEbvExKl3oOoFJL5NPsQCUSMrsekAM8RxkhIHV9xg mcAouICRYRWjaGpBckFxUnqRoV5xYm5xaV66XnJ+7iZGYGif/vesdwfj7QPWhxgFOBiVeHh/ /CsPEWJNLCuuzD3EaAq0YSKzlGhyPjCC8kriDY3NjCxMTUyNjcwtzZT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7zx5OzU55emD7l9ezPSizFGYmGWsxFxYkA9SDY 9rICAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 ctx->drm_dev is unnecessary since it can be easily accessed via ctx->manager->drm_dev, cleaning it up. Signed-off-by: Ajay Kumar --- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index e5810d1..122c851 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -159,7 +159,6 @@ struct fimd_win_data { struct fimd_context { struct exynos_drm_manager manager; struct device *dev; - struct drm_device *drm_dev; struct clk *bus_clk; struct clk *lcd_clk; void __iomem *regs; @@ -298,17 +297,17 @@ static int fimd_mgr_initialize(struct exynos_drm_manager *mgr, struct exynos_drm_private *priv; priv = drm_dev->dev_private; - mgr->drm_dev = ctx->drm_dev = drm_dev; + mgr->drm_dev = drm_dev; mgr->pipe = ctx->pipe = priv->pipe++; /* attach this sub driver to iommu mapping if supported. */ - if (is_drm_iommu_supported(ctx->drm_dev)) { + if (is_drm_iommu_supported(mgr->drm_dev)) { /* * If any channel is already active, iommu will throw * a PAGE FAULT when enabled. So clear any channel if enabled. */ fimd_clear_channel(mgr); - drm_iommu_attach_device(ctx->drm_dev, ctx->dev); + drm_iommu_attach_device(mgr->drm_dev, ctx->dev); } return 0; @@ -319,8 +318,8 @@ static void fimd_mgr_remove(struct exynos_drm_manager *mgr) struct fimd_context *ctx = mgr_to_fimd(mgr); /* detach this sub driver from iommu mapping if supported. */ - if (is_drm_iommu_supported(ctx->drm_dev)) - drm_iommu_detach_device(ctx->drm_dev, ctx->dev); + if (is_drm_iommu_supported(mgr->drm_dev)) + drm_iommu_detach_device(mgr->drm_dev, ctx->dev); } static u32 fimd_calc_clkdiv(struct fimd_context *ctx, @@ -1001,7 +1000,7 @@ static void fimd_te_handler(struct exynos_drm_manager *mgr) struct fimd_context *ctx = mgr_to_fimd(mgr); /* Checks the crtc is detached already from encoder */ - if (ctx->pipe < 0 || !ctx->drm_dev) + if (ctx->pipe < 0 || !mgr->drm_dev) return; /* @@ -1018,7 +1017,7 @@ static void fimd_te_handler(struct exynos_drm_manager *mgr) } if (test_bit(0, &ctx->irq_flags)) - drm_handle_vblank(ctx->drm_dev, ctx->pipe); + drm_handle_vblank(mgr->drm_dev, ctx->pipe); } static struct exynos_drm_manager_ops fimd_manager_ops = { @@ -1047,17 +1046,19 @@ static irqreturn_t fimd_irq_handler(int irq, void *dev_id) writel(clear_bit, ctx->regs + VIDINTCON1); /* check the crtc is detached already from encoder */ - if (ctx->pipe < 0 || !ctx->drm_dev) + if (ctx->pipe < 0 || !ctx->manager.drm_dev) goto out; if (ctx->i80_if) { - exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); + exynos_drm_crtc_finish_pageflip(ctx->manager.drm_dev, + ctx->pipe); /* Exits triggering mode */ atomic_set(&ctx->triggering, 0); } else { - drm_handle_vblank(ctx->drm_dev, ctx->pipe); - exynos_drm_crtc_finish_pageflip(ctx->drm_dev, ctx->pipe); + drm_handle_vblank(ctx->manager.drm_dev, ctx->pipe); + exynos_drm_crtc_finish_pageflip(ctx->manager.drm_dev, + ctx->pipe); /* set wait vsync event to zero and wake up queue. */ if (atomic_read(&ctx->wait_vsync_event)) {