Re: [PATCH 3/4] drm: add drm_mode_same_size function

Daniel Vetter
2014-10-21T14:49:32Z

On Thu, Oct 09, 2014 at 12:57:44PM -0700, Jesse Barnes wrote:
> From: Kristian Høgsberg <hoegsberg@gmail.com>
>
> 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 <hoegsberg@gmail.com>
> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
> ---
> 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 == 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,
> --
> 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