From patchwork Wed Nov 26 21:09:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 5388001 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 66CCBC11AC for ; Wed, 26 Nov 2014 21:09:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63914201FB for ; Wed, 26 Nov 2014 21:09:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id C4C12201C7 for ; Wed, 26 Nov 2014 21:09:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EA61E6E18B; Wed, 26 Nov 2014 13:09:28 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f42.google.com (mail-qg0-f42.google.com [209.85.192.42]) by gabe.freedesktop.org (Postfix) with ESMTP id 06B0F6E18B for ; Wed, 26 Nov 2014 13:09:28 -0800 (PST) Received: by mail-qg0-f42.google.com with SMTP id z107so2717107qgd.1 for ; Wed, 26 Nov 2014 13:09:27 -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=xAmlwvuSAL93ZxOXFkccf5S2yDUZw2y4F0cmF8APNkM=; b=Z8048gLE7i89RdHnzp9VgZ/Tzjby75QHUk9giLcZoBW7r28kBOdtSwemS3acXH4tdB JmogG+NFMYBnbSXjDZePO48mnDBQJZQOjebasjwadxJa/y5NFqnX4eLoXZrBjfFeMN3J DZLklUd/ulAX9+8wJbIvbVkIsHoVWw9hQzoWnurbs1tGnJEiZj1vzZa/mkn64GzaroFF nkW1JG1gAhmLqrUxIbcuKmuzeubeO+pwioQmCLwR1XxEy/YxV0KEaO9mU3UlwVX3dKl6 UgcPILkJhnhvsncNrJXvQBu6B2rGeh6DGP7SSAwz/3nz80e3FQLw0FEcdEkmM2qtNXOs wRmA== X-Received: by 10.224.13.145 with SMTP id c17mr49060830qaa.96.1417036167569; Wed, 26 Nov 2014 13:09:27 -0800 (PST) Received: from localhost.localdomain ([191.8.93.69]) by mx.google.com with ESMTPSA id n5sm4910678qat.13.2014.11.26.13.09.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 26 Nov 2014 13:09:26 -0800 (PST) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Subject: [PATCH 4/6] drm/exynos: move 'type' from manager to crtc struct Date: Wed, 26 Nov 2014 19:09:03 -0200 Message-Id: <1417036145-11017-5-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 'type' is now part of the struct exynos_drm_crtc. This is just another step in the struct exynos_drm_manager removal. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_crtc.c | 6 ++++-- drivers/gpu/drm/exynos/exynos_drm_crtc.h | 3 ++- drivers/gpu/drm/exynos/exynos_drm_drv.h | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 6 +++--- drivers/gpu/drm/exynos/exynos_drm_vidi.c | 6 +++--- drivers/gpu/drm/exynos/exynos_mixer.c | 6 +++--- 6 files changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.c b/drivers/gpu/drm/exynos/exynos_drm_crtc.c index 0fe981b..224b9af 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_crtc.c +++ b/drivers/gpu/drm/exynos/exynos_drm_crtc.c @@ -299,7 +299,8 @@ 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, int pipe, + enum exynos_drm_output_type type) { struct exynos_drm_crtc *exynos_crtc; struct drm_plane *plane; @@ -317,6 +318,7 @@ int exynos_drm_crtc_create(struct exynos_drm_manager *manager, int pipe) exynos_crtc->dpms = DRM_MODE_DPMS_OFF; exynos_crtc->manager = manager; exynos_crtc->pipe = pipe; + exynos_crtc->type = type; plane = exynos_plane_init(manager->drm_dev, 1 << pipe, DRM_PLANE_TYPE_PRIMARY); if (IS_ERR(plane)) { @@ -435,7 +437,7 @@ int exynos_drm_crtc_get_pipe_from_type(struct drm_device *drm_dev, struct exynos_drm_crtc *exynos_crtc; exynos_crtc = to_exynos_crtc(crtc); - if (exynos_crtc->manager->type == out_type) + if (exynos_crtc->type == out_type) return exynos_crtc->pipe; } diff --git a/drivers/gpu/drm/exynos/exynos_drm_crtc.h b/drivers/gpu/drm/exynos/exynos_drm_crtc.h index f1bee84..a705941 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, 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); void exynos_drm_crtc_finish_pageflip(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 1d024c0..a3ae95f 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.h +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h @@ -204,7 +204,6 @@ struct exynos_drm_manager_ops { * Exynos drm common manager structure, maps 1:1 with a crtc * * @list: the list entry for this manager - * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. * @drm_dev: pointer to the drm device * @crtc: crtc object. * @ops: pointer to callbacks for exynos drm specific functionality @@ -212,7 +211,6 @@ struct exynos_drm_manager_ops { */ struct exynos_drm_manager { struct list_head list; - enum exynos_drm_output_type type; struct drm_device *drm_dev; struct drm_crtc *crtc; struct exynos_drm_manager_ops *ops; @@ -228,6 +226,7 @@ enum exynos_crtc_mode { * * @base: crtc object. * @manager: the manager associated with this crtc + * @type: one of EXYNOS_DISPLAY_TYPE_LCD and HDMI. * @pipe: a crtc index created at load() with a new crtc object creation * and the crtc object would be set to private->crtc array * to get a crtc object corresponding to this pipe from private->crtc @@ -241,6 +240,7 @@ enum exynos_crtc_mode { struct exynos_drm_crtc { struct drm_crtc base; struct exynos_drm_manager *manager; + enum exynos_drm_output_type type; unsigned int pipe; unsigned int dpms; enum exynos_crtc_mode mode; diff --git a/drivers/gpu/drm/exynos/exynos_drm_fimd.c b/drivers/gpu/drm/exynos/exynos_drm_fimd.c index 6e2092d..55154a6 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_fimd.c +++ b/drivers/gpu/drm/exynos/exynos_drm_fimd.c @@ -1102,7 +1102,8 @@ 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, ctx->pipe, + EXYNOS_DISPLAY_TYPE_LCD); if (ctx->display) exynos_drm_create_enc_conn(drm_dev, ctx->display); @@ -1143,11 +1144,10 @@ static int fimd_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - ctx->manager.type = EXYNOS_DISPLAY_TYPE_LCD; ctx->manager.ops = &fimd_manager_ops; ret = exynos_drm_component_add(dev, EXYNOS_DEVICE_TYPE_CRTC, - ctx->manager.type); + EXYNOS_DISPLAY_TYPE_LCD); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos_drm_vidi.c b/drivers/gpu/drm/exynos/exynos_drm_vidi.c index 785d2fe..3cee0fd 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_vidi.c +++ b/drivers/gpu/drm/exynos/exynos_drm_vidi.c @@ -558,7 +558,8 @@ 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, ctx->pipe, + EXYNOS_DISPLAY_TYPE_VIDI); if (ret) { DRM_ERROR("failed to create crtc.\n"); return ret; @@ -593,7 +594,6 @@ static int vidi_probe(struct platform_device *pdev) if (!ctx) return -ENOMEM; - ctx->manager.type = EXYNOS_DISPLAY_TYPE_VIDI; ctx->manager.ops = &vidi_manager_ops; ctx->display.type = EXYNOS_DISPLAY_TYPE_VIDI; ctx->display.ops = &vidi_display_ops; @@ -601,7 +601,7 @@ static int vidi_probe(struct platform_device *pdev) ctx->pdev = pdev; ret = exynos_drm_component_add(&pdev->dev, EXYNOS_DEVICE_TYPE_CRTC, - ctx->manager.type); + EXYNOS_DISPLAY_TYPE_VIDI); if (ret) return ret; diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c index 8301503..1167099 100644 --- a/drivers/gpu/drm/exynos/exynos_mixer.c +++ b/drivers/gpu/drm/exynos/exynos_mixer.c @@ -1256,7 +1256,8 @@ 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, ctx->pipe, + EXYNOS_DISPLAY_TYPE_HDMI); if (ret) { mixer_mgr_remove(&ctx->manager); return ret; @@ -1296,7 +1297,6 @@ static int mixer_probe(struct platform_device *pdev) mutex_init(&ctx->mixer_mutex); - ctx->manager.type = EXYNOS_DISPLAY_TYPE_HDMI; ctx->manager.ops = &mixer_manager_ops; if (dev->of_node) { @@ -1320,7 +1320,7 @@ static int mixer_probe(struct platform_device *pdev) platform_set_drvdata(pdev, ctx); ret = exynos_drm_component_add(&pdev->dev, EXYNOS_DEVICE_TYPE_CRTC, - ctx->manager.type); + EXYNOS_DISPLAY_TYPE_HDMI); if (ret) return ret;