From patchwork Thu Jun 5 18:24:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 4308041 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 8C1FEBEEAA for ; Thu, 5 Jun 2014 18:27:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C830D2034F for ; Thu, 5 Jun 2014 18:27:55 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 50158201EC for ; Thu, 5 Jun 2014 18:27:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1D5306E99B; Thu, 5 Jun 2014 11:27:52 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from gproxy3-pub.mail.unifiedlayer.com (gproxy3-pub.mail.unifiedlayer.com [69.89.30.42]) by gabe.freedesktop.org (Postfix) with SMTP id 88E266E2C2 for ; Thu, 5 Jun 2014 11:27:50 -0700 (PDT) Received: (qmail 25401 invoked by uid 0); 5 Jun 2014 18:26:11 -0000 Received: from unknown (HELO CMOut01) (10.0.90.82) by gproxy3.mail.unifiedlayer.com with SMTP; 5 Jun 2014 18:26:11 -0000 Received: from box514.bluehost.com ([74.220.219.114]) by CMOut01 with id AiS41o0122UhLwi01iS7lM; Thu, 05 Jun 2014 12:26:11 -0600 X-Authority-Analysis: v=2.1 cv=EOmVjTpC c=1 sm=1 tr=0 a=9W6Fsu4pMcyimqnCr1W0/w==:117 a=9W6Fsu4pMcyimqnCr1W0/w==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 a=7pgUh5Ng6vMA:10 a=3ROhxo7VqVMA:10 a=IkcTkHD0fZMA:10 a=TBVoxVdAAAAA:8 a=GhZ5P8ky69gA:10 a=noBwr2J6l1kA:10 a=pGLkceISAAAA:8 a=ThlTshNOP_2Hbt0ER8UA:9 a=QEXdDO2ut3YA:10 a=MSl-tDqOz04A:10 a=rW6DTWptwo0A:10 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuousgeek.org; s=default; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From; bh=8RpYWkf2ese6UivGBkKjpzLYKgMykIemVxsbV88NSIA=; b=QNOOLRMy7UIHEcRrlVjcSJDgvLZbZKjX+4+3cwSBN2dREZV6OhZYeBcDUjoUSDAN6cZIpxIbTYC6OCSnSZkEdMFaxaELE+qCvwuQp5eP8jPRJu1x+9//BUmCOvlWEf2/; Received: from [67.161.37.189] (port=60655 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.1:DHE-RSA-AES256-SHA:256) (Exim 4.82) (envelope-from ) id 1WscMW-0001x8-OI; Thu, 05 Jun 2014 12:26:04 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Thu, 5 Jun 2014 11:24:29 -0700 Message-Id: <1401992671-2548-3-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1401992671-2548-1-git-send-email-jbarnes@virtuousgeek.org> References: <1401992671-2548-1-git-send-email-jbarnes@virtuousgeek.org> MIME-Version: 1.0 X-Identified-User: {10642:box514.bluehost.com:virtuous:virtuousgeek.org} {sentby:smtp auth 67.161.37.189 authed with jbarnes@virtuousgeek.org} Cc: dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH 3/5] drm: add drm_mode_same_size function X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 From: Kristian Høgsberg Like mode_equal but w/o the clock checks. Useful for checking if modes are close enough to re-use to avoid a boot time mode set for example. Signed-off-by: Kristian Høgsberg Signed-off-by: Jesse Barnes --- drivers/gpu/drm/drm_modes.c | 8 ++++++++ include/drm/drm_modes.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/gpu/drm/drm_modes.c b/drivers/gpu/drm/drm_modes.c index bedf189..92ae7f3 100644 --- a/drivers/gpu/drm/drm_modes.c +++ b/drivers/gpu/drm/drm_modes.c @@ -905,6 +905,14 @@ bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, } EXPORT_SYMBOL(drm_mode_equal_no_clocks_no_stereo); +bool drm_mode_same_size(const struct drm_display_mode *mode1, + const struct drm_display_mode *mode2) +{ + return mode1->vdisplay == mode2->vdisplay && + mode1->hdisplay == mode2->hdisplay; +} +EXPORT_SYMBOL(drm_mode_same_size); + /** * drm_mode_validate_size - make sure modes adhere to size constraints * @dev: DRM device diff --git a/include/drm/drm_modes.h b/include/drm/drm_modes.h index 91d0582..7272309 100644 --- a/include/drm/drm_modes.h +++ b/include/drm/drm_modes.h @@ -215,6 +215,8 @@ bool drm_mode_equal(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2); bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *mode1, const struct drm_display_mode *mode2); +bool drm_mode_same_size(const struct drm_display_mode *mode1, + const struct drm_display_mode *mode2); /* for use by the crtc helper probe functions */ void drm_mode_validate_size(struct drm_device *dev,