added 'block_acc' option in nvidia.settings to completely disable the acceleration engine. This lets my G72 run (not crash) for the first time when enabled. Note: Haiku becomes very slow in drawing in 32bit mode when the driver is running this way compared to vesa mode. I am assuming this is because of (too) fine-grained calling of the engine management functions. Never saw this effect AFAIK in BeOS.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@29381 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Rudolf Cornelissen
2009-03-02 19:55:03 +00:00
parent 54ec265881
commit 6042b7b665
8 changed files with 41 additions and 31 deletions
@@ -5,7 +5,7 @@
Other authors:
Mark Watson;
Apsed;
Rudolf Cornelissen 10/2002-6/2008.
Rudolf Cornelissen 10/2002-3/2009.
*/
#ifndef DRIVERINTERFACE_H
@@ -205,7 +205,7 @@ typedef struct {
uint32 size;
} int_buf_info;
typedef struct { // apsed, see comments in nv.settings
typedef struct { // apsed, see comments in nvidia.settings
// for driver
char accelerant[B_FILE_NAME_LENGTH];
char primary[B_FILE_NAME_LENGTH];
@@ -224,6 +224,7 @@ typedef struct { // apsed, see comments in nv.settings
bool vga_on_tv;
bool force_sync;
bool force_ws;
bool block_acc;
uint32 gpu_clk;
uint32 ram_clk;
} nv_settings;
@@ -4,7 +4,7 @@
other authors:
Mark Watson
Rudolf Cornelissen 3/2004-2/2005
Rudolf Cornelissen 3/2004-3/2009
*/
/*
@@ -34,8 +34,8 @@ status_t ACQUIRE_ENGINE_PIO(uint32 capabilities, uint32 max_wait, sync_token *st
/* sync if required */
if (st) SYNC_TO_TOKEN(st);
/* make sure all needed engine cmd's are mapped to the FIFO */
nv_acc_assert_fifo();
/* make sure all needed engine cmd's are mapped to the FIFO if acceleration isn't blocked */
if (!si->settings.block_acc) nv_acc_assert_fifo();
/* return an engine token */
*et = &nv_engine_token;
@@ -49,8 +49,8 @@ status_t ACQUIRE_ENGINE_DMA(uint32 capabilities, uint32 max_wait, sync_token *st
/* sync if required */
if (st) SYNC_TO_TOKEN(st);
/* make sure all needed engine cmd's are mapped to the FIFO */
nv_acc_assert_fifo_dma();
/* make sure all needed engine cmd's are mapped to the FIFO if acceleration isn't blocked */
if (!si->settings.block_acc) nv_acc_assert_fifo_dma();
/* return an engine token */
*et = &nv_engine_token;
@@ -69,6 +69,9 @@ status_t RELEASE_ENGINE(engine_token *et, sync_token *st)
void WAIT_ENGINE_IDLE(void)
{
/* do nothing if acceleration is te be blocked */
if (si->settings.block_acc) return;
/*wait for the engine to be totally idle*/
if (!si->settings.dma_acc)
nv_acc_wait_idle();
@@ -4,7 +4,7 @@
Other authors:
Mark Watson,
Rudolf Cornelissen 10/2002-1/2006
Rudolf Cornelissen 10/2002-3/2009
*/
#define MODULE_BIT 0x08000000
@@ -227,8 +227,8 @@ status_t check_acc_capability(uint32 feature)
}
/* hardware acceleration is only supported in modes with upto a certain
* memory pitch.. */
if (si->acc_mode)
* memory pitch.. and acceleration must not be blocked */
if (si->acc_mode && !si->settings.block_acc)
{
LOG(4, ("Acc: Exporting hook %s.\n", msg));
return B_OK;
@@ -4,7 +4,7 @@
Other authors:
Mark Watson,
Rudolf Cornelissen 10/2002-4/2006.
Rudolf Cornelissen 10/2002-3/2009.
*/
#define MODULE_BIT 0x00800000
@@ -42,8 +42,8 @@ static status_t init_common(int the_fd) {
si->settings.logmask, si->settings.memory, si->settings.hardcursor, si->settings.usebios, si->settings.switchhead, si->settings.force_pci));
LOG(4,("init_common: dumprom %d, unhide_fw %d, pgm_panel %d, dma_acc %d, tv_output %d, vga_on_tv %d\n",
si->settings.dumprom, si->settings.unhide_fw, si->settings.pgm_panel, si->settings.dma_acc, si->settings.tv_output, si->settings.vga_on_tv));
LOG(4,("init_common: force_sync %d, gpu_clk %dMhz, ram_clk %dMhz, force_ws %d\n",
si->settings.force_sync, si->settings.gpu_clk, si->settings.ram_clk, si->settings.force_ws));
LOG(4,("init_common: force_sync %d, gpu_clk %dMhz, ram_clk %dMhz, force_ws %d, block_acc %d\n",
si->settings.force_sync, si->settings.gpu_clk, si->settings.ram_clk, si->settings.force_ws, si->settings.block_acc));
/*Check for R4.5.0 and if it is running, use work around*/
{
@@ -6,7 +6,7 @@
Other authors:
Mark Watson,
Apsed,
Rudolf Cornelissen 11/2002-6/2008
Rudolf Cornelissen 11/2002-3/2009
*/
#define MODULE_BIT 0x00200000
@@ -292,10 +292,12 @@ status_t SET_DISPLAY_MODE(display_mode *mode_to_set)
/* note:
* Maybe later we can forget about non-DMA mode (depends on 3D acceleration
* attempts). */
if (!si->settings.dma_acc)
nv_acc_init();
else
nv_acc_init_dma();
if (!si->settings.block_acc) {
if (!si->settings.dma_acc)
nv_acc_init();
else
nv_acc_init_dma();
}
/* set up overlay unit for this mode */
nv_bes_init();
@@ -92,7 +92,7 @@ status_t nv_general_powerup()
{
status_t status;
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.85 running.\n"));
LOG(1,("POWERUP: Haiku nVidia Accelerant 0.86 running.\n"));
/* log VBLANK INT usability status */
if (si->ps.int_assigned)
@@ -4,7 +4,7 @@
Other authors:
Mark Watson;
Rudolf Cornelissen 3/2002-6/2008.
Rudolf Cornelissen 3/2002-3/2009.
*/
@@ -383,6 +383,7 @@ static nv_settings sSettings = { // see comments in nvidia.settings
false, // vga_on_tv
false, // force_sync
true, // force_ws
false, // block_acc
0, // gpu_clk
0, // ram_clk
};
@@ -1441,6 +1442,8 @@ init_driver(void)
"force_sync", false, false);
sSettings.force_ws = get_driver_boolean_parameter(settings,
"force_ws", false, false);
sSettings.block_acc = get_driver_boolean_parameter(settings,
"block_acc", false, false);
item = get_driver_parameter(settings, "gpu_clk", "0", "0");
value = strtoul(item, &end, 0);
@@ -4,29 +4,30 @@
# ~/config/settings/kernel/drivers/
#
# nv.driver parameters:
# nvidia driver parameters:
#accelerant "nvidia.accelerant" # if enabled selects accelerant filename to be used
#primary "10de_0110_010000" # if enabled selects device to be used as primary device ('hack')
dumprom false # dump bios rom to file (in home folder)
# nv.accelerant parameters:
usebios true # if true rely on bios to coldstart the card
# nvidia.accelerant parameters:
usebios true # if true rely on bios to coldstart the card
#memory 2 # in MB, override builtin memory size detection
hardcursor true # if true use on-chip cursor capabilities
#logmask 0x00000000 # nothing logged, is default
#logmask 0x08000604 # log overlay use in full to file (in home folder)
#logmask 0xffffffff # log everything to file (in home folder)
switchhead false # switch head assignment (dualhead cards only)
force_pci false # block AGP mode use if true (AGP cards only)
dma_acc true # if true enable DMA cmd fetching for 2D acc (instead of using PIO)
switchhead false # switch head assignment (dualhead cards only)
force_pci false # block AGP mode use if true (AGP cards only)
dma_acc true # if true enable DMA cmd fetching for 2D acc (instead of using PIO)
#tv_output 0 # disabled or 0 = autodetect, 1 = Y/C (and CVBS if possible), 2 = CVBS
force_sync false # if true forces 3D rendering to be synchronized to the vertical retrace
force_ws true # if true forces widescreen type detection for all connected screens
force_sync false # if true forces 3D rendering to be synchronized to the vertical retrace
force_ws true # if true forces widescreen type detection for all connected screens
block_acc false # if true disables the acceleration engine
# WARNING: tweak alert! modify stuff below on your own risk...
unhide_fw false # if true 'unhide' cards AGP fastwrite support on cards that hide it
pgm_panel false # if false don't program DVI and laptop panel pixelclocks (refreshrates)
vga_on_tv false # if true enables VGA output on the head outputting to TV
unhide_fw false # if true 'unhide' cards AGP fastwrite support on cards that hide it
pgm_panel false # if false don't program DVI and laptop panel pixelclocks (refreshrates)
vga_on_tv false # if true enables VGA output on the head outputting to TV
#gpu_clk 150 # in Mhz, (tries to) override default GPU clockspeed (be carefull!!!)
#ram_clk 150 # in Mhz, (tries to) override default cardRAM clockspeed (be carefull!!!)