drm/amd/display: move color_transfer_func to color mod
[linux-block.git] / drivers / gpu / drm / amd / display / dc / dc.h
index d6d56611604eb417e47d009e1f0119305cb2ab91..0f566a1ba35b3a56499662062de1fa6457335ebb 100644 (file)
@@ -38,7 +38,7 @@
 #include "inc/compressor.h"
 #include "dml/display_mode_lib.h"
 
-#define DC_VER "3.1.27"
+#define DC_VER "3.1.41"
 
 #define MAX_SURFACES 3
 #define MAX_STREAMS 6
 /*******************************************************************************
  * Display Core Interfaces
  ******************************************************************************/
+struct dmcu_version {
+       unsigned int date;
+       unsigned int month;
+       unsigned int year;
+       unsigned int interface_version;
+};
+
+struct dc_versions {
+       const char *dc_ver;
+       struct dmcu_version dmcu_version;
+};
+
 struct dc_caps {
        uint32_t max_streams;
        uint32_t max_links;
@@ -95,6 +107,7 @@ struct dc_surface_dcc_cap {
 };
 
 struct dc_static_screen_events {
+       bool force_trigger;
        bool cursor_update;
        bool surface_update;
        bool overlay_update;
@@ -171,6 +184,16 @@ enum wm_report_mode {
        WM_REPORT_OVERRIDE = 1,
 };
 
+struct dc_clocks {
+       int dispclk_khz;
+       int max_supported_dppclk_khz;
+       int dppclk_khz;
+       int dcfclk_khz;
+       int socclk_khz;
+       int dcfclk_deep_sleep_khz;
+       int fclk_khz;
+};
+
 struct dc_debug {
        bool surface_visual_confirm;
        bool sanity_checks;
@@ -179,6 +202,7 @@ struct dc_debug {
        bool timing_trace;
        bool clock_trace;
        bool validation_trace;
+       bool bandwidth_calcs_trace;
 
        /* stutter efficiency related */
        bool disable_stutter;
@@ -212,11 +236,15 @@ struct dc_debug {
        bool disable_stereo_support;
        bool vsr_support;
        bool performance_trace;
+       bool az_endpoint_mute_only;
+       bool always_use_regamma;
+       bool p010_mpo_support;
 };
 struct dc_state;
 struct resource_pool;
 struct dce_hwseq;
 struct dc {
+       struct dc_versions versions;
        struct dc_caps caps;
        struct dc_cap_funcs cap_funcs;
        struct dc_config config;
@@ -253,6 +281,8 @@ struct dc {
 
        bool optimized_required;
 
+       bool apply_edp_fast_boot_optimization;
+
        /* FBC compressor */
 #if defined(CONFIG_DRM_AMD_DC_FBC)
        struct compressor *fbc_compressor;
@@ -289,9 +319,6 @@ struct dc_init_data {
 
        struct dc_config flags;
        uint32_t log_mask;
-#if defined(CONFIG_DRM_AMD_DC_FBC)
-       uint64_t fbc_gpu_addr;
-#endif
 };
 
 struct dc *dc_create(const struct dc_init_data *init_params);
@@ -306,20 +333,6 @@ enum {
        TRANSFER_FUNC_POINTS = 1025
 };
 
-// Moved here from color module for linux
-enum color_transfer_func {
-       transfer_func_unknown,
-       transfer_func_srgb,
-       transfer_func_bt709,
-       transfer_func_pq2084,
-       transfer_func_pq2084_interim,
-       transfer_func_linear_0_1,
-       transfer_func_linear_0_125,
-       transfer_func_dolbyvision,
-       transfer_func_gamma_22,
-       transfer_func_gamma_26
-};
-
 struct dc_hdr_static_metadata {
        /* display chromaticities and white point in units of 0.00001 */
        unsigned int chromaticity_green_x;
@@ -335,9 +348,6 @@ struct dc_hdr_static_metadata {
        uint32_t max_luminance;
        uint32_t maximum_content_light_level;
        uint32_t maximum_frame_average_light_level;
-
-       bool hdr_supported;
-       bool is_hdr;
 };
 
 enum dc_transfer_func_type {
@@ -370,6 +380,8 @@ struct dc_transfer_func {
        struct dc_transfer_func_distributed_points tf_pts;
        enum dc_transfer_func_type type;
        enum dc_transfer_func_predefined tf;
+       /* FP16 1.0 reference level in nits, default is 80 nits, only for PQ*/
+       uint32_t sdr_ref_white_level;
        struct dc_context *ctx;
 };
 
@@ -391,19 +403,22 @@ union surface_update_flags {
                /* Medium updates */
                uint32_t dcc_change:1;
                uint32_t color_space_change:1;
-               uint32_t input_tf_change:1;
                uint32_t horizontal_mirror_change:1;
                uint32_t per_pixel_alpha_change:1;
                uint32_t rotation_change:1;
                uint32_t swizzle_change:1;
                uint32_t scaling_change:1;
                uint32_t position_change:1;
-               uint32_t in_transfer_func:1;
+               uint32_t in_transfer_func_change:1;
                uint32_t input_csc_change:1;
+               uint32_t coeff_reduction_change:1;
+               uint32_t output_tf_change:1;
+               uint32_t pixel_format_change:1;
 
                /* Full updates */
                uint32_t new_plane:1;
                uint32_t bpp_change:1;
+               uint32_t gamma_change:1;
                uint32_t bandwidth_change:1;
                uint32_t clock_change:1;
                uint32_t stereo_format_change:1;
@@ -415,6 +430,7 @@ union surface_update_flags {
 
 struct dc_plane_state {
        struct dc_plane_address address;
+       struct dc_plane_flip_time time;
        struct scaling_taps scaling_quality;
        struct rect src_rect;
        struct rect dst_rect;
@@ -428,14 +444,14 @@ struct dc_plane_state {
        struct dc_gamma *gamma_correction;
        struct dc_transfer_func *in_transfer_func;
        struct dc_bias_and_scale *bias_and_scale;
-       struct csc_transform input_csc_color_matrix;
+       struct dc_csc_transform input_csc_color_matrix;
        struct fixed31_32 coeff_reduction_factor;
+       uint32_t sdr_white_level;
 
        // TODO: No longer used, remove
        struct dc_hdr_static_metadata hdr_static_ctx;
 
        enum dc_color_space color_space;
-       enum color_transfer_func input_tf;
 
        enum surface_pixel_format format;
        enum dc_rotation_angle rotation;
@@ -465,7 +481,7 @@ struct dc_plane_info {
        enum dc_rotation_angle rotation;
        enum plane_stereo_format stereo_format;
        enum dc_color_space color_space;
-       enum color_transfer_func input_tf;
+       unsigned int sdr_white_level;
        bool horizontal_mirror;
        bool visible;
        bool per_pixel_alpha;
@@ -490,13 +506,10 @@ struct dc_surface_update {
        /* following updates require alloc/sleep/spin that is not isr safe,
         * null means no updates
         */
-       /* gamma TO BE REMOVED */
        struct dc_gamma *gamma;
-       enum color_transfer_func color_input_tf;
-       enum color_transfer_func color_output_tf;
        struct dc_transfer_func *in_transfer_func;
 
-       struct csc_transform *input_csc_color_matrix;
+       struct dc_csc_transform *input_csc_color_matrix;
        struct fixed31_32 *coeff_reduction_factor;
 };
 
@@ -525,6 +538,7 @@ struct dc_transfer_func *dc_create_transfer_func(void);
  */
 struct dc_flip_addrs {
        struct dc_plane_address address;
+       unsigned int flip_timestamp_in_us;
        bool flip_immediate;
        /* TODO: add flip duration for FreeSync */
 };
@@ -666,6 +680,7 @@ struct dc_cursor {
        struct dc_cursor_attributes attributes;
 };
 
+
 /*******************************************************************************
  * Interrupt interfaces
  ******************************************************************************/