]> git.karo-electronics.de Git - karo-tx-linux.git/commit
drm: Add drm_rect_calc_{hscale, vscale}() utility functions
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 24 Apr 2013 15:52:35 +0000 (18:52 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Tue, 30 Apr 2013 20:19:39 +0000 (22:19 +0200)
commit4954c4282f6b945f1dd5716f92b594a07fa4ffe3
tree3c72d5bd093e1c066cd1ef8c0f9608231ad4d44f
parent3512f976d252bd5d07d04e9e157f0cd210c959a0
drm: Add drm_rect_calc_{hscale, vscale}() utility functions

These functions calculate the scaling factor based on the source and
destination rectangles.

There are two version of the functions, the strict ones that will
return an error if the min/max scaling factor is exceeded, and the
relaxed versions that will adjust the src/dst rectangles in order to
keep the scaling factor withing the limits.

v2: Return error instead of adjusting regions, refactor common parts
    into one function, and split into strict and relaxed versions.
v3: Renamed drm_region to drm_rect, add "_rect_" to the function
    names.
v4: Fix "calculcate" typos

Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Acked-by: Dave Airlie <airlied@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/drm_rect.c
include/drm/drm_rect.h