Skip to content

Commit

Permalink
intel_extreme: use VESA EDID info as fallback.
Browse files Browse the repository at this point in the history
* Only in case retrieving EDID info failed on head A and C.
* Should help with detecting the native resolution for ticket #10878.
  • Loading branch information
axeld committed Jun 3, 2014
1 parent 5336a8d commit c1400fb
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 6 deletions.
7 changes: 6 additions & 1 deletion headers/private/graphics/intel_extreme/intel_extreme.h
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2009, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2014, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
Expand All @@ -15,6 +15,8 @@
#include <Drivers.h>
#include <PCI.h>

#include <edid.h>


#define VENDOR_ID_INTEL 0x8086

Expand Down Expand Up @@ -201,6 +203,9 @@ struct intel_shared_info {
DeviceType device_type;
char device_identifier[32];
struct pll_info pll_info;

edid1_info vesa_edid_info;
bool has_vesa_edid_info;
};

//----------------- ioctl() interface ----------------
Expand Down
12 changes: 9 additions & 3 deletions src/add-ons/accelerants/intel_extreme/mode.cpp
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2013, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2014, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Support for i915 chipset and up based on the X driver,
Expand Down Expand Up @@ -592,15 +592,21 @@ create_mode_list(void)
if (gInfo->shared_info->single_head_locked)
gInfo->head_mode = HEAD_MODE_A_ANALOG;
} else {
TRACE("getting EDID on port A (analog) failed : %s. "
TRACE("getting EDID on port A (analog) failed: %s. "
"Trying on port C (lvds)\n", strerror(error));
bus.cookie = (void*)INTEL_I2C_IO_C;
error = ddc2_read_edid1(&bus, &gInfo->edid_info, NULL, NULL);
if (error == B_OK) {
edid_dump(&gInfo->edid_info);
gInfo->has_edid = true;
} else if (gInfo->shared_info->has_vesa_edid_info) {
TRACE("getting EDID on port C failed: %s. Use VESA EDID info\n",
strerror(error));
memcpy(&gInfo->edid_info, &gInfo->shared_info->vesa_edid_info,
sizeof(edid1_info));
gInfo->has_edid = true;
} else {
TRACE("getting EDID on port C failed : %s\n",
TRACE("getting EDID on port C failed: %s\n",
strerror(error));

// We could not read any EDID info. Fallback to creating a list with
Expand Down
1 change: 1 addition & 0 deletions src/add-ons/kernel/drivers/graphics/intel_extreme/Jamfile
Expand Up @@ -3,6 +3,7 @@ SubDir HAIKU_TOP src add-ons kernel drivers graphics intel_extreme ;
SetSubDirSupportedPlatformsBeOSCompatible ;

UsePrivateHeaders [ FDirName graphics intel_extreme ] ;
UsePrivateHeaders [ FDirName graphics vesa ] ;
UsePrivateHeaders [ FDirName graphics common ] ;
UsePrivateHeaders graphics ;
UsePrivateKernelHeaders ;
Expand Down
@@ -1,5 +1,5 @@
/*
* Copyright 2006-2010, Haiku, Inc. All Rights Reserved.
* Copyright 2006-2014, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
Expand All @@ -14,12 +14,16 @@
#include <stdio.h>
#include <string.h>
#include <errno.h>

#include <boot_item.h>
#include <driver_settings.h>
#include <util/kernel_cpp.h>
#include "utility.h"

#include <vesa_info.h>

#include "driver.h"
#include "power.h"
#include "utility.h"


#define TRACE_INTELEXTREME
Expand Down Expand Up @@ -395,6 +399,13 @@ intel_extreme_init(intel_info &info)
&info.shared_info->physical_cursor_memory);
}

edid1_info* edidInfo = (edid1_info*)get_boot_item(VESA_EDID_BOOT_INFO,
NULL);
if (edidInfo != NULL) {
info.shared_info->has_vesa_edid_info = true;
memcpy(&info.shared_info->vesa_edid_info, edidInfo, sizeof(edid1_info));
}

init_interrupt_handler(info);

TRACE("%s: completed successfully!\n", __func__);
Expand Down

0 comments on commit c1400fb

Please sign in to comment.