Commit de5899bd authored by Francisco Jerez's avatar Francisco Jerez Committed by Ben Skeggs

drm/nouveau: Add module parameter to override the default AGP rate.

Signed-off-by: default avatarFrancisco Jerez <currojerez@riseup.net>
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 71d06186
...@@ -35,9 +35,9 @@ ...@@ -35,9 +35,9 @@
#include "drm_pciids.h" #include "drm_pciids.h"
MODULE_PARM_DESC(noagp, "Disable AGP"); MODULE_PARM_DESC(agpmode, "AGP mode (0 to disable AGP)");
int nouveau_noagp; int nouveau_agpmode = -1;
module_param_named(noagp, nouveau_noagp, int, 0400); module_param_named(agpmode, nouveau_agpmode, int, 0400);
MODULE_PARM_DESC(modeset, "Enable kernel modesetting"); MODULE_PARM_DESC(modeset, "Enable kernel modesetting");
static int nouveau_modeset = -1; /* kms */ static int nouveau_modeset = -1; /* kms */
......
...@@ -659,7 +659,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo) ...@@ -659,7 +659,7 @@ nouveau_bo_ref(struct nouveau_bo *ref, struct nouveau_bo **pnvbo)
} while (0) } while (0)
/* nouveau_drv.c */ /* nouveau_drv.c */
extern int nouveau_noagp; extern int nouveau_agpmode;
extern int nouveau_duallink; extern int nouveau_duallink;
extern int nouveau_uscript_lvds; extern int nouveau_uscript_lvds;
extern int nouveau_uscript_tmds; extern int nouveau_uscript_tmds;
......
...@@ -430,6 +430,16 @@ get_agp_mode(struct drm_device *dev, unsigned long mode) ...@@ -430,6 +430,16 @@ get_agp_mode(struct drm_device *dev, unsigned long mode)
if (dev_priv->chipset == 0x18) if (dev_priv->chipset == 0x18)
mode &= ~PCI_AGP_COMMAND_FW; mode &= ~PCI_AGP_COMMAND_FW;
/*
* AGP mode set in the command line.
*/
if (nouveau_agpmode > 0) {
bool agpv3 = mode & 0x8;
int rate = agpv3 ? nouveau_agpmode / 4 : nouveau_agpmode;
mode = (mode & ~0x7) | (rate & 0x7);
}
return mode; return mode;
} }
#endif #endif
...@@ -613,7 +623,7 @@ nouveau_mem_gart_init(struct drm_device *dev) ...@@ -613,7 +623,7 @@ nouveau_mem_gart_init(struct drm_device *dev)
dev_priv->gart_info.type = NOUVEAU_GART_NONE; dev_priv->gart_info.type = NOUVEAU_GART_NONE;
#if !defined(__powerpc__) && !defined(__ia64__) #if !defined(__powerpc__) && !defined(__ia64__)
if (drm_device_is_agp(dev) && dev->agp && !nouveau_noagp) { if (drm_device_is_agp(dev) && dev->agp && nouveau_agpmode) {
ret = nouveau_mem_init_agp(dev); ret = nouveau_mem_init_agp(dev);
if (ret) if (ret)
NV_ERROR(dev, "Error initialising AGP: %d\n", ret); NV_ERROR(dev, "Error initialising AGP: %d\n", ret);
......
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