drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_color.h
Extension
.h
Size
4745 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

#ifndef __AMDGPU_DM_COLOR_H__
#define __AMDGPU_DM_COLOR_H__

#define MAX_DRM_LUT_VALUE    0xFFFF
#define MAX_DRM_LUT32_VALUE  0xFFFFFFFF

#include <linux/types.h>

struct drm_color_lut;
struct drm_color_lut32;
struct drm_color_ctm;
struct drm_color_ctm_3x4;
struct drm_colorop_state;
struct drm_property_blob;
struct dc_gamma;
struct dc_rgb;
struct dc_plane_state;
struct fixed31_32;
struct tetrahedral_params;
struct dc_transfer_func;

#if IS_ENABLED(CONFIG_DRM_AMD_DC_KUNIT_TEST)
/*
 * Prototypes for functions exposed to KUnit tests. The enum types
 * used below (dc_transfer_func_predefined, amdgpu_transfer_function,
 * drm_colorop_curve_1d_type) must be defined before this header is
 * included — the source file (amdgpu_dm_color.c) ensures this via
 * its own includes of dc.h, amdgpu_dm.h, and drm/drm_colorop.h.
 */
struct fixed31_32 amdgpu_dm_fixpt_from_s3132(__u64 x);
bool __is_lut_linear(const struct drm_color_lut *lut, uint32_t size);
void __drm_lut_to_dc_gamma(const struct drm_color_lut *lut,
			    struct dc_gamma *gamma, bool is_legacy);
void __drm_lut32_to_dc_gamma(const struct drm_color_lut32 *lut,
			      struct dc_gamma *gamma);
void __drm_ctm_to_dc_matrix(const struct drm_color_ctm *ctm,
			     struct fixed31_32 *matrix);
void __drm_ctm_3x4_to_dc_matrix(const struct drm_color_ctm_3x4 *ctm,
				 struct fixed31_32 *matrix);
enum dc_transfer_func_predefined
amdgpu_tf_to_dc_tf(enum amdgpu_transfer_function tf);
enum dc_transfer_func_predefined
amdgpu_colorop_tf_to_dc_tf(enum drm_colorop_curve_1d_type tf);
const struct drm_color_lut *
__extract_blob_lut(const struct drm_property_blob *blob, uint32_t *size);
const struct drm_color_lut32 *
__extract_blob_lut32(const struct drm_property_blob *blob, uint32_t *size);
void __to_dc_lut3d_color(struct dc_rgb *rgb,
			 const struct drm_color_lut lut,
			 int bit_precision);
void __drm_3dlut_to_dc_3dlut(const struct drm_color_lut *lut,
			     uint32_t lut3d_size,
			     struct tetrahedral_params *params,
			     bool use_tetrahedral_9,
			     int bit_depth);
void __to_dc_lut3d_32_color(struct dc_rgb *rgb,
			    const struct drm_color_lut32 lut,
			    int bit_precision);
void __drm_3dlut32_to_dc_3dlut(const struct drm_color_lut32 *lut,
				uint32_t lut3d_size,
				struct tetrahedral_params *params,
				bool use_tetrahedral_9,
				int bit_depth);
struct dc_3dlut;
void amdgpu_dm_atomic_lut3d(const struct drm_color_lut *drm_lut3d,
			     uint32_t drm_lut3d_size,
			     struct dc_3dlut *lut);
int __set_colorop_3dlut(const struct drm_color_lut32 *drm_lut3d,
			uint32_t drm_lut3d_size,
			struct dc_3dlut *lut);
void __set_tf_bypass(struct dc_transfer_func *tf);
void __set_tf_distributed_points(struct dc_transfer_func *tf,
				 enum dc_transfer_func_predefined predefined_tf);
int amdgpu_dm_set_atomic_regamma(struct dc_transfer_func *out_tf,
				 const struct drm_color_lut *regamma_lut,
				 uint32_t regamma_size, bool has_rom,
				 enum dc_transfer_func_predefined tf);
int amdgpu_dm_atomic_shaper_lut(const struct drm_color_lut *shaper_lut,
				bool has_rom,
				enum dc_transfer_func_predefined tf,
				uint32_t shaper_size,
				struct dc_transfer_func *func_shaper);
int amdgpu_dm_atomic_blend_lut(const struct drm_color_lut *blend_lut,
			       bool has_rom,
			       enum dc_transfer_func_predefined tf,
			       uint32_t blend_size,
			       struct dc_transfer_func *func_blend);
int __set_colorop_in_tf_1d_curve(struct dc_plane_state *dc_plane_state,
				 struct drm_colorop_state *colorop_state);
#endif

Annotation

Implementation Notes