drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/amd/display/dc/dml/dml_inline_defs.h- Extension
.h- Size
- 3832 bytes
- Lines
- 161
- 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.
Dependency Surface
dcn_calc_math.hdml_logger.h
Detected Declarations
function filesfunction dml_min3function dml_min4function dml_maxfunction dml_max3function dml_max4function dml_max5function dml_ceilfunction dml_floorfunction dml_roundfunction dml_log2function dml_log2function dml_powfunction dml_fmodfunction dml_ceil_2function dml_ceil_exfunction dml_floor_exfunction dml_round_to_multiplefunction dml_abs
Annotated Snippet
#ifndef __DML_INLINE_DEFS_H__
#define __DML_INLINE_DEFS_H__
#include "dcn_calc_math.h"
#include "dml_logger.h"
static inline double dml_min(double a, double b)
{
return (double)dcn_bw_min2((float)a, (float)b);
}
static inline double dml_min3(double a, double b, double c)
{
return dml_min(dml_min(a, b), c);
}
static inline double dml_min4(double a, double b, double c, double d)
{
return dml_min(dml_min(a, b), dml_min(c, d));
}
static inline double dml_max(double a, double b)
{
return (double)dcn_bw_max2((float)a, (float)b);
}
static inline double dml_max3(double a, double b, double c)
{
return dml_max(dml_max(a, b), c);
}
static inline double dml_max4(double a, double b, double c, double d)
{
return dml_max(dml_max(a, b), dml_max(c, d));
}
static inline double dml_max5(double a, double b, double c, double d, double e)
{
return dml_max(dml_max4(a, b, c, d), e);
}
static inline double dml_ceil(double a, double granularity)
{
if (granularity == 0)
return 0;
return (double)dcn_bw_ceil2((float)a, (float)granularity);
}
static inline double dml_floor(double a, double granularity)
{
if (granularity == 0)
return 0;
return (double)dcn_bw_floor2((float)a, (float)granularity);
}
static inline double dml_round(double a)
{
const double round_pt = 0.5;
return dml_floor(a + round_pt, 1);
}
/* float
static inline int dml_log2(float x)
{
unsigned int ix = *((unsigned int *)&x);
return (int)((ix >> 23) & 0xff) - 127;
}*/
/* double */
static inline int dml_log2(double x)
{
unsigned long long ix = *((unsigned long long *)&x);
return (int)((ix >> 52) & 0x7ff) - 1023;
}
static inline double dml_pow(double a, int exp)
{
return (double)dcn_bw_pow((float)a, (float)exp);
}
static inline double dml_fmod(double f, int val)
{
return (double)dcn_bw_mod((float)f, (float)val);
}
static inline double dml_ceil_2(double f)
{
Annotation
- Immediate include surface: `dcn_calc_math.h`, `dml_logger.h`.
- Detected declarations: `function files`, `function dml_min3`, `function dml_min4`, `function dml_max`, `function dml_max3`, `function dml_max4`, `function dml_max5`, `function dml_ceil`, `function dml_floor`, `function dml_round`.
- 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.