intel_extreme: check internal crt feature in VBT for analog probe on DDI

* also uses the BAR size when dumping regs (as done by the intel_reg tool).

Change-Id: Ie29768afc8f9c42bb9a03b2866db34c4b0e43b7d
Reviewed-on: https://review.haiku-os.org/c/haiku/+/5334
Reviewed-by: Jérôme Duval <[email protected]>
Tested-by: Commit checker robot <[email protected]>
This commit is contained in:
Jérôme Duval
2022-05-24 15:52:46 +00:00
parent 5e5bb3318e
commit 59ce1ffe61
4 changed files with 71 additions and 6 deletions
@@ -476,6 +476,7 @@ struct intel_shared_info {
edid1_info vesa_edid_info;
bool has_vesa_edid_info;
bool internal_crt_support;
uint32 device_config_count;
child_device_config device_configs[10];
};
@@ -55,10 +55,13 @@ dump_registers()
ERROR("%s: Taking register dump #%" B_PRId32 "\n", __func__, gDumpCount);
area_info areaInfo;
get_area_info(gInfo->shared_info->registers_area, &areaInfo);
int fd = open(filename, O_CREAT | O_WRONLY, 0644);
uint32 data = 0;
if (fd >= 0) {
for (int32 i = 0; i < 0x80000; i += sizeof(data)) {
for (uint32 i = 0; i < areaInfo.size; i += sizeof(data)) {
//char line[512];
//int length = sprintf(line, "%05" B_PRIx32 ": "
// "%08" B_PRIx32 " %08" B_PRIx32 " %08" B_PRIx32 " %08" B_PRIx32 "\n",
@@ -391,7 +394,8 @@ probe_ports()
}
// then finally always try the analog port when chipsets supports it
if (gInfo->shared_info->device_type.Generation() <= 8) {
if (gInfo->shared_info->device_type.Generation() <= 8
&& gInfo->shared_info->internal_crt_support) {
TRACE("Probing Analog\n");
Port* analogPort = new(std::nothrow) AnalogPort();
if (analogPort == NULL)
@@ -44,7 +44,8 @@ struct bdb_header {
enum bdb_block_id {
BDB_GENERAL_DEFINITIONS = 2,
BDB_GENERAL_FEATURES = 1,
BDB_GENERAL_DEFINITIONS,
BDB_LVDS_OPTIONS = 40,
BDB_LVDS_LFP_DATA_PTRS = 41,
BDB_LVDS_BACKLIGHT = 43,
@@ -52,6 +53,52 @@ enum bdb_block_id {
};
struct bdb_general_features {
uint8 id;
uint16 size;
uint8 panel_fitting: 2;
bool flexaim: 1;
bool msg_enable: 1;
uint8 clear_screen: 3;
bool color_flip: 1;
bool download_ext_vbt: 1;
bool enable_ssc: 1;
bool ssc_freq: 1;
bool enable_lfp_on_override: 1;
bool disable_ssc_ddt: 1;
bool underscan_vga_timings: 1;
bool display_clock_mode: 1;
bool vbios_hotplug_support: 1;
bool disable_smooth_vision: 1;
bool single_dvi: 1;
bool rotate_180: 1;
bool fdi_rx_polarity_inverted: 1;
bool vbios_extended_mode: 1;
bool copy_ilfp_dtd_to_svo_lvds_dtd: 1;
bool panel_best_fit_timing: 1;
bool ignore_strap_state: 1;
uint8 legacy_monitor_detect;
bool int_crt_support: 1;
bool int_tv_support: 1;
bool int_efp_support: 1;
bool dp_ssc_enable: 1;
bool dp_ssc_freq: 1;
bool dp_ssc_dongle_supported: 1;
uint8 rsvd11: 2;
uint8 tc_hpd_retry_timeout: 7;
bool rsvd12: 1;
uint8 afc_startup_config: 2;
uint8 rsvd13: 6;
} __attribute__((packed));
struct bdb_general_definitions {
uint8 id;
uint16 size;
@@ -465,6 +512,19 @@ parse_vbt_from_bios(struct intel_shared_info* info)
int id = vbios.memory[start];
blockSize = vbios.ReadWord(start + 1) + 3;
switch (id) {
case BDB_GENERAL_FEATURES:
{
struct bdb_general_features* features;
features = (struct bdb_general_features*)(vbios.memory + start);
if (bdb->version >= 155
&& (info->device_type.HasDDI()
|| info->device_type.InGroup(INTEL_GROUP_VLV))) {
info->internal_crt_support = features->int_crt_support;
TRACE((DEVICE_NAME ": internal_crt_support: 0x%x\n",
info->internal_crt_support));
}
break;
}
case BDB_GENERAL_DEFINITIONS:
{
info->device_config_count = 0;
@@ -747,6 +747,9 @@ intel_extreme_init(intel_info &info)
info.shared_info->frame_buffer = 0;
info.shared_info->dpms_mode = B_DPMS_ON;
info.shared_info->min_brightness = 2;
info.shared_info->internal_crt_support = true;
info.shared_info->pch_info = info.pch_info;
info.shared_info->device_type = info.device_type;
// Pull VBIOS info for later use
info.shared_info->got_vbt = parse_vbt_from_bios(info.shared_info);
@@ -806,9 +809,6 @@ intel_extreme_init(intel_info &info)
info.shared_info->pll_info.divisor_register = INTEL_DISPLAY_A_PLL_DIVISOR_0;
info.shared_info->pch_info = info.pch_info;
info.shared_info->device_type = info.device_type;
#ifdef __HAIKU__
strlcpy(info.shared_info->device_identifier, info.device_identifier,
sizeof(info.shared_info->device_identifier));