XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs
drm_fixed.h File Reference
#include <linux/math64.h>
#include <linux/types.h>
#include <linux/wordpart.h>
Include dependency graph for drm_fixed.h:

Go to the source code of this file.

Classes

union  dfixed
 

Macros

#define dfixed_const(A)   (u32)(((A) << 12))/* + ((B + 0.000122)*4096)) */
 
#define dfixed_const_half(A)   (u32)(((A) << 12) + 2048)
 
#define dfixed_const_666(A)   (u32)(((A) << 12) + 2731)
 
#define dfixed_const_8(A)   (u32)(((A) << 12) + 3277)
 
#define dfixed_mul(A, B)   ((u64)((u64)(A).full * (B).full + 2048) >> 12)
 
#define dfixed_init(A)   { .full = dfixed_const((A)) }
 
#define dfixed_init_half(A)   { .full = dfixed_const_half((A)) }
 
#define dfixed_trunc(A)   ((A).full >> 12)
 
#define dfixed_frac(A)   ((A).full & ((1 << 12) - 1))
 
#define DRM_FIXED_POINT   32
 
#define DRM_FIXED_ONE   (1ULL << DRM_FIXED_POINT)
 
#define DRM_FIXED_DECIMAL_MASK   (DRM_FIXED_ONE - 1)
 
#define DRM_FIXED_DIGITS_MASK   (~DRM_FIXED_DECIMAL_MASK)
 
#define DRM_FIXED_EPSILON   1LL
 
#define DRM_FIXED_ALMOST_ONE   (DRM_FIXED_ONE - DRM_FIXED_EPSILON)
 
#define FXP_Q4_FMT   "%d.%04d"
 
#define FXP_Q4_ARGS(val_q4)   fxp_q4_to_int(val_q4), (fxp_q4_to_frac(val_q4) * 625)
 

Typedefs

typedef union dfixed fixed20_12
 

Macro Definition Documentation

◆ dfixed_const

#define dfixed_const (   A)    (u32)(((A) << 12))/* + ((B + 0.000122)*4096)) */

◆ dfixed_const_666

#define dfixed_const_666 (   A)    (u32)(((A) << 12) + 2731)

◆ dfixed_const_8

#define dfixed_const_8 (   A)    (u32)(((A) << 12) + 3277)

◆ dfixed_const_half

#define dfixed_const_half (   A)    (u32)(((A) << 12) + 2048)

◆ dfixed_frac

#define dfixed_frac (   A)    ((A).full & ((1 << 12) - 1))

◆ dfixed_init

#define dfixed_init (   A)    { .full = dfixed_const((A)) }

◆ dfixed_init_half

#define dfixed_init_half (   A)    { .full = dfixed_const_half((A)) }

◆ dfixed_mul

#define dfixed_mul (   A,
  B 
)    ((u64)((u64)(A).full * (B).full + 2048) >> 12)

◆ dfixed_trunc

#define dfixed_trunc (   A)    ((A).full >> 12)

◆ DRM_FIXED_ALMOST_ONE

#define DRM_FIXED_ALMOST_ONE   (DRM_FIXED_ONE - DRM_FIXED_EPSILON)

◆ DRM_FIXED_DECIMAL_MASK

#define DRM_FIXED_DECIMAL_MASK   (DRM_FIXED_ONE - 1)

◆ DRM_FIXED_DIGITS_MASK

#define DRM_FIXED_DIGITS_MASK   (~DRM_FIXED_DECIMAL_MASK)

◆ DRM_FIXED_EPSILON

#define DRM_FIXED_EPSILON   1LL

◆ DRM_FIXED_ONE

#define DRM_FIXED_ONE   (1ULL << DRM_FIXED_POINT)

◆ DRM_FIXED_POINT

#define DRM_FIXED_POINT   32

◆ FXP_Q4_ARGS

#define FXP_Q4_ARGS (   val_q4)    fxp_q4_to_int(val_q4), (fxp_q4_to_frac(val_q4) * 625)

◆ FXP_Q4_FMT

#define FXP_Q4_FMT   "%d.%04d"

Typedef Documentation

◆ fixed20_12

typedef union dfixed fixed20_12