From patchwork Thu Oct 9 19:57:44 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Jesse Barnes X-Patchwork-Id: 5061001 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 BBFAC9F30B for ; Thu, 9 Oct 2014 20:06:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E6BE0201C8 for ; Thu, 9 Oct 2014 20:06:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1C33820123 for ; Thu, 9 Oct 2014 20:06:46 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7C4AA6E241; Thu, 9 Oct 2014 13:06:45 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from gproxy5-pub.mail.unifiedlayer.com (gproxy5-pub.mail.unifiedlayer.com [67.222.38.55]) by gabe.freedesktop.org (Postfix) with SMTP id 47D6C6E241 for ; Thu, 9 Oct 2014 13:06:44 -0700 (PDT) Received: (qmail 3409 invoked by uid 0); 9 Oct 2014 20:00:04 -0000 Received: from unknown (HELO cmgw2) (10.0.90.83) by gproxy5.mail.unifiedlayer.com with SMTP; 9 Oct 2014 20:00:04 -0000 Received: from box514.bluehost.com ([74.220.219.114]) by cmgw2 with id 17wL1p00i2UhLwi017ytaR; Thu, 09 Oct 2014 13:58:56 -0600 X-Authority-Analysis: v=2.1 cv=e5mVF8Z/ c=1 sm=1 tr=0 a=9W6Fsu4pMcyimqnCr1W0/w==:117 a=9W6Fsu4pMcyimqnCr1W0/w==:17 a=cNaOj0WVAAAA:8 a=f5113yIGAAAA:8 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=1nAVeRskuLfeF6Hg8DI36DgNAOXsFC0rWO/m/sF3vcA=; b=nwrvahixfaieKh039+5N0x1bqSn+5Qrq7Pv+c79g3myN67s8jZ13X4CodjCCukX1sYaF5KO2csIb/uE/A0iYtrpeq1qzqtRYi9ZqDKLSLeM1qzr6mnsiGh22ChFsCoWG; Received: from [67.161.37.189] (port=42261 helo=localhost.localdomain) by box514.bluehost.com with esmtpsa (TLSv1.2:AES128-SHA256:128) (Exim 4.82) (envelope-from ) id 1XcJqU-0003jo-7n; Thu, 09 Oct 2014 13:57:54 -0600 From: Jesse Barnes To: intel-gfx@lists.freedesktop.org Date: Thu, 9 Oct 2014 12:57:44 -0700 Message-Id: <1412884665-16766-3-git-send-email-jbarnes@virtuousgeek.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1412884665-16766-1-git-send-email-jbarnes@virtuousgeek.org> References: <1412884665-16766-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: shuang.he@linux.intel.com Subject: [Intel-gfx] [PATCH 3/4] 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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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: 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 d1b7d20..51ede38 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,