123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168 |
- #ifndef _SDE_EDID_PARSER_H_
- #define _SDE_EDID_PARSER_H_
- #include <linux/types.h>
- #include <linux/bitops.h>
- #include <linux/debugfs.h>
- #include <linux/of_device.h>
- #include <linux/i2c.h>
- #include <drm/drm_crtc.h>
- #include <drm/drm_edid.h>
- #define MAX_NUMBER_ADB 5
- #define MAX_AUDIO_DATA_BLOCK_SIZE 30
- #define MAX_SPKR_ALLOC_DATA_BLOCK_SIZE 3
- #define EDID_VENDOR_ID_SIZE 4
- #define SDE_CEA_EXT 0x02
- #define SDE_EXTENDED_TAG 0x07
- #define SDE_DRM_MODE_FLAG_FMT_MASK (0x3 << 20)
- #define VSVDB_HDR10_PLUS_IEEE_CODE 0x90848b
- #define VSVDB_HDR10_PLUS_APP_VER_MASK 0x3
- enum luminance_value {
- NO_LUMINANCE_DATA = 3,
- MAXIMUM_LUMINANCE = 4,
- FRAME_AVERAGE_LUMINANCE = 5,
- MINIMUM_LUMINANCE = 6
- };
- enum extended_data_block_types {
- VIDEO_CAPABILITY_DATA_BLOCK = 0x0,
- VENDOR_SPECIFIC_VIDEO_DATA_BLOCK = 0x01,
- HDMI_VIDEO_DATA_BLOCK = 0x04,
- COLORIMETRY_EXTENDED_DATA_BLOCK = 0x5,
- HDR_STATIC_METADATA_DATA_BLOCK = 0x06,
- Y420_VIDEO_DATA_BLOCK = 0x0E,
- VIDEO_FORMAT_PREFERENCE_DATA_BLOCK = 0x0D,
- Y420_CAPABILITY_MAP_DATA_BLOCK = 0x0F,
- VENDOR_SPECIFIC_AUDIO_DATA_BLOCK = 0x11,
- INFOFRAME_DATA_BLOCK = 0x20,
- };
- #ifdef SDE_EDID_DEBUG_ENABLE
- #define SDE_EDID_DEBUG(fmt, args...) SDE_ERROR(fmt, ##args)
- #else
- #define SDE_EDID_DEBUG(fmt, args...) SDE_DEBUG(fmt, ##args)
- #endif
- struct sde_edid_hdr_data {
- u32 eotf;
- bool metadata_type_one;
- u32 max_luminance;
- u32 avg_luminance;
- u32 min_luminance;
- };
- struct sde_edid_sink_caps {
- u32 max_pclk_in_hz;
- bool scdc_present;
- bool scramble_support;
- bool read_req_support;
- bool osd_disparity;
- bool dual_view_support;
- bool ind_view_support;
- };
- struct sde_edid_ctrl {
- struct edid *edid;
- u8 pt_scan_info;
- u8 it_scan_info;
- u8 ce_scan_info;
- u8 audio_data_block[MAX_NUMBER_ADB * MAX_AUDIO_DATA_BLOCK_SIZE];
- int adb_size;
- u8 spkr_alloc_data_block[MAX_SPKR_ALLOC_DATA_BLOCK_SIZE];
- int sadb_size;
- bool hdr_supported;
- char vendor_id[EDID_VENDOR_ID_SIZE];
- struct sde_edid_sink_caps sink_caps;
- struct sde_edid_hdr_data hdr_data;
- };
- struct sde_edid_ctrl *sde_edid_init(void);
- void sde_edid_deinit(void **edid_ctrl);
- void sde_get_edid(struct drm_connector *connector,
- struct i2c_adapter *adapter,
- void **edid_ctrl);
- void sde_parse_edid(void *edid_ctrl);
- void sde_free_edid(void **edid_ctrl);
- bool sde_detect_hdmi_monitor(void *edid_ctrl);
- u8 sde_get_edid_checksum(void *input);
- int _sde_edid_update_modes(struct drm_connector *connector,
- void *edid_ctrl);
- #endif
|