0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025 #ifndef __DAL_DSC_H__
0026 #define __DAL_DSC_H__
0027
0028 #include "dc_dsc.h"
0029 #include "dc_hw_types.h"
0030 #include "dc_types.h"
0031
0032
0033
0034
0035
0036
0037 struct dsc_config {
0038 uint32_t pic_width;
0039 uint32_t pic_height;
0040 enum dc_pixel_encoding pixel_encoding;
0041 enum dc_color_depth color_depth;
0042 bool is_odm;
0043 struct dc_dsc_config dc_dsc_cfg;
0044 };
0045
0046
0047
0048 struct dsc_optc_config {
0049 uint32_t slice_width;
0050 uint32_t bytes_per_pixel;
0051 bool is_pixel_format_444;
0052 };
0053
0054
0055 struct dcn_dsc_state {
0056 uint32_t dsc_clock_en;
0057 uint32_t dsc_slice_width;
0058 uint32_t dsc_bits_per_pixel;
0059 uint32_t dsc_slice_height;
0060 uint32_t dsc_pic_width;
0061 uint32_t dsc_pic_height;
0062 uint32_t dsc_slice_bpg_offset;
0063 uint32_t dsc_chunk_size;
0064 uint32_t dsc_fw_en;
0065 uint32_t dsc_opp_source;
0066 };
0067
0068
0069
0070
0071
0072 union dsc_enc_slice_caps {
0073 struct {
0074 uint8_t NUM_SLICES_1 : 1;
0075 uint8_t NUM_SLICES_2 : 1;
0076 uint8_t NUM_SLICES_3 : 1;
0077 uint8_t NUM_SLICES_4 : 1;
0078 uint8_t NUM_SLICES_8 : 1;
0079 } bits;
0080 uint8_t raw;
0081 };
0082
0083 struct dsc_enc_caps {
0084 uint8_t dsc_version;
0085 union dsc_enc_slice_caps slice_caps;
0086 int32_t lb_bit_depth;
0087 bool is_block_pred_supported;
0088 union dsc_color_formats color_formats;
0089 union dsc_color_depth color_depth;
0090 int32_t max_total_throughput_mps;
0091 int32_t max_slice_width;
0092 uint32_t bpp_increment_div;
0093 uint32_t edp_sink_max_bits_per_pixel;
0094 bool is_dp;
0095 };
0096
0097 struct dsc_funcs {
0098 void (*dsc_get_enc_caps)(struct dsc_enc_caps *dsc_enc_caps, int pixel_clock_100Hz);
0099 void (*dsc_read_state)(struct display_stream_compressor *dsc, struct dcn_dsc_state *s);
0100 bool (*dsc_validate_stream)(struct display_stream_compressor *dsc, const struct dsc_config *dsc_cfg);
0101 void (*dsc_set_config)(struct display_stream_compressor *dsc, const struct dsc_config *dsc_cfg,
0102 struct dsc_optc_config *dsc_optc_cfg);
0103 bool (*dsc_get_packed_pps)(struct display_stream_compressor *dsc, const struct dsc_config *dsc_cfg,
0104 uint8_t *dsc_packed_pps);
0105 void (*dsc_enable)(struct display_stream_compressor *dsc, int opp_pipe);
0106 void (*dsc_disable)(struct display_stream_compressor *dsc);
0107 void (*dsc_disconnect)(struct display_stream_compressor *dsc);
0108 };
0109
0110 #endif