Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   1) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   2)  * Copyright (C) 2011-2013 Intel Corporation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   4)  * Permission is hereby granted, free of charge, to any person obtaining a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   5)  * copy of this software and associated documentation files (the "Software"),
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   6)  * to deal in the Software without restriction, including without limitation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   7)  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   8)  * and/or sell copies of the Software, and to permit persons to whom the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300   9)  * Software is furnished to do so, subject to the following conditions:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  10)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  11)  * The above copyright notice and this permission notice (including the next
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  12)  * paragraph) shall be included in all copies or substantial portions of the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  13)  * Software.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  14)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  15)  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  16)  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  17)  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  18)  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  19)  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  20)  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  21)  * SOFTWARE.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  22)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  23) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  24) #ifndef DRM_RECT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  25) #define DRM_RECT_H
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  26) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  27) #include <linux/types.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  28) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  29) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  30)  * DOC: rect utils
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  31)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  32)  * Utility functions to help manage rectangular areas for
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  33)  * clipping, scaling, etc. calculations.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  34)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  36) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  37)  * struct drm_rect - two dimensional rectangle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  38)  * @x1: horizontal starting coordinate (inclusive)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  39)  * @x2: horizontal ending coordinate (exclusive)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  40)  * @y1: vertical starting coordinate (inclusive)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  41)  * @y2: vertical ending coordinate (exclusive)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  42)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  43) struct drm_rect {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  44) 	int x1, y1, x2, y2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  45) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  46) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  47) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  48)  * DRM_RECT_FMT - printf string for &struct drm_rect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  49)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  50) #define DRM_RECT_FMT    "%dx%d%+d%+d"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  51) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  52)  * DRM_RECT_ARG - printf arguments for &struct drm_rect
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  53)  * @r: rectangle struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  54)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  55) #define DRM_RECT_ARG(r) drm_rect_width(r), drm_rect_height(r), (r)->x1, (r)->y1
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  56) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  57) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  58)  * DRM_RECT_FP_FMT - printf string for &struct drm_rect in 16.16 fixed point
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  59)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  60) #define DRM_RECT_FP_FMT "%d.%06ux%d.%06u%+d.%06u%+d.%06u"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  61) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  62)  * DRM_RECT_FP_ARG - printf arguments for &struct drm_rect in 16.16 fixed point
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  63)  * @r: rectangle struct
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  64)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  65)  * This is useful for e.g. printing plane source rectangles, which are in 16.16
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  66)  * fixed point.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  67)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  68) #define DRM_RECT_FP_ARG(r) \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  69) 		drm_rect_width(r) >> 16, ((drm_rect_width(r) & 0xffff) * 15625) >> 10, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  70) 		drm_rect_height(r) >> 16, ((drm_rect_height(r) & 0xffff) * 15625) >> 10, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  71) 		(r)->x1 >> 16, (((r)->x1 & 0xffff) * 15625) >> 10, \
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  72) 		(r)->y1 >> 16, (((r)->y1 & 0xffff) * 15625) >> 10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  73) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  74) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  75)  * drm_rect_init - initialize the rectangle from x/y/w/h
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  76)  * @r: rectangle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  77)  * @x: x coordinate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  78)  * @y: y coordinate
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  79)  * @width: width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  80)  * @height: height
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  81)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  82) static inline void drm_rect_init(struct drm_rect *r, int x, int y,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  83) 				 int width, int height)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  84) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  85) 	r->x1 = x;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  86) 	r->y1 = y;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  87) 	r->x2 = x + width;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  88) 	r->y2 = y + height;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  89) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  90) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  91) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  92)  * drm_rect_adjust_size - adjust the size of the rectangle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  93)  * @r: rectangle to be adjusted
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  94)  * @dw: horizontal adjustment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  95)  * @dh: vertical adjustment
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  96)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  97)  * Change the size of rectangle @r by @dw in the horizontal direction,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  98)  * and by @dh in the vertical direction, while keeping the center
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  99)  * of @r stationary.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 100)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 101)  * Positive @dw and @dh increase the size, negative values decrease it.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 102)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 103) static inline void drm_rect_adjust_size(struct drm_rect *r, int dw, int dh)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 104) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 105) 	r->x1 -= dw >> 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 106) 	r->y1 -= dh >> 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 107) 	r->x2 += (dw + 1) >> 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 108) 	r->y2 += (dh + 1) >> 1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 109) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 110) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 111) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 112)  * drm_rect_translate - translate the rectangle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 113)  * @r: rectangle to be tranlated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 114)  * @dx: horizontal translation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 115)  * @dy: vertical translation
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 116)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 117)  * Move rectangle @r by @dx in the horizontal direction,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 118)  * and by @dy in the vertical direction.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 119)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 120) static inline void drm_rect_translate(struct drm_rect *r, int dx, int dy)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 121) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 122) 	r->x1 += dx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 123) 	r->y1 += dy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 124) 	r->x2 += dx;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 125) 	r->y2 += dy;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 126) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 127) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 128) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 129)  * drm_rect_translate_to - translate the rectangle to an absolute position
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 130)  * @r: rectangle to be tranlated
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 131)  * @x: horizontal position
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 132)  * @y: vertical position
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 133)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 134)  * Move rectangle @r to @x in the horizontal direction,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 135)  * and to @y in the vertical direction.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 136)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 137) static inline void drm_rect_translate_to(struct drm_rect *r, int x, int y)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 138) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 139) 	drm_rect_translate(r, x - r->x1, y - r->y1);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 140) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 141) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 142) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 143)  * drm_rect_downscale - downscale a rectangle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 144)  * @r: rectangle to be downscaled
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 145)  * @horz: horizontal downscale factor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 146)  * @vert: vertical downscale factor
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 147)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 148)  * Divide the coordinates of rectangle @r by @horz and @vert.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 149)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 150) static inline void drm_rect_downscale(struct drm_rect *r, int horz, int vert)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 151) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 152) 	r->x1 /= horz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 153) 	r->y1 /= vert;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 154) 	r->x2 /= horz;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 155) 	r->y2 /= vert;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 156) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 157) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 158) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 159)  * drm_rect_width - determine the rectangle width
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 160)  * @r: rectangle whose width is returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 161)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 162)  * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 163)  * The width of the rectangle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 164)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 165) static inline int drm_rect_width(const struct drm_rect *r)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 166) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 167) 	return r->x2 - r->x1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 168) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 169) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 170) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 171)  * drm_rect_height - determine the rectangle height
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 172)  * @r: rectangle whose height is returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 173)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 174)  * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 175)  * The height of the rectangle.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 176)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 177) static inline int drm_rect_height(const struct drm_rect *r)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 178) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 179) 	return r->y2 - r->y1;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 180) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 181) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 182) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 183)  * drm_rect_visible - determine if the rectangle is visible
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 184)  * @r: rectangle whose visibility is returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 185)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 186)  * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 187)  * %true if the rectangle is visible, %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 188)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 189) static inline bool drm_rect_visible(const struct drm_rect *r)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 190) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 191) 	return drm_rect_width(r) > 0 && drm_rect_height(r) > 0;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 192) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 193) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 194) /**
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 195)  * drm_rect_equals - determine if two rectangles are equal
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 196)  * @r1: first rectangle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 197)  * @r2: second rectangle
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 198)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 199)  * RETURNS:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 200)  * %true if the rectangles are equal, %false otherwise.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 201)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 202) static inline bool drm_rect_equals(const struct drm_rect *r1,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 203) 				   const struct drm_rect *r2)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 204) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 205) 	return r1->x1 == r2->x1 && r1->x2 == r2->x2 &&
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 206) 		r1->y1 == r2->y1 && r1->y2 == r2->y2;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 207) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 208) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 209) bool drm_rect_intersect(struct drm_rect *r, const struct drm_rect *clip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 210) bool drm_rect_clip_scaled(struct drm_rect *src, struct drm_rect *dst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 211) 			  const struct drm_rect *clip);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 212) int drm_rect_calc_hscale(const struct drm_rect *src,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 213) 			 const struct drm_rect *dst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 214) 			 int min_hscale, int max_hscale);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 215) int drm_rect_calc_vscale(const struct drm_rect *src,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 216) 			 const struct drm_rect *dst,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 217) 			 int min_vscale, int max_vscale);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 218) void drm_rect_debug_print(const char *prefix,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 219) 			  const struct drm_rect *r, bool fixed_point);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 220) void drm_rect_rotate(struct drm_rect *r,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 221) 		     int width, int height,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 222) 		     unsigned int rotation);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 223) void drm_rect_rotate_inv(struct drm_rect *r,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 224) 			 int width, int height,
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 225) 			 unsigned int rotation);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 226) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 227) #endif