include/drm/drm_fixed.h
Source file repositories/reference/linux-study-clean/include/drm/drm_fixed.h
File Facts
- System
- Linux kernel
- Corpus path
include/drm/drm_fixed.h- Extension
.h- Size
- 5680 bytes
- Lines
- 259
- Domain
- Repository Root And Misc
- Bucket
- include
- Inferred role
- Repository Root And Misc: implementation source
- Status
- source implementation candidate
Why This File Exists
Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
- Top-level or miscellaneous repository surface. Use this as map coverage unless a later manual pass promotes the file into a deeper subsystem dossier.
Dependency Surface
linux/math64.hlinux/types.hlinux/wordpart.h
Detected Declarations
function dfixed_floorfunction dfixed_ceilfunction dfixed_divfunction drm_sm2fixpfunction drm_int2fixpfunction drm_fixp2intfunction drm_fixp2int_roundfunction drm_fixp2int_ceilfunction drm_fixp_msbsetfunction drm_fixp_mulfunction drm_fixp_divfunction drm_fixp_from_fractionfunction drm_fixp_expfunction fxp_q4_from_intfunction fxp_q4_to_intfunction fxp_q4_to_int_roundupfunction fxp_q4_to_frac
Annotated Snippet
if (rem >= b_abs) {
res_abs |= 1;
rem -= b_abs;
}
} while (--i != 0);
}
/* round up LSB */
{
u64 summand = (rem << 1) >= b_abs;
res_abs += summand;
}
res = (s64) res_abs;
if (a_neg ^ b_neg)
res = -res;
return res;
}
static inline s64 drm_fixp_exp(s64 x)
{
s64 tolerance = div64_s64(DRM_FIXED_ONE, 1000000);
s64 sum = DRM_FIXED_ONE, term, y = x;
u64 count = 1;
if (x < 0)
y = -1 * x;
term = y;
while (term >= tolerance) {
sum = sum + term;
count = count + 1;
term = drm_fixp_mul(term, div64_s64(y, count));
}
if (x < 0)
sum = drm_fixp_div(DRM_FIXED_ONE, sum);
return sum;
}
static inline int fxp_q4_from_int(int val_int)
{
return val_int << 4;
}
static inline int fxp_q4_to_int(int val_q4)
{
return val_q4 >> 4;
}
static inline int fxp_q4_to_int_roundup(int val_q4)
{
return (val_q4 + 0xf) >> 4;
}
static inline int fxp_q4_to_frac(int val_q4)
{
return val_q4 & 0xf;
}
#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)
#endif
Annotation
- Immediate include surface: `linux/math64.h`, `linux/types.h`, `linux/wordpart.h`.
- Detected declarations: `function dfixed_floor`, `function dfixed_ceil`, `function dfixed_div`, `function drm_sm2fixp`, `function drm_int2fixp`, `function drm_fixp2int`, `function drm_fixp2int_round`, `function drm_fixp2int_ceil`, `function drm_fixp_msbset`, `function drm_fixp_mul`.
- Atlas domain: Repository Root And Misc / include.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.