drivers/gpu/drm/amd/display/dc/inc/bw_fixed.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/inc/bw_fixed.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/inc/bw_fixed.h- Extension
.h- Size
- 4771 bytes
- Lines
- 167
- 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 bw_fixedfunction bw_min2function bw_max2function bw_min3function bw_max3function bw_int_to_fixedfunction bw_fixed_to_intfunction fixed31_32_to_bw_fixedfunction bw_addfunction bw_subfunction bw_divfunction bw_modfunction bw_equfunction bw_neqfunction bw_leqfunction bw_meqfunction bw_ltnfunction bw_mtn
Annotated Snippet
struct bw_fixed {
int64_t value;
};
#define BW_FIXED_MIN_I32 \
(int64_t)(-(1LL << (63 - BW_FIXED_BITS_PER_FRACTIONAL_PART)))
#define BW_FIXED_MAX_I32 \
(int64_t)((1ULL << (63 - BW_FIXED_BITS_PER_FRACTIONAL_PART)) - 1)
static inline struct bw_fixed bw_min2(const struct bw_fixed arg1,
const struct bw_fixed arg2)
{
return (arg1.value <= arg2.value) ? arg1 : arg2;
}
static inline struct bw_fixed bw_max2(const struct bw_fixed arg1,
const struct bw_fixed arg2)
{
return (arg2.value <= arg1.value) ? arg1 : arg2;
}
static inline struct bw_fixed bw_min3(struct bw_fixed v1,
struct bw_fixed v2,
struct bw_fixed v3)
{
return bw_min2(bw_min2(v1, v2), v3);
}
static inline struct bw_fixed bw_max3(struct bw_fixed v1,
struct bw_fixed v2,
struct bw_fixed v3)
{
return bw_max2(bw_max2(v1, v2), v3);
}
struct bw_fixed bw_int_to_fixed_nonconst(int64_t value);
static inline struct bw_fixed bw_int_to_fixed(int64_t value)
{
if (__builtin_constant_p(value)) {
struct bw_fixed res;
BUILD_BUG_ON(value > BW_FIXED_MAX_I32 || value < BW_FIXED_MIN_I32);
res.value = value << BW_FIXED_BITS_PER_FRACTIONAL_PART;
return res;
} else
return bw_int_to_fixed_nonconst(value);
}
static inline int32_t bw_fixed_to_int(struct bw_fixed value)
{
return (int32_t)BW_FIXED_GET_INTEGER_PART(value.value);
}
struct bw_fixed bw_frc_to_fixed(int64_t num, int64_t denum);
static inline struct bw_fixed fixed31_32_to_bw_fixed(int64_t raw)
{
struct bw_fixed result = { 0 };
if (raw < 0) {
raw = -raw;
result.value = -(raw >> (32 - BW_FIXED_BITS_PER_FRACTIONAL_PART));
} else {
result.value = raw >> (32 - BW_FIXED_BITS_PER_FRACTIONAL_PART);
}
return result;
}
static inline struct bw_fixed bw_add(const struct bw_fixed arg1,
const struct bw_fixed arg2)
{
struct bw_fixed res;
res.value = arg1.value + arg2.value;
return res;
}
static inline struct bw_fixed bw_sub(const struct bw_fixed arg1, const struct bw_fixed arg2)
{
struct bw_fixed res;
res.value = arg1.value - arg2.value;
return res;
}
struct bw_fixed bw_mul(const struct bw_fixed arg1, const struct bw_fixed arg2);
static inline struct bw_fixed bw_div(const struct bw_fixed arg1, const struct bw_fixed arg2)
Annotation
- Detected declarations: `struct bw_fixed`, `function bw_min2`, `function bw_max2`, `function bw_min3`, `function bw_max3`, `function bw_int_to_fixed`, `function bw_fixed_to_int`, `function fixed31_32_to_bw_fixed`, `function bw_add`, `function bw_sub`.
- 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.