From patchwork Mon Jan 13 14:07:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 3475451 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C07769F2ED for ; Mon, 13 Jan 2014 14:08:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BD2DE2012B for ; Mon, 13 Jan 2014 14:08:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id B88FF2011E for ; Mon, 13 Jan 2014 14:08:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B3B7F11E5A6; Mon, 13 Jan 2014 06:08:18 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-bk0-f54.google.com (mail-bk0-f54.google.com [209.85.214.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 93EA811E5AF; Mon, 13 Jan 2014 06:08:04 -0800 (PST) Received: by mail-bk0-f54.google.com with SMTP id u14so798185bkz.13 for ; Mon, 13 Jan 2014 06:08:03 -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=zN/x2PpzyV4sz084BkwF8TCimj54zMRvn8IUXpj544M=; b=pEp0UHw+1pDC17u8b0scg4Yoar+yMt3M5xQ7fM3gRC3k9NyucFGqmOwUmPPiDQDboN aoI9m5x5H8uzTvT4y5cr/Ik3ptGVFXY4fV+UwPbqoNKQlT+cBAQMxi1/NeQ9sawcES2w UFWoJK0SVcfKWAO7UFeeomfhFI1e2QTK5b7FDw8KVDb3TbOs59oD8NkBFr8YWsguVgrx FABBmdtRGS1XowDR9ZUTvv0aapV3C+CMQQdoJv5rkHrU1Cq3OuKmXa3xUmlq7hk0AICk yuhRGcsPI6pZoGioJjAFrz5J8MXK2fRxGwHgOLD+6umiZ8tx4mvvnUMG+wQ/wQjRIw/7 SOcA== X-Received: by 10.204.100.199 with SMTP id z7mr1139900bkn.62.1389622083637; Mon, 13 Jan 2014 06:08:03 -0800 (PST) Received: from localhost (port-52867.pppoe.wtnet.de. [46.59.207.43]) by mx.google.com with ESMTPSA id dg4sm15862247bkc.10.2014.01.13.06.08.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 13 Jan 2014 06:08:02 -0800 (PST) From: Thierry Reding To: dri-devel@lists.freedesktop.org Date: Mon, 13 Jan 2014 15:07:56 +0100 Message-Id: <1389622077-9324-3-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 2/3] drm: Move drm_encoder_crtc_ok() to core 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 Using the new drm_crtc_mask() function, drm_encoder_crtc_ok() can now be written in a significantly shorter way, so it can be moved to a header file and be made static inline. Signed-off-by: Thierry Reding --- Changes in v3: - new patch drivers/gpu/drm/drm_crtc_helper.c | 13 ------------- include/drm/drm_crtc.h | 13 +++++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index 940c678cf012..48c90cbceb06 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -324,19 +324,6 @@ void drm_helper_disable_unused_functions(struct drm_device *dev) } EXPORT_SYMBOL(drm_helper_disable_unused_functions); -/** - * drm_encoder_crtc_ok - can a given crtc drive a given encoder? - * @encoder: encoder to test - * @crtc: crtc to test - * - * Return false if @encoder can't be driven by @crtc, true otherwise. - */ -static bool drm_encoder_crtc_ok(struct drm_encoder *encoder, - struct drm_crtc *crtc) -{ - return !!(encoder->possible_crtcs & drm_crtc_mask(crtc)); -} - /* * Check the CRTC we're going to map each output to vs. its current * CRTC. If they don't match, we have to disable the output and the CRTC diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 4f2e3e82f014..b3865a0e39f4 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -963,6 +963,19 @@ extern int drm_encoder_init(struct drm_device *dev, const struct drm_encoder_funcs *funcs, int encoder_type); +/** + * drm_encoder_crtc_ok - can a given crtc drive a given encoder? + * @encoder: encoder to test + * @crtc: crtc to test + * + * Return false if @encoder can't be driven by @crtc, true otherwise. + */ +static inline bool drm_encoder_crtc_ok(struct drm_encoder *encoder, + struct drm_crtc *crtc) +{ + return !!(encoder->possible_crtcs & drm_crtc_mask(crtc)); +} + extern int drm_plane_init(struct drm_device *dev, struct drm_plane *plane, unsigned long possible_crtcs,