Commit a32ed69d authored by Marcin Kościelnicki's avatar Marcin Kościelnicki Committed by Ben Skeggs

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: default avatarMarcin Kościelnicki <koriakin@0x04.net>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent f927b890
...@@ -75,6 +75,14 @@ MODULE_PARM_DESC(ignorelid, "Ignore ACPI lid status"); ...@@ -75,6 +75,14 @@ MODULE_PARM_DESC(ignorelid, "Ignore ACPI lid status");
int nouveau_ignorelid = 0; int nouveau_ignorelid = 0;
module_param_named(ignorelid, nouveau_ignorelid, int, 0400); module_param_named(ignorelid, nouveau_ignorelid, int, 0400);
MODULE_PARM_DESC(noagp, "Disable all acceleration");
int nouveau_noaccel = 0;
module_param_named(noaccel, nouveau_noaccel, int, 0400);
MODULE_PARM_DESC(noagp, "Disable fbcon acceleration");
int nouveau_nofbaccel = 0;
module_param_named(nofbaccel, nouveau_nofbaccel, int, 0400);
MODULE_PARM_DESC(tv_norm, "Default TV norm.\n" MODULE_PARM_DESC(tv_norm, "Default TV norm.\n"
"\t\tSupported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J,\n" "\t\tSupported: PAL, PAL-M, PAL-N, PAL-Nc, NTSC-M, NTSC-J,\n"
"\t\t\thd480i, hd480p, hd576i, hd576p, hd720p, hd1080i.\n" "\t\t\thd480i, hd480p, hd576i, hd576p, hd720p, hd1080i.\n"
......
...@@ -678,6 +678,8 @@ extern int nouveau_reg_debug; ...@@ -678,6 +678,8 @@ extern int nouveau_reg_debug;
extern char *nouveau_vbios; extern char *nouveau_vbios;
extern int nouveau_ctxfw; extern int nouveau_ctxfw;
extern int nouveau_ignorelid; extern int nouveau_ignorelid;
extern int nouveau_nofbaccel;
extern int nouveau_noaccel;
/* nouveau_state.c */ /* nouveau_state.c */
extern void nouveau_preclose(struct drm_device *dev, struct drm_file *); extern void nouveau_preclose(struct drm_device *dev, struct drm_file *);
......
...@@ -267,8 +267,12 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width, ...@@ -267,8 +267,12 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width,
dev_priv->fbdev_info = info; dev_priv->fbdev_info = info;
strcpy(info->fix.id, "nouveaufb"); strcpy(info->fix.id, "nouveaufb");
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA | if (nouveau_nofbaccel)
FBINFO_HWACCEL_FILLRECT | FBINFO_HWACCEL_IMAGEBLIT; info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_DISABLED;
else
info->flags = FBINFO_DEFAULT | FBINFO_HWACCEL_COPYAREA |
FBINFO_HWACCEL_FILLRECT |
FBINFO_HWACCEL_IMAGEBLIT;
info->fbops = &nouveau_fbcon_ops; info->fbops = &nouveau_fbcon_ops;
info->fix.smem_start = dev->mode_config.fb_base + nvbo->bo.offset - info->fix.smem_start = dev->mode_config.fb_base + nvbo->bo.offset -
dev_priv->vm_vram_base; dev_priv->vm_vram_base;
...@@ -316,7 +320,7 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width, ...@@ -316,7 +320,7 @@ nouveau_fbcon_create(struct drm_device *dev, uint32_t fb_width,
par->nouveau_fb = nouveau_fb; par->nouveau_fb = nouveau_fb;
par->dev = dev; par->dev = dev;
if (dev_priv->channel) { if (dev_priv->channel && !nouveau_nofbaccel) {
switch (dev_priv->card_type) { switch (dev_priv->card_type) {
case NV_50: case NV_50:
nv50_fbcon_accel_init(info); nv50_fbcon_accel_init(info);
......
...@@ -427,15 +427,19 @@ nouveau_card_init(struct drm_device *dev) ...@@ -427,15 +427,19 @@ nouveau_card_init(struct drm_device *dev)
if (ret) if (ret)
goto out_timer; goto out_timer;
/* PGRAPH */ if (nouveau_noaccel)
ret = engine->graph.init(dev); engine->graph.accel_blocked = true;
if (ret) else {
goto out_fb; /* PGRAPH */
ret = engine->graph.init(dev);
if (ret)
goto out_fb;
/* PFIFO */ /* PFIFO */
ret = engine->fifo.init(dev); ret = engine->fifo.init(dev);
if (ret) if (ret)
goto out_graph; goto out_graph;
}
/* this call irq_preinstall, register irq handler and /* this call irq_preinstall, register irq handler and
* call irq_postinstall * call irq_postinstall
...@@ -479,9 +483,11 @@ nouveau_card_init(struct drm_device *dev) ...@@ -479,9 +483,11 @@ nouveau_card_init(struct drm_device *dev)
out_irq: out_irq:
drm_irq_uninstall(dev); drm_irq_uninstall(dev);
out_fifo: out_fifo:
engine->fifo.takedown(dev); if (!nouveau_noaccel)
engine->fifo.takedown(dev);
out_graph: out_graph:
engine->graph.takedown(dev); if (!nouveau_noaccel)
engine->graph.takedown(dev);
out_fb: out_fb:
engine->fb.takedown(dev); engine->fb.takedown(dev);
out_timer: out_timer:
...@@ -518,8 +524,10 @@ static void nouveau_card_takedown(struct drm_device *dev) ...@@ -518,8 +524,10 @@ static void nouveau_card_takedown(struct drm_device *dev)
dev_priv->channel = NULL; dev_priv->channel = NULL;
} }
engine->fifo.takedown(dev); if (!nouveau_noaccel) {
engine->graph.takedown(dev); engine->fifo.takedown(dev);
engine->graph.takedown(dev);
}
engine->fb.takedown(dev); engine->fb.takedown(dev);
engine->timer.takedown(dev); engine->timer.takedown(dev);
engine->mc.takedown(dev); engine->mc.takedown(dev);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment