drivers/gpu/drm/amd/display/include/fixed31_32.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/include/fixed31_32.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/include/fixed31_32.h- Extension
.h- Size
- 11663 bytes
- Lines
- 541
- Domain
- Driver Families
- Bucket
- drivers/gpu
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
- No C-style include directives detected by the generator.
Detected Declarations
struct fixed31_32function dc_fixpt_from_intfunction dc_fixpt_negfunction dc_fixpt_absfunction dc_fixpt_ltfunction dc_fixpt_lefunction dc_fixpt_eqfunction dc_fixpt_minfunction dc_fixpt_maxfunction dc_fixpt_clampfunction dc_fixpt_shlfunction dc_fixpt_shrfunction dc_fixpt_addfunction dc_fixpt_add_intfunction dc_fixpt_subfunction dc_fixpt_sub_intfunction dc_fixpt_mul_intfunction dc_fixpt_div_intfunction dc_fixpt_divfunction dc_fixpt_powfunction dc_fixpt_floorfunction dc_fixpt_roundfunction dc_fixpt_ceilfunction dc_fixpt_truncate
Annotated Snippet
struct fixed31_32 {
long long value;
};
/*
* @brief
* Useful constants
*/
static const struct fixed31_32 dc_fixpt_zero = { 0 };
static const struct fixed31_32 dc_fixpt_epsilon = { 1LL };
static const struct fixed31_32 dc_fixpt_half = { 0x80000000LL };
static const struct fixed31_32 dc_fixpt_one = { 0x100000000LL };
/*
* @brief
* Initialization routines
*/
/*
* @brief
* result = numerator / denominator
*/
struct fixed31_32 dc_fixpt_from_fraction(long long numerator, long long denominator);
/*
* @brief
* result = arg
*/
static inline struct fixed31_32 dc_fixpt_from_int(int arg)
{
struct fixed31_32 res;
res.value = (long long) arg << FIXED31_32_BITS_PER_FRACTIONAL_PART;
return res;
}
/*
* @brief
* Unary operators
*/
/*
* @brief
* result = -arg
*/
static inline struct fixed31_32 dc_fixpt_neg(struct fixed31_32 arg)
{
struct fixed31_32 res;
res.value = -arg.value;
return res;
}
/*
* @brief
* result = abs(arg) := (arg >= 0) ? arg : -arg
*/
static inline struct fixed31_32 dc_fixpt_abs(struct fixed31_32 arg)
{
if (arg.value < 0)
return dc_fixpt_neg(arg);
else
return arg;
}
/*
* @brief
* Binary relational operators
*/
/*
* @brief
* result = arg1 < arg2
*/
static inline bool dc_fixpt_lt(struct fixed31_32 arg1, struct fixed31_32 arg2)
{
return arg1.value < arg2.value;
}
/*
* @brief
* result = arg1 <= arg2
*/
static inline bool dc_fixpt_le(struct fixed31_32 arg1, struct fixed31_32 arg2)
{
return arg1.value <= arg2.value;
Annotation
- Detected declarations: `struct fixed31_32`, `function dc_fixpt_from_int`, `function dc_fixpt_neg`, `function dc_fixpt_abs`, `function dc_fixpt_lt`, `function dc_fixpt_le`, `function dc_fixpt_eq`, `function dc_fixpt_min`, `function dc_fixpt_max`, `function dc_fixpt_clamp`.
- Atlas domain: Driver Families / drivers/gpu.
- 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.