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.

Dependency Surface

Detected Declarations

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

Implementation Notes