* Added i830 as supported chipset - doesn't work perfectly, though. But Kyan reports

that at least 8 bit modes seems to work (but overlay only partially)
* Added "hardware_cursor" option to the settings file - when set to "false", you should
  have a cursor in the second output now as well.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@17498 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2006-05-17 17:30:23 +00:00
parent b0cdd6481d
commit 7902c46c3e
4 changed files with 31 additions and 16 deletions
@@ -53,7 +53,6 @@ struct ring_buffer {
struct overlay_registers; struct overlay_registers;
struct intel_shared_info { struct intel_shared_info {
int32 type;
area_id mode_list_area; // area containing display mode list area_id mode_list_area; // area containing display mode list
uint32 mode_count; uint32 mode_count;
@@ -83,6 +82,7 @@ struct intel_shared_info {
uint32 overlay_token; uint32 overlay_token;
uint8* physical_overlay_registers; uint8* physical_overlay_registers;
bool hardware_cursor_enabled;
sem_id vblank_sem; sem_id vblank_sem;
uint32 cursor_buffer_offset; uint32 cursor_buffer_offset;
@@ -137,7 +137,9 @@ init_common(int device, bool isClone)
gInfo->overlay_registers = (struct overlay_registers *)((uint8 *)gInfo->shared_info gInfo->overlay_registers = (struct overlay_registers *)((uint8 *)gInfo->shared_info
+ ROUND_TO_PAGE_SIZE(sizeof(intel_shared_info))); + ROUND_TO_PAGE_SIZE(sizeof(intel_shared_info)));
gInfo->status = (hardware_status *)((uint8 *)gInfo->overlay_registers + B_PAGE_SIZE); gInfo->status = (hardware_status *)((uint8 *)gInfo->overlay_registers + B_PAGE_SIZE);
gInfo->cursor_memory = (uint8 *)gInfo->overlay_registers + 2 * B_PAGE_SIZE;
if (gInfo->shared_info->hardware_cursor_enabled)
gInfo->cursor_memory = (uint8 *)gInfo->overlay_registers + 2 * B_PAGE_SIZE;
return B_OK; return B_OK;
} }
@@ -36,6 +36,8 @@ const struct supported_device {
int32 type; int32 type;
const char *name; const char *name;
} kSupportedDevices[] = { } kSupportedDevices[] = {
{0x3577, INTEL_TYPE_8xx | INTEL_TYPE_83x, "i830GM"},
{0x2572, INTEL_TYPE_8xx | INTEL_TYPE_85x, "i865G"}, {0x2572, INTEL_TYPE_8xx | INTEL_TYPE_85x, "i865G"},
{0x3582, INTEL_TYPE_8xx | INTEL_TYPE_85x, "i855G"}, {0x3582, INTEL_TYPE_8xx | INTEL_TYPE_85x, "i855G"},
}; };
@@ -92,10 +92,11 @@ init_overlay_registers(overlay_registers *registers)
} }
static size_t static void
determine_desired_memory_size() read_settings(size_t &memorySize, bool &hardwareCursor)
{ {
size_t size = 8; // 8 MB size_t size = 8; // 8 MB
hardwareCursor = true;
void *settings = load_driver_settings("intel_extreme"); void *settings = load_driver_settings("intel_extreme");
if (settings != NULL) { if (settings != NULL) {
@@ -104,6 +105,9 @@ determine_desired_memory_size()
if (string != NULL) if (string != NULL)
specified = atoi(string); specified = atoi(string);
hardwareCursor = get_driver_boolean_parameter(settings, "hardware_cursor",
true, true);
unload_driver_settings(settings); unload_driver_settings(settings);
if (specified != 0) { if (specified != 0) {
@@ -118,7 +122,7 @@ determine_desired_memory_size()
} }
} }
return size << 20; memorySize = size << 20;
} }
@@ -287,12 +291,16 @@ intel_extreme_init(intel_info &info)
memset((void *)info.shared_info, 0, sizeof(intel_shared_info)); memset((void *)info.shared_info, 0, sizeof(intel_shared_info));
// evaluate driver settings, if any
bool hardwareCursor;
size_t totalSize;
read_settings(totalSize, hardwareCursor);
// Determine the amount of "stolen" (ie. reserved by the BIOS) graphics memory // Determine the amount of "stolen" (ie. reserved by the BIOS) graphics memory
// and see if we need to allocate some more. // and see if we need to allocate some more.
// TODO: make it allocate the memory on demand! // TODO: make it allocate the memory on demand!
size_t totalSize = determine_desired_memory_size();
size_t stolenSize = determine_stolen_memory_size(info); size_t stolenSize = determine_stolen_memory_size(info);
totalSize = max_c(totalSize, stolenSize); totalSize = max_c(totalSize, stolenSize);
@@ -438,15 +446,18 @@ intel_extreme_init(intel_info &info)
// We also need to map the cursor memory into the GTT // We also need to map the cursor memory into the GTT
// This could also be part of the usual graphics memory, but since we info.shared_info->hardware_cursor_enabled = hardwareCursor;
// need to make sure it's not in the graphics local memory (and I don't if (hardwareCursor) {
// even know yet how to determine that a chip has local memory...), we // This could also be part of the usual graphics memory, but since we
// keep the current strategy and put it into the shared area. // need to make sure it's not in the graphics local memory (and I don't
// Unfortunately, the GTT is not readable until it has been written into // even know yet how to determine that a chip has local memory...), we
// the double buffered register set; we cannot get its original contents. // keep the current strategy and put it into the shared area.
// Unfortunately, the GTT is not readable until it has been written into
set_gtt_entry(info, totalSize, info.shared_info->physical_cursor_memory); // the double buffered register set; we cannot get its original contents.
info.shared_info->cursor_buffer_offset = totalSize;
set_gtt_entry(info, totalSize, info.shared_info->physical_cursor_memory);
info.shared_info->cursor_buffer_offset = totalSize;
}
init_interrupt_handler(info); init_interrupt_handler(info);