Patch by Euan Kirkhope:
* Kernel settings configuration added git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20274 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
a85694c375
commit
19cadc2f7d
headers/private/graphics/radeon
src/add-ons
@ -55,6 +55,19 @@ enum {
|
||||
// buffers in one chunk, the size per buffer in bytes must be a multiple of 4k
|
||||
#define INDIRECT_BUFFER_SIZE (4096/4)
|
||||
|
||||
typedef struct {
|
||||
uint32 loginfo;
|
||||
uint32 logflow;
|
||||
uint32 logerror;
|
||||
bool switchhead;
|
||||
bool force_lcd;
|
||||
bool dynamic_clocks; // power saving / management for mobility chips
|
||||
bool force_pci;
|
||||
bool unhide_fastwrites;
|
||||
bool force_acc_dma; // one or the other
|
||||
bool force_acc_mmio; // one or the other
|
||||
bool acc_writeback;
|
||||
} radeon_settings;
|
||||
|
||||
// type of memory
|
||||
typedef enum {
|
||||
@ -460,6 +473,8 @@ typedef struct {
|
||||
int blank_period; // vertical blank period of a frame in ms
|
||||
int enable_virtual_irq; // true, to enable virtual interrupts
|
||||
|
||||
radeon_settings settings; // settings from radeon.settings file
|
||||
|
||||
struct log_info_t *log; // fast logger data
|
||||
} shared_info;
|
||||
|
||||
|
@ -8,4 +8,4 @@
|
||||
*/
|
||||
|
||||
// current version
|
||||
#define RADEON_DRIVER_VERSION "Version: 5.1.3.1"
|
||||
#define RADEON_DRIVER_VERSION "Version: 5.1.3.5"
|
||||
|
@ -650,6 +650,11 @@ void Radeon_SetupDefaultMonitorRouting(
|
||||
virtual_card *vc = ai->vc;
|
||||
shared_info *si = ai->si;
|
||||
display_device_e display_devices = vc->connected_displays;
|
||||
|
||||
if (ai->si->settings.force_lcd) {
|
||||
use_laptop_panel = true;
|
||||
SHOW_FLOW0( 2, "LCD Forced Used by Kernel Settings");
|
||||
}
|
||||
|
||||
SHOW_FLOW( 2, "display_devices=%x, whished_num_heads=%d, use_laptop_panel=%d",
|
||||
display_devices, whished_num_heads, use_laptop_panel );
|
||||
|
@ -45,6 +45,89 @@ static device_hooks graphics_device_hooks = {
|
||||
NULL
|
||||
};
|
||||
|
||||
radeon_settings def_settings = { // see comments in radeon.settings
|
||||
2, // loginfo
|
||||
2, // logflow
|
||||
2, // logerror
|
||||
false, // switchhead
|
||||
false, // force_lcd
|
||||
true, // dynamic_clocks
|
||||
true, // force_pci
|
||||
false, // unhide_fw
|
||||
false, // acc_dma
|
||||
false, // acc_mmio
|
||||
true, // acc_wb
|
||||
};
|
||||
|
||||
radeon_settings current_settings;
|
||||
|
||||
static void GetDriverSettings(void)
|
||||
{
|
||||
|
||||
void *settings_handle = NULL;
|
||||
|
||||
SHOW_FLOW0( 1, "" );
|
||||
|
||||
// init settings to defaults;
|
||||
current_settings = def_settings;
|
||||
|
||||
// get driver/accelerant settings, apsed
|
||||
settings_handle = load_driver_settings ("radeon.settings");
|
||||
if (settings_handle != NULL) {
|
||||
const char *item;
|
||||
char *end;
|
||||
uint32 value;
|
||||
|
||||
item = get_driver_parameter (settings_handle, "loginfo", "2", "2");
|
||||
value = strtoul (item, &end, 0);
|
||||
if (*end == '\0' && value <= 4) {
|
||||
current_settings.loginfo = value;
|
||||
SHOW_INFO( 1, "Log Info Level now %ld/4", value );
|
||||
}
|
||||
|
||||
item = get_driver_parameter (settings_handle, "logflow", "2", "2");
|
||||
value = strtoul (item, &end, 0);
|
||||
if (*end == '\0' && value <= 4) {
|
||||
current_settings.logflow = value;
|
||||
SHOW_INFO( 1, "Log Flow Level now %ld/4", value );
|
||||
}
|
||||
|
||||
item = get_driver_parameter (settings_handle, "logerror", "2", "2");
|
||||
value = strtoul (item, &end, 0);
|
||||
if (*end == '\0' && value <= 4) {
|
||||
current_settings.logerror = value;
|
||||
SHOW_INFO( 1, "Log Error Level now %ld/4", value );
|
||||
}
|
||||
|
||||
current_settings.switchhead = get_driver_boolean_parameter (settings_handle, "switchhead", false, false);
|
||||
current_settings.force_lcd = get_driver_boolean_parameter (settings_handle, "force_lcd", false, false);
|
||||
current_settings.dynamic_clocks = get_driver_boolean_parameter (settings_handle, "dynamic_clocks", true, true);
|
||||
current_settings.force_pci = get_driver_boolean_parameter (settings_handle, "force_pci", true, true);
|
||||
current_settings.unhide_fastwrites = get_driver_boolean_parameter (settings_handle, "unhide_fw", false, false);
|
||||
current_settings.force_acc_dma = get_driver_boolean_parameter (settings_handle, "force_acc_dma", false, false);
|
||||
current_settings.force_acc_mmio = get_driver_boolean_parameter (settings_handle, "force_acc_mmio", false, false);
|
||||
current_settings.acc_writeback = get_driver_boolean_parameter (settings_handle, "acc_writeback", false, false);
|
||||
|
||||
if ( current_settings.switchhead != def_settings.switchhead )
|
||||
SHOW_INFO0( 1, "Switch Head = True" );
|
||||
if ( current_settings.force_lcd != def_settings.force_lcd )
|
||||
SHOW_INFO0( 1, "Force LCD ON" );
|
||||
if ( current_settings.dynamic_clocks != def_settings.dynamic_clocks )
|
||||
SHOW_INFO0( 1, "Mobility Power Saving Disabled (Dynamic Clocks)" );
|
||||
if ( current_settings.force_pci != def_settings.force_pci )
|
||||
SHOW_INFO0( 1, "Force PCI = True" );
|
||||
if ( current_settings.unhide_fastwrites != def_settings.unhide_fastwrites )
|
||||
SHOW_INFO0( 1, "use Fastwrites ON" );
|
||||
if ( current_settings.force_acc_dma != def_settings.force_acc_dma )
|
||||
SHOW_INFO0( 1, "DMA ACC Enabled" );
|
||||
if ( current_settings.force_acc_mmio != def_settings.force_acc_mmio )
|
||||
SHOW_INFO0( 1, "DMA ACC Disabled" );
|
||||
if ( current_settings.acc_writeback != def_settings.acc_writeback )
|
||||
SHOW_INFO0( 1, "DMA WriteBack Disabled" );
|
||||
|
||||
unload_driver_settings (settings_handle);
|
||||
}
|
||||
}
|
||||
|
||||
// public function: check whether there is *any* supported hardware
|
||||
status_t init_hardware( void )
|
||||
@ -74,6 +157,7 @@ status_t init_driver( void )
|
||||
|
||||
(void)INIT_BEN( devices->kernel, "Radeon Kernel" );
|
||||
|
||||
GetDriverSettings();
|
||||
Radeon_ProbeDevices();
|
||||
return B_OK;
|
||||
}
|
||||
|
@ -28,6 +28,7 @@
|
||||
#define get_pci(o, s) (*pci_bus->read_pci_config)(pcii->bus, pcii->device, pcii->function, (o), (s))
|
||||
#define set_pci(o, s, v) (*pci_bus->write_pci_config)(pcii->bus, pcii->device, pcii->function, (o), (s), (v))
|
||||
|
||||
extern radeon_settings current_settings;
|
||||
|
||||
// map frame buffer and registers
|
||||
// mmio_only - true = map registers only (used during detection)
|
||||
@ -229,7 +230,14 @@ status_t Radeon_FirstOpen( device_info *di )
|
||||
memset( di->si, 0, sizeof( *di->si ));
|
||||
|
||||
si = di->si;
|
||||
|
||||
si->settings = di->settings = current_settings;
|
||||
|
||||
if (di->settings.force_acc_dma)
|
||||
di->acc_dma = true;
|
||||
if (di->settings.force_acc_mmio) // force mmio will override dma... a tristate fuzzylogic, grey bool would be nice...
|
||||
di->acc_dma = false;
|
||||
|
||||
#ifdef ENABLE_LOGGING
|
||||
#ifdef LOG_INCLUDE_STARTUP
|
||||
si->log = log_init( 1000000 );
|
||||
|
@ -154,6 +154,8 @@ typedef struct device_info {
|
||||
|
||||
uint32 dac2_cntl; // original dac2_cntl register content
|
||||
|
||||
radeon_settings settings; // overrides read from radeon.settings
|
||||
|
||||
pci_info pcii;
|
||||
char name[MAX_RADEON_DEVICE_NAME_LENGTH];
|
||||
char video_name[MAX_RADEON_DEVICE_NAME_LENGTH];
|
||||
|
Loading…
x
Reference in New Issue
Block a user