drm_rect.c revision 1450
550N/A * Copyright (C) 2011-2013 Intel Corporation 550N/A * Permission is hereby granted, free of charge, to any person obtaining a 1402N/A * copy of this software and associated documentation files (the "Software"), 550N/A * to deal in the Software without restriction, including without limitation 550N/A * the rights to use, copy, modify, merge, publish, distribute, sublicense, 919N/A * and/or sell copies of the Software, and to permit persons to whom the 919N/A * Software is furnished to do so, subject to the following conditions: 919N/A * The above copyright notice and this permission notice (including the next 919N/A * paragraph) shall be included in all copies or substantial portions of the 919N/A * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 919N/A * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 919N/A * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 919N/A * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 919N/A * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 919N/A * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 550N/A * drm_rect_intersect - intersect two rectangles 550N/A * @r2: second rectangle 977N/A * Calculate the intersection of rectangles @r1 and @r2. 970N/A * @r1 will be overwritten with the intersection. 1339N/A * %true if rectangle @r1 is still visible after the operation, 550N/A * drm_rect_clip_scaled - perform a scaled clip operation 1402N/A * @src: source window rectangle 550N/A * @dst: destination window rectangle 550N/A * @clip: clip rectangle 550N/A * @hscale: horizontal scaling factor 550N/A * @vscale: vertical scaling factor 550N/A * Clip rectangle @dst by rectangle @clip. Clip rectangle @src by the 550N/A * same amounts multiplied by @hscale and @vscale. 550N/A * %true if rectangle @dst is still visible after being clipped, * drm_rect_calc_hscale - calculate the horizontal scaling factor * @src: source window rectangle * @dst: destination window rectangle * @min_hscale: minimum allowed horizontal scaling factor * @max_hscale: maximum allowed horizontal scaling factor * Calculate the horizontal scaling factor as * (@src width) / (@dst width). * The horizontal scaling factor, or errno of out of limits. * drm_rect_calc_vscale - calculate the vertical scaling factor * @src: source window rectangle * @dst: destination window rectangle * @min_vscale: minimum allowed vertical scaling factor * @max_vscale: maximum allowed vertical scaling factor * Calculate the vertical scaling factor as * (@src height) / (@dst height). * The vertical scaling factor, or errno of out of limits. * drm_calc_hscale_relaxed - calculate the horizontal scaling factor * @src: source window rectangle * @dst: destination window rectangle * @min_hscale: minimum allowed horizontal scaling factor * @max_hscale: maximum allowed horizontal scaling factor * Calculate the horizontal scaling factor as * (@src width) / (@dst width). * If the calculated scaling factor is below @min_vscale, * decrease the height of rectangle @dst to compensate. * If the calculated scaling factor is above @max_vscale, * decrease the height of rectangle @src to compensate. * The horizontal scaling factor. * drm_rect_calc_vscale_relaxed - calculate the vertical scaling factor * @src: source window rectangle * @dst: destination window rectangle * @min_vscale: minimum allowed vertical scaling factor * @max_vscale: maximum allowed vertical scaling factor * Calculate the vertical scaling factor as * (@src height) / (@dst height). * If the calculated scaling factor is below @min_vscale, * decrease the height of rectangle @dst to compensate. * If the calculated scaling factor is above @max_vscale, * decrease the height of rectangle @src to compensate. * The vertical scaling factor. * drm_rect_debug_print - print the rectangle information * @fixed_point: rectangle is in 16.16 fixed point format w >>
16, ((w &
0xffff) *
15625) >>
10,
h >>
16, ((h &
0xffff) *
15625) >>
10,
r->
x1 >>
16, ((r->
x1 &
0xffff) *
15625) >>
10,
r->
y1 >>
16, ((r->
y1 &
0xffff) *
15625) >>
10);