From patchwork Mon Jan 13 14:07:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3475441 Return-Path: X-Original-To: patchwork-intel-gfx@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 D9CEFC02DC for ; Mon, 13 Jan 2014 14:08:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C7C422011E for ; Mon, 13 Jan 2014 14:08:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 5A7F52012D for ; Mon, 13 Jan 2014 14:08:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4777311E5BD; Mon, 13 Jan 2014 06:08:11 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-bk0-f46.google.com (mail-bk0-f46.google.com [209.85.214.46]) by gabe.freedesktop.org (Postfix) with ESMTP id B0F4D11E5AA; Mon, 13 Jan 2014 06:08:06 -0800 (PST) Received: by mail-bk0-f46.google.com with SMTP id u15so2455397bkz.19 for ; Mon, 13 Jan 2014 06:08:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=ogsUN11Z6hUWuqriJdK8xR4867Rua8eeMfc78uqhHKQ=; b=MYfCDJeRpaTpp1906r2QgTu+aSLzs4c530D7+B+iKTCqFUQihonSy1sUS/DcsfP6bM grasa1FwlMi2vuw1lTXnZZP6fTHtw+EikCMDjuOtMZSsuqYhfQIUK1rW2j82NAN5C3Uq YK0NMIJjqXin6bwTl3k6Xmo61h/uJlFpiwI6L7EnLN7QcqcgCcT5vKVx/tl9jChqax3v mAXuObgx18Vor/vtJQxdYdJGnFIWvKgLFes0G+vb65opmvjQkJ6weSpegfsudBZ1bGCE NtHcjH0orFIGV8kjICgXhWEwN8cjxUySBaUntQ0Db8X3N40MiyEV2bEJNT7YBEr1pb5u NM/g== X-Received: by 10.204.200.138 with SMTP id ew10mr9024308bkb.34.1389622085848; Mon, 13 Jan 2014 06:08:05 -0800 (PST) Received: from localhost (port-52867.pppoe.wtnet.de. [46.59.207.43]) by mx.google.com with ESMTPSA id dt5sm7938616bkc.1.2014.01.13.06.08.04 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jan 2014 06:08:04 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Date: Mon, 13 Jan 2014 15:07:57 +0100 Message-Id: <1389622077-9324-4-git-send-email-treding@nvidia.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1389622077-9324-1-git-send-email-treding@nvidia.com> References: <1389622077-9324-1-git-send-email-treding@nvidia.com> Cc: David Airlie , Daniel Vetter , intel-gfx@lists.freedesktop.org, Jani Nikula , David Herrmann , Russell King Subject: [Intel-gfx] [PATCH v3 3/3] drm/i915: Use drm_encoder_crtc_ok() X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 The intel_encoder_crtc_ok() is a duplicate of the drm_encoder_crtc_ok() function that used to be only available in the DRM CRTC helpers. It has recently been moved to the core, so the duplicate can now be dropped. Acked-by: Daniel Vetter Signed-off-by: Thierry Reding Reviewed-by: Jani Nikula --- Changes in v3: - replace intel_encoder_crtc_ok() by drm_encoder_crtc_ok() drivers/gpu/drm/i915/intel_display.c | 26 ++------------------------ 1 file changed, 2 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index e77d4b8856a7..7c245185c71f 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -8720,28 +8720,6 @@ static struct drm_crtc_helper_funcs intel_helper_funcs = { .load_lut = intel_crtc_load_lut, }; -static bool intel_encoder_crtc_ok(struct drm_encoder *encoder, - struct drm_crtc *crtc) -{ - struct drm_device *dev; - struct drm_crtc *tmp; - int crtc_mask = 1; - - WARN(!crtc, "checking null crtc?\n"); - - dev = crtc->dev; - - list_for_each_entry(tmp, &dev->mode_config.crtc_list, head) { - if (tmp == crtc) - break; - crtc_mask <<= 1; - } - - if (encoder->possible_crtcs & crtc_mask) - return true; - return false; -} - /** * intel_modeset_update_staged_output_state * @@ -9923,8 +9901,8 @@ intel_modeset_stage_output_state(struct drm_device *dev, } /* Make sure the new CRTC will work with the encoder */ - if (!intel_encoder_crtc_ok(&connector->new_encoder->base, - new_crtc)) { + if (!drm_encoder_crtc_ok(&connector->new_encoder->base, + new_crtc)) { return -EINVAL; } connector->encoder->new_crtc = to_intel_crtc(new_crtc);