diff options
| author | Marcin KoĆcielnicki <koriakin@0x04.net> | 2010-01-26 09:00:42 -0500 |
|---|---|---|
| committer | Ben Skeggs <bskeggs@redhat.com> | 2010-02-08 21:47:59 -0500 |
| commit | a32ed69d7bb3cd259d813d71281d62993b9a70fd (patch) | |
| tree | 522ba514c640c2eb75037d50cce33f4e5914766b | |
| parent | f927b8907cb25943d6275d4ea036c065b8fd3f33 (diff) | |
drm/nouveau: Add module options to disable acceleration.
noaccel=1 disables all acceleration and doesn't even attempt
initialising PGRAPH+PFIFO, nofbaccel=1 only makes fbcon unaccelerated.
Signed-off-by: Marcin KoĆcielnicki <koriakin@0x04.net>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.c | 8 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_drv.h | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_fbcon.c | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/nouveau/nouveau_state.c | 32 |
4 files changed, 37 insertions, 15 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.c b/drivers/gpu/drm/nouveau/nouveau_drv.c index fc692e5553ad..da3b93b84502 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.c +++ b/drivers/gpu/drm/nouveau/nouveau_drv.c | |||
| @@ -75,6 +75,14 @@ MODULE_PARM_DESC(ignorelid, "Ignore ACPI lid status"); | |||
| 75 | int nouveau_ignorelid = 0; | 75 | int nouveau_ignorelid = 0; |
| 76 | module_param_named(ignorelid, nouveau_ignorelid, int, 0400); | 76 | module_param_named(ignorelid, nouveau_ignorelid, int, 0400); |
| 77 | 77 | ||
| 78 | MODULE_PARM_DESC(noagp, "Disable all acceleration"); | ||
| 79 | int nouveau_noaccel = 0; | ||
| 80 | module_param_named(noaccel, nouveau_noaccel, int, 0400); | ||
| 81 | |||
| 82 | MODULE_PARM_DESC(noagp, "Disable fbcon acceleration"); | ||
| 83 | int nouveau_nofbaccel = 0; | ||
| 84 | module_param_named(nofbaccel, nouveau_nofbaccel, int, 0400); | ||
| 85 | |||
| 78 | MODULE_PARM_DESC(tv_norm, "Default TV norm.\n" | 86 | MODULE_PARM_DESC(tv_norm, "Default TV norm.\n" |
| 79 | "\t\tSupported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J,\n" | 87 | "\t\tSupported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J,\n" |
| 80 | "\t\t\thd480i, hd480p, hd576i, hd576p, hd720p, hd1080i.\n" | 88 | "\t\t\thd480i, hd480p, hd576i, hd576p, hd720p, hd1080i.\n" |
diff --git a/drivers/gpu/drm/nouveau/nouveau_drv.h b/drivers/gpu/drm/nouveau/nouveau_drv.h index 6b9690418bc7..5445cefdd03e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_drv.h +++ b/drivers/gpu/drm/nouveau/nouveau_drv.h | |||
| @@ -678,6 +678,8 @@ extern int nouveau_reg_debug; | |||
| 678 | extern char *nouveau_vbios; | 678 | extern char *nouveau_vbios; |
| 679 | extern int nouveau_ctxfw; | 679 | extern int nouveau_ctxfw; |
| 680 | extern int nouveau_ignorelid; | 680 | extern int nouveau_ignorelid; |
| 681 | extern int nouveau_nofbaccel; | ||
| 682 | extern int nouveau_noaccel; | ||
| 681 | 683 | ||
| 682 | /* nouveau_state.c */ | 684 | /* nouveau_state.c */ |
| 683 | extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); | 685 | extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_fbcon.c b/drivers/gpu/drm/nouveau/nouveau_fbcon.c index 0b05c869e0e7..eddadaccc285 100644 --- a/drivers/gpu/drm/nouveau/nouveau_fbcon.c +++ b/drivers/gpu/drm/nouveau/nouveau_fbcon.c | |||
| @@ -267,8 +267,12 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width, | |||
| 267 | dev_priv->fbdev_info = info; | 267 | dev_priv->fbdev_info = info; |
| 268 | 268 | ||
| 269 | strcpy(info->fix.id, "nouveaufb"); | 269 | strcpy(info->fix.id, "nouveaufb"); |
| 270 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA | | 270 | if (nouveau_nofbaccel) |
| 271 | FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_IMAGEBLIT; | 271 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_DISABLED; |
| 272 | else | ||
| 273 | info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA | | ||
| 274 | FBINFO_HWACCEL_FILLRECT | | ||
| 275 | FBINFO_HWACCEL_IMAGEBLIT; | ||
| 272 | info->fbops = &nouveau_fbcon_ops; | 276 | info->fbops = &nouveau_fbcon_ops; |
| 273 | info->fix.smem_start = dev->mode_config.fb_base + nvbo->bo.offset - | 277 | info->fix.smem_start = dev->mode_config.fb_base + nvbo->bo.offset - |
| 274 | dev_priv->vm_vram_base; | 278 | dev_priv->vm_vram_base; |
| @@ -316,7 +320,7 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width, | |||
| 316 | par->nouveau_fb = nouveau_fb; | 320 | par->nouveau_fb = nouveau_fb; |
| 317 | par->dev = dev; | 321 | par->dev = dev; |
| 318 | 322 | ||
| 319 | if (dev_priv->channel) { | 323 | if (dev_priv->channel && !nouveau_nofbaccel) { |
| 320 | switch (dev_priv->card_type) { | 324 | switch (dev_priv->card_type) { |
| 321 | case NV_50: | 325 | case NV_50: |
| 322 | nv50_fbcon_accel_init(info); | 326 | nv50_fbcon_accel_init(info); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_state.c b/drivers/gpu/drm/nouveau/nouveau_state.c index f2d0187ba152..241e24d60eb4 100644 --- a/drivers/gpu/drm/nouveau/nouveau_state.c +++ b/drivers/gpu/drm/nouveau/nouveau_state.c | |||
| @@ -427,15 +427,19 @@ nouveau_card_init(struct drm_device *dev) | |||
| 427 | if (ret) | 427 | if (ret) |
| 428 | goto out_timer; | 428 | goto out_timer; |
| 429 | 429 | ||
| 430 | /* PGRAPH */ | 430 | if (nouveau_noaccel) |
| 431 | ret = engine->graph.init(dev); | 431 | engine->graph.accel_blocked = true; |
| 432 | if (ret) | 432 | else { |
| 433 | goto out_fb; | 433 | /* PGRAPH */ |
| 434 | ret = engine->graph.init(dev); | ||
| 435 | if (ret) | ||
| 436 | goto out_fb; | ||
| 434 | 437 | ||
| 435 | /* PFIFO */ | 438 | /* PFIFO */ |
| 436 | ret = engine->fifo.init(dev); | 439 | ret = engine->fifo.init(dev); |
| 437 | if (ret) | 440 | if (ret) |
| 438 | goto out_graph; | 441 | goto out_graph; |
| 442 | } | ||
| 439 | 443 | ||
| 440 | /* this call irq_preinstall, register irq handler and | 444 | /* this call irq_preinstall, register irq handler and |
| 441 | * call irq_postinstall | 445 | * call irq_postinstall |
| @@ -479,9 +483,11 @@ nouveau_card_init(struct drm_device *dev) | |||
| 479 | out_irq: | 483 | out_irq: |
| 480 | drm_irq_uninstall(dev); | 484 | drm_irq_uninstall(dev); |
| 481 | out_fifo: | 485 | out_fifo: |
| 482 | engine->fifo.takedown(dev); | 486 | if (!nouveau_noaccel) |
| 487 | engine->fifo.takedown(dev); | ||
| 483 | out_graph: | 488 | out_graph: |
| 484 | engine->graph.takedown(dev); | 489 | if (!nouveau_noaccel) |
| 490 | engine->graph.takedown(dev); | ||
| 485 | out_fb: | 491 | out_fb: |
| 486 | engine->fb.takedown(dev); | 492 | engine->fb.takedown(dev); |
| 487 | out_timer: | 493 | out_timer: |
| @@ -518,8 +524,10 @@ static void nouveau_card_takedown(struct drm_device *dev) | |||
| 518 | dev_priv->channel = NULL; | 524 | dev_priv->channel = NULL; |
| 519 | } | 525 | } |
| 520 | 526 | ||
| 521 | engine->fifo.takedown(dev); | 527 | if (!nouveau_noaccel) { |
| 522 | engine->graph.takedown(dev); | 528 | engine->fifo.takedown(dev); |
| 529 | engine->graph.takedown(dev); | ||
| 530 | } | ||
| 523 | engine->fb.takedown(dev); | 531 | engine->fb.takedown(dev); |
| 524 | engine->timer.takedown(dev); | 532 | engine->timer.takedown(dev); |
| 525 | engine->mc.takedown(dev); | 533 | engine->mc.takedown(dev); |
