[PATCH v3 2/4] drm: Add drm_rect_calc_{hscale, vscale}() utility functions

Chris Wilson chris at chris-wilson.co.uk
Tue Apr 16 06:42:34 PDT 2013


On Tue, Apr 16, 2013 at 01:47:20PM +0300, ville.syrjala at linux.intel.com wrote:
> diff --git a/include/drm/drm_rect.h b/include/drm/drm_rect.h
> index 2b7278c..de24f16 100644
> --- a/include/drm/drm_rect.h
> +++ b/include/drm/drm_rect.h
> @@ -128,5 +128,17 @@ bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip);
>  bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst,
>  			  const struct drm_rect *clip,
>  			  int hscale, int vscale);
> +int drm_rect_calc_hscale(const struct drm_rect *src,
> +			 const struct drm_rect *dst,
> +			 int min_hscale, int max_hscale);
> +int drm_rect_calc_vscale(const struct drm_rect *src,
> +			 const struct drm_rect *dst,
> +			 int min_vscale, int max_vscale);
> +int drm_rect_calc_hscale_relaxed(struct drm_rect *src,
> +				 struct drm_rect *dst,
> +				 int min_hscale, int max_hscale);
> +int drm_rect_calc_vscale_relaxed(struct drm_rect *src,
> +				 struct drm_rect *dst,
> +				 int min_vscale, int max_vscale);

These struct drm_rect *src should be const so it is clear that dst is
being manipulated.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the dri-devel mailing list