[PATCH v4] drm: Add struct drm_rect and assorted utility functions

Laurent Pinchart laurent.pinchart at ideasonboard.com
Fri Apr 5 17:00:31 PDT 2013


Hi Ville,

Thanks for the patch.

On Friday 05 April 2013 16:19:36 ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> struct drm_rect represents a simple rectangle. The utility
> functions are there to help driver writers.
> 
> v2: Moved the region stuff into its own file, made the smaller funcs
>     static inline, used 64bit maths in the scaled clipping function to
>     avoid overflows (instead it will saturate to INT_MIN or INT_MAX).
> v3: Renamed drm_region to drm_rect, drm_region_clip to
>     drm_rect_intersect, and drm_region_subsample to drm_rect_downscale.
> v4: Renamed some function parameters, improve kernel-doc comments a bit,
>     and actually generate documentation for drm_rect.[ch].
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>
> ---
>  Documentation/DocBook/drm.tmpl |   2 +
>  drivers/gpu/drm/Makefile       |   3 +-
>  drivers/gpu/drm/drm_rect.c     |  96 ++++++++++++++++++++++++++++++
>  include/drm/drm_rect.h         | 132 ++++++++++++++++++++++++++++++++++++++
>  4 files changed, 232 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/drm_rect.c
>  create mode 100644 include/drm/drm_rect.h

[snip]

> diff --git a/drivers/gpu/drm/drm_rect.c b/drivers/gpu/drm/drm_rect.c
> new file mode 100644
> index 0000000..a9861bd
> --- /dev/null
> +++ b/drivers/gpu/drm/drm_rect.c

[snip]

> +/**
> + * drm_rect_clip_scaled - perform a scaled clip operation
> + * @src: source window rectangle
> + * @dst: destination window rectangle
> + * @clip: clip rectangle
> + * @hscale: horizontal scaling factor
> + * @vscale: vertical scaling factor
> + *
> + * Clip rectangle @dst by rectangle @clip. Clip rectangle @src by the
> + * same amounts multiplied by @hscale and @vscale.
> + *
> + * RETUTRNS:

s/RETUTRNS/RETURNS/

> + * %true if rectangle @dst is still visible after being clipped,
> + * %false otherwise
> + */

Otherwise,

Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>

-- 
Regards,

Laurent Pinchart



More information about the dri-devel mailing list