From patchwork Wed Aug 5 23:24:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gustavo Padovan X-Patchwork-Id: 6954891 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 5A933C05AC for ; Wed, 5 Aug 2015 23:24:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E6BB20664 for ; Wed, 5 Aug 2015 23:24:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 63EE920665 for ; Wed, 5 Aug 2015 23:24:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752101AbbHEXYj (ORCPT ); Wed, 5 Aug 2015 19:24:39 -0400 Received: from mail-yk0-f181.google.com ([209.85.160.181]:34833 "EHLO mail-yk0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752006AbbHEXYj (ORCPT ); Wed, 5 Aug 2015 19:24:39 -0400 Received: by ykcq64 with SMTP id q64so44046053ykc.2 for ; Wed, 05 Aug 2015 16:24:39 -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=aWn63GzLglP3A7UXTO6KJirXUPRx7d71EHuGX/HgQFU=; b=EEJhfzFO2U0iaDpR1UUV65dY835Vah3DrIbaCfhM48MUha9+/uG6evVKlW1jjySJeQ gUDTGI2UJFGWDM7iEZWKJhENJbCzJsAA3dqIuUdQuRmoQJVV02DrRMvzcSrBSJM0CqwM tS2kT6UyXA8/nFFEP7Uo59YkxXQCwiL13sOmC4CXIOpg1MSsYsKSIcgNiCifzRCx9N+l h9cq9ZNBQa9v+Wfe4XPrNv65ieHQxyDiPpQaKAsXVBotXGWoypFpp2N7O11jpFg9u67k b6PyhIGdng9A26xpFu3EXx1kBSdfXrNP+YOI31bHE2QCuhLhIr1hDpQNjP6GWBIxRCFy QRsA== X-Received: by 10.129.36.14 with SMTP id k14mr11971983ywk.64.1438817079044; Wed, 05 Aug 2015 16:24:39 -0700 (PDT) Received: from jade.localdomain ([187.64.235.140]) by smtp.gmail.com with ESMTPSA id u186sm4327588ywa.4.2015.08.05.16.24.36 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 05 Aug 2015 16:24:38 -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 04/11] drm/exynos: simplify calculation of possible CRTCs Date: Wed, 5 Aug 2015 20:24:15 -0300 Message-Id: <1438817060-22164-5-git-send-email-gustavo@padovan.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1438817060-22164-1-git-send-email-gustavo@padovan.org> References: <1438817060-22164-1-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=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 All CRTCs can only be LCD, HDMI or VIDI, so basically all CRTCs will be a possible CRTCs. This patch removes an extra function with switch that was only checking if the CRTC type was one of those three above. Signed-off-by: Gustavo Padovan --- drivers/gpu/drm/exynos/exynos_drm_encoder.c | 29 +++++------------------------ 1 file changed, 5 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_encoder.c b/drivers/gpu/drm/exynos/exynos_drm_encoder.c index 0aa4a58..7ba3a2d 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_encoder.c +++ b/drivers/gpu/drm/exynos/exynos_drm_encoder.c @@ -105,36 +105,17 @@ static struct drm_encoder_funcs exynos_encoder_funcs = { .destroy = exynos_drm_encoder_destroy, }; -static unsigned int exynos_drm_encoder_clones(struct drm_encoder *encoder) +void exynos_drm_encoder_setup(struct drm_device *dev) { - struct drm_encoder *clone; - struct drm_device *dev = encoder->dev; - struct exynos_drm_encoder *exynos_encoder = to_exynos_encoder(encoder); - struct exynos_drm_display *display = exynos_encoder->display; + struct drm_encoder *encoder; unsigned int clone_mask = 0; int cnt = 0; - list_for_each_entry(clone, &dev->mode_config.encoder_list, head) { - switch (display->type) { - case EXYNOS_DISPLAY_TYPE_LCD: - case EXYNOS_DISPLAY_TYPE_HDMI: - case EXYNOS_DISPLAY_TYPE_VIDI: - clone_mask |= (1 << (cnt++)); - break; - default: - continue; - } - } - - return clone_mask; -} - -void exynos_drm_encoder_setup(struct drm_device *dev) -{ - struct drm_encoder *encoder; + 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 = exynos_drm_encoder_clones(encoder); + encoder->possible_clones = clone_mask; } struct drm_encoder *