XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Functions
drm_rect.h File Reference
#include <linux/types.h>
Include dependency graph for drm_rect.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  drm_rect
 

Macros

#define DRM_RECT_INIT(x, y, w, h)
 
#define DRM_RECT_FMT   "%dx%d%+d%+d"
 
#define DRM_RECT_ARG(r)   drm_rect_width(r), drm_rect_height(r), (r)->x1, (r)->y1
 
#define DRM_RECT_FP_FMT   "%d.%06ux%d.%06u%+d.%06u%+d.%06u"
 
#define DRM_RECT_FP_ARG(r)
 

Functions

bool drm_rect_intersect (struct drm_rect *r, const struct drm_rect *clip)
 
bool drm_rect_clip_scaled (struct drm_rect *src, struct drm_rect *dst, const struct drm_rect *clip)
 
int drm_rect_calc_hscale (const struct drm_rect *src, const struct drm_rect *dst, int min_hscale, int max_hscale)
 
int drm_rect_calc_vscale (const struct drm_rect *src, const struct drm_rect *dst, int min_vscale, int max_vscale)
 
void drm_rect_debug_print (const char *prefix, const struct drm_rect *r, bool fixed_point)
 
void drm_rect_rotate (struct drm_rect *r, int width, int height, unsigned int rotation)
 
void drm_rect_rotate_inv (struct drm_rect *r, int width, int height, unsigned int rotation)
 

Macro Definition Documentation

◆ DRM_RECT_ARG

#define DRM_RECT_ARG (   r)    drm_rect_width(r), drm_rect_height(r), (r)->x1, (r)->y1

DRM_RECT_ARG - printf arguments for &struct drm_rect @r: rectangle struct

◆ DRM_RECT_FMT

#define DRM_RECT_FMT   "%dx%d%+d%+d"

DRM_RECT_FMT - printf string for &struct drm_rect

◆ DRM_RECT_FP_ARG

#define DRM_RECT_FP_ARG (   r)
Value:
drm_rect_width(r) >> 16, ((drm_rect_width(r) & 0xffff) * 15625) >> 10, \
drm_rect_height(r) >> 16, ((drm_rect_height(r) & 0xffff) * 15625) >> 10, \
(r)->x1 >> 16, (((r)->x1 & 0xffff) * 15625) >> 10, \
(r)->y1 >> 16, (((r)->y1 & 0xffff) * 15625) >> 10

DRM_RECT_FP_ARG - printf arguments for &struct drm_rect in 16.16 fixed point @r: rectangle struct

This is useful for e.g. printing plane source rectangles, which are in 16.16 fixed point.

◆ DRM_RECT_FP_FMT

#define DRM_RECT_FP_FMT   "%d.%06ux%d.%06u%+d.%06u%+d.%06u"

DRM_RECT_FP_FMT - printf string for &struct drm_rect in 16.16 fixed point

◆ DRM_RECT_INIT

#define DRM_RECT_INIT (   x,
  y,
  w,
  h 
)
Value:
((struct drm_rect){ \
.x1 = (x), \
.y1 = (y), \
.x2 = (x) + (w), \
.y2 = (y) + (h) })
int y
Definition layout.c:118
int h
Definition layout.c:118
int x
Definition layout.c:118
Definition drm_rect.h:46
int y1
Definition drm_rect.h:47

DRM_RECT_INIT - initialize a rectangle from x/y/w/h @x: x coordinate @y: y coordinate @w: width @h: height

RETURNS: A new rectangle of the specified size.

Function Documentation

◆ drm_rect_calc_hscale()

int drm_rect_calc_hscale ( const struct drm_rect *  src,
const struct drm_rect *  dst,
int  min_hscale,
int  max_hscale 
)

◆ drm_rect_calc_vscale()

int drm_rect_calc_vscale ( const struct drm_rect *  src,
const struct drm_rect *  dst,
int  min_vscale,
int  max_vscale 
)

◆ drm_rect_clip_scaled()

bool drm_rect_clip_scaled ( struct drm_rect *  src,
struct drm_rect *  dst,
const struct drm_rect *  clip 
)

◆ drm_rect_debug_print()

void drm_rect_debug_print ( const char *  prefix,
const struct drm_rect *  r,
bool  fixed_point 
)

◆ drm_rect_intersect()

bool drm_rect_intersect ( struct drm_rect *  r,
const struct drm_rect *  clip 
)

◆ drm_rect_rotate()

void drm_rect_rotate ( struct drm_rect *  r,
int  width,
int  height,
unsigned int  rotation 
)

◆ drm_rect_rotate_inv()

void drm_rect_rotate_inv ( struct drm_rect *  r,
int  width,
int  height,
unsigned int  rotation 
)