From patchwork Wed Nov 26 21:09:04 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 5388011 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 805A7C11AC for ; Wed, 26 Nov 2014 21:09:34 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6DC5D201C8 for ; Wed, 26 Nov 2014 21:09:33 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 6DE7E201C7 for ; Wed, 26 Nov 2014 21:09:32 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BD7CF6E205; Wed, 26 Nov 2014 13:09:31 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qc0-f178.google.com (mail-qc0-f178.google.com [209.85.216.178]) by gabe.freedesktop.org (Postfix) with ESMTP id 3DD5A6E205 for ; Wed, 26 Nov 2014 13:09:31 -0800 (PST) Received: by mail-qc0-f178.google.com with SMTP id b13so2974612qcw.37 for ; Wed, 26 Nov 2014 13:09:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=OO9nn7zh3lXiuwBxgFd7qRTRf+yax/BpaLD3g3mY118=; b=Us66y1CeHHusYyQUxwcM+yGNPOJ0HREHYk4zSa0cMFVdaf3actzEyqZdSSJoxm1gv8 VbEcqf9Urzajz5cFO2nXHMvWfy2TRYiAPUXg9swU6M8VS9QGKy6fkIiidavOsL8QBMbx 8RMCb0gO5aWSmkaL6krbzO10z3vXO6Hi0mEvD+tFckYzhbIN09NqU/AsuRkT/g/z9kng woQu/sFIMXdcH/8TOcGJr7jLhqnZDZraOeTQv5vcAxm4Y4ABAQ5JARV+N2jMmG94qBkB XiTlyj3/kAtOWwrby7bz8/L0tNQKAs+nb8b6VUDK6pZZkBDR2TsE7Azvvn/+RenKhRjm wWrQ== X-Received: by 10.224.51.131 with SMTP id d3mr27913594qag.94.1417036170844; Wed, 26 Nov 2014 13:09:30 -0800 (PST) Received: from localhost.localdomain ([191.8.93.69]) by mx.google.com with ESMTPSA id n5sm4910678qat.13.2014.11.26.13.09.27 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Nov 2014 13:09:30 -0800 (PST) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 5/6] drm/exynos: remove drm_dev from struct exynos_drm_manager Date: Wed, 26 Nov 2014 19:09:04 -0200 Message-Id: <1417036145-11017-6-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 1.9.3 In-Reply-To: <1417036145-11017-1-git-send-email-gustavo@padovan.org> References: <1417036145-11017-1-git-send-email-gustavo@padovan.org> Cc: Gustavo Padovan , dri-devel@lists.freedesktop.org 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: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, 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 From: Gustavo Padovan manager-drm_dev is only accessed by exynos_drm_crtc_create() so this patch pass drm_dev as argument on exynos_drm_crtc_create() and remove it from struct exynos_drm_manager. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 9 +++++---- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 3 ++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 1 - drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 4 ++-- drivers/gpu/drm/exynos/exynos_mixer.c | 4 ++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 224b9af..1eb5750 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -299,12 +299,13 @@ static void exynos_drm_crtc_attach_mode_property(struct drm_crtc *crtc) drm_object_attach_property(&crtc->base, prop, 0); } -int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, +int exynos_drm_crtc_create(struct exynos_drm_manager *manager, + struct drm_device *drm_dev, int pipe, enum exynos_drm_output_type type) { struct exynos_drm_crtc *exynos_crtc; struct drm_plane *plane; - struct exynos_drm_private *private = manager->drm_dev->dev_private; + struct exynos_drm_private *private = drm_dev->dev_private; struct drm_crtc *crtc; int ret; @@ -319,7 +320,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, exynos_crtc->manager = manager; exynos_crtc->pipe = pipe; exynos_crtc->type = type; - plane = exynos_plane_init(manager->drm_dev, 1 << pipe, + plane = exynos_plane_init(drm_dev, 1 << pipe, DRM_PLANE_TYPE_PRIMARY); if (IS_ERR(plane)) { ret = PTR_ERR(plane); @@ -331,7 +332,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, private->crtc[pipe] = crtc; - ret = drm_crtc_init_with_planes(manager->drm_dev, crtc, plane, NULL, + ret = drm_crtc_init_with_planes(drm_dev, crtc, plane, NULL, &exynos_crtc_funcs); if (ret < 0) goto err_crtc; diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h index a705941..d7690e9 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.h +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.h @@ -17,7 +17,8 @@ #include "exynos_drm_drv.h" -int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe, +int exynos_drm_crtc_create(struct exynos_drm_manager *manager, + struct drm_device *drm_dev, int pipe, enum exynos_drm_output_type type); int exynos_drm_crtc_enable_vblank(struct drm_device *dev, int pipe); void exynos_drm_crtc_disable_vblank(struct drm_device *dev, int pipe); diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h index a3ae95f..2d801a8 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -211,7 +211,6 @@ struct exynos_drm_manager_ops { */ struct exynos_drm_manager { struct list_head list; - struct drm_device *drm_dev; struct drm_crtc *crtc; struct exynos_drm_manager_ops *ops; }; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 55154a6..3713be7 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -299,7 +299,7 @@ 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; + ctx->drm_dev = drm_dev; ctx->pipe = priv->pipe++; /* attach this sub driver to iommu mapping if supported. */ @@ -1102,7 +1102,7 @@ static int fimd_bind(struct device *dev, struct device *master, void *data) struct drm_device *drm_dev = data; fimd_mgr_initialize(&ctx->manager, drm_dev); - exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + exynos_drm_crtc_create(&ctx->manager, drm_dev, ctx->pipe, EXYNOS_DISPLAY_TYPE_LCD); if (ctx->display) exynos_drm_create_enc_conn(drm_dev, ctx->display); diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 3cee0fd..03687db 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -301,7 +301,7 @@ static int vidi_mgr_initialize(struct exynos_drm_manager *mgr, struct vidi_context *ctx = manager_to_vidi(mgr); struct exynos_drm_private *priv = drm_dev->dev_private; - mgr->drm_dev = ctx->drm_dev = drm_dev; + ctx->drm_dev = drm_dev; ctx->pipe = priv->pipe++; return 0; @@ -558,7 +558,7 @@ static int vidi_bind(struct device *dev, struct device *master, void *data) vidi_mgr_initialize(&ctx->manager, drm_dev); - ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + ret = exynos_drm_crtc_create(&ctx->manager, drm_dev, ctx->pipe, EXYNOS_DISPLAY_TYPE_VIDI); if (ret) { DRM_ERROR("failed to create crtc.\n"); diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 1167099..d8f2b6d 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -862,7 +862,7 @@ static int mixer_initialize(struct exynos_drm_manager *mgr, struct exynos_drm_private *priv; priv = drm_dev->dev_private; - mgr->drm_dev = mixer_ctx->drm_dev = drm_dev; + mixer_ctx->drm_dev = drm_dev; mixer_ctx->pipe = priv->pipe++; /* acquire resources: regs, irqs, clocks */ @@ -1256,7 +1256,7 @@ static int mixer_bind(struct device *dev, struct device *manager, void *data) if (ret) return ret; - ret = exynos_drm_crtc_create(&ctx->manager, ctx->pipe, + ret = exynos_drm_crtc_create(&ctx->manager, drm_dev, ctx->pipe, EXYNOS_DISPLAY_TYPE_HDMI); if (ret) { mixer_mgr_remove(&ctx->manager);