From: Ville Syrjälä Date: Wed, 24 Apr 2013 15:52:35 +0000 (+0300) Subject: drm: Add drm_rect_calc_{hscale, vscale}() utility functions X-Git-Tag: v3.11-rc1~65^2~131^2~66 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4954c4282f6b945f1dd5716f92b594a07fa4ffe3;p=pandora-kernel.git 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 Signed-off-by: Ville Syrjälä Acked-by: Dave Airlie Signed-off-by: Daniel Vetter --- Reading git-diff-tree failed