From patchwork Thu Aug 6 13:31:47 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 6958701 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CA4CDC05AC for ; Thu, 6 Aug 2015 13:31:58 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BDCE3206F6 for ; Thu, 6 Aug 2015 13:31:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C99D1206F1 for ; Thu, 6 Aug 2015 13:31:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752796AbbHFNbz (ORCPT ); Thu, 6 Aug 2015 09:31:55 -0400 Received: from mail-yk0-f182.google.com ([209.85.160.182]:34480 "EHLO mail-yk0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750968AbbHFNby (ORCPT ); Thu, 6 Aug 2015 09:31:54 -0400 Received: by ykax123 with SMTP id x123so62331244yka.1 for ; Thu, 06 Aug 2015 06:31:54 -0700 (PDT) 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=vNW8Q6letKhG7FMWWUZ2LGHHjW/XqvLtOj2Dvh0U1OU=; b=dQKXcWmjfYFwTy5M3G8tsweBeht3gOI4cLeGw8Msu3j+V0MVUI9BJY3lDlzxtFTnvt BzYFr1YQdkzFI5wwxtTGfFKZudzWFqbhwl34DxxY/cm5AeQV+1KnL5Eah8iVGUL/d5nS UkAHXb046oN6dO9UTRmUKS/pu7ITF7dXC89H0JQJngx96l27m5I7AB+vNZhLt/wL4xrJ KGj1rYh0cXl9+O5DzGJQwO5kRgoA+qdR/8aQvsxMkGXs47xNSX7FuBTw16iSyFvAee56 XP0V+Z3EIVIyE2CN2rCgmrAseuI02WbzOzA+4d8cuHSBqKejEH3M5EQg1EGC0y3tU1qW 3jOw== X-Received: by 10.13.225.74 with SMTP id k71mr1438921ywe.137.1438867914130; Thu, 06 Aug 2015 06:31:54 -0700 (PDT) Received: from jade.localdomain ([187.64.235.140]) by smtp.gmail.com with ESMTPSA id y203sm2335071ywy.23.2015.08.06.06.31.52 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 06 Aug 2015 06:31:53 -0700 (PDT) From: Gustavo Padovan To: linux-samsung-soc@vger.kernel.org Cc: dri-devel@lists.freedesktop.org, inki.dae@samsung.com, jy0922.shim@samsung.com, tjakobi@math.uni-bielefeld.de, Gustavo Padovan Subject: [PATCH v2 10/11] drm/exynos: fold encoder setup into exynos_drm_load() Date: Thu, 6 Aug 2015 10:31:47 -0300 Message-Id: <1438867908-18975-1-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1438817060-22164-10-git-send-email-gustavo@padovan.org> References: <1438817060-22164-10-git-send-email-gustavo@padovan.org> 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=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 As we are removing the exynos encoder move the encoder setup operation directly inside the exynos_drm_load() Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_drv.c | 12 ++++++++++-- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 13 ------------- drivers/gpu/drm/exynos/exynos_drm_encoder.h | 1 - 3 files changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c index f1d6966..105f10e 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_drv.c +++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c @@ -41,7 +41,9 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) { struct exynos_drm_private *private; - int ret; + struct drm_encoder *encoder; + unsigned int clone_mask; + int cnt, ret; private = kzalloc(sizeof(struct exynos_drm_private), GFP_KERNEL); if (!private) @@ -67,7 +69,13 @@ static int exynos_drm_load(struct drm_device *dev, unsigned long flags) exynos_drm_mode_config_init(dev); /* setup possible_clones. */ - exynos_drm_encoder_setup(dev); + cnt = 0; + clone_mask = 0; + list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) + clone_mask |= (1 << (cnt++)); + + list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) + encoder->possible_clones = clone_mask; platform_set_drvdata(dev->platformdev, dev); diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 4ed360b..d45a5c5 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -78,19 +78,6 @@ static struct drm_encoder_funcs exynos_encoder_funcs = { .destroy = drm_encoder_cleanup, }; -void exynos_drm_encoder_setup(struct drm_device *dev) -{ - struct drm_encoder *encoder; - unsigned int clone_mask = 0; - int cnt = 0; - - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) - clone_mask |= (1 << (cnt++)); - - list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) - encoder->possible_clones = clone_mask; -} - int exynos_drm_encoder_create(struct drm_device *dev, struct exynos_drm_encoder *exynos_encoder, enum exynos_drm_output_type type) diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.h b/drivers/gpu/drm/exynos/exynos_drm_encoder.h index e998b82..6610dee 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.h +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.h @@ -16,7 +16,6 @@ #include "exynos_drm_drv.h" -void exynos_drm_encoder_setup(struct drm_device *dev); int exynos_drm_encoder_create(struct drm_device *dev, struct exynos_drm_encoder *encoder, enum exynos_drm_output_type type);