From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [PATCH 3/4] drm: add drm_mode_same_size function Date: Tue, 21 Oct 2014 16:49:37 +0200 Message-ID: <20141021144937.GL26941@phenom.ffwll.local> References: <1412884665-16766-1-git-send-email-jbarnes@virtuousgeek.org> <1412884665-16766-3-git-send-email-jbarnes@virtuousgeek.org> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 16FAE6E1F1 for ; Tue, 21 Oct 2014 07:49:32 -0700 (PDT) Received: by mail-wi0-f172.google.com with SMTP id bs8so1338672wib.11 for ; Tue, 21 Oct 2014 07:49:31 -0700 (PDT) Content-Disposition: inline In-Reply-To: <1412884665-16766-3-git-send-email-jbarnes@virtuousgeek.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Jesse Barnes Cc: intel-gfx@lists.freedesktop.org, shuang.he@linux.intel.com List-Id: intel-gfx@lists.freedesktop.org On Thu, Oct 09, 2014 at 12:57:44PM -0700, Jesse Barnes wrote: > From: Kristian H=F8gsberg > = > 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=F8gsberg > 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); > = kerneldoc is missing here. -Daniel > +bool drm_mode_same_size(const struct drm_display_mode *mode1, > + const struct drm_display_mode *mode2) > +{ > + return mode1->vdisplay =3D=3D mode2->vdisplay && > + mode1->hdisplay =3D=3D 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 *mo= de1, > const struct drm_display_mode *mode2); > bool drm_mode_equal_no_clocks_no_stereo(const struct drm_display_mode *m= ode1, > 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, > -- = > 1.9.1 > = > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- = Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch