drivers/gpu/drm/amd/display/modules/color/color_gamma.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/modules/color/color_gamma.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/display/modules/color/color_gamma.h
Extension
.h
Size
4042 bytes
Lines
119
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

struct regamma_ramp {
	unsigned short gamma[256*3];  // gamma ramp packed  in same way as OS windows ,r , g & b
};

struct regamma_coeff {
	int    gamma[3];
	int    A0[3];
	int    A1[3];
	int    A2[3];
	int    A3[3];
};

struct regamma_lut {
	union regamma_flags flags;
	union {
		struct regamma_ramp ramp;
		struct regamma_coeff coeff;
	};
};

struct hdr_tm_params {
	unsigned int sdr_white_level;
	unsigned int min_content; // luminance in 1/10000 nits
	unsigned int max_content; // luminance in nits
	unsigned int min_display; // luminance in 1/10000 nits
	unsigned int max_display; // luminance in nits
	unsigned int skip_tm; // skip tm
};

struct calculate_buffer {
	int buffer_index;
	struct fixed31_32 buffer[NUM_PTS_IN_REGION];
	struct fixed31_32 gamma_of_2;
};

struct translate_from_linear_space_args {
	struct fixed31_32 arg;
	struct fixed31_32 a0;
	struct fixed31_32 a1;
	struct fixed31_32 a2;
	struct fixed31_32 a3;
	struct fixed31_32 gamma;
	struct calculate_buffer *cal_buffer;
};

void setup_x_points_distribution(void);
void log_x_points_distribution(struct dal_logger *logger);
void precompute_pq(void);
void precompute_de_pq(void);

bool mod_color_calculate_regamma_params(struct dc_transfer_func *output_tf,
		const struct dc_gamma *ramp, bool mapUserRamp, bool canRomBeUsed,
		const struct hdr_tm_params *fs_params,
		struct calculate_buffer *cal_buffer);

bool mod_color_calculate_degamma_params(struct dc_color_caps *dc_caps,
		struct dc_transfer_func *output_tf,
		const struct dc_gamma *ramp, bool mapUserRamp);

#endif /* COLOR_MOD_COLOR_GAMMA_H_ */

Annotation

Implementation Notes