aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorFrancisco Jerez <currojerez@riseup.net>2010-07-30 07:57:54 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-08-05 18:33:41 -0400
commit2b495268fc596fd474d2a2cbbc711d8bb1e11e88 (patch)
tree05e5271a67d2bd8dca8e6c147b6dfc0c6764c1fa /drivers/gpu
parent0d3470d218949dc1307313647c70154c7452a68b (diff)
drm/nouveau: Fix AGP reset when AGP FW is already enabled on init.
Previously nouveau_mem_reset_agp() was only disabling AGP fast writes when coming back from suspend. However, the "locked out of the card because of FW" problem can also be reproduced on init if you unload/reload nouveau.ko several times. This patch makes the AGP code reset FW on init. Signed-off-by: Francisco Jerez <currojerez@riseup.net> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_mem.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_mem.c b/drivers/gpu/drm/nouveau/nouveau_mem.c
index 1f80dc6f81c2..47e5ad9cfda2 100644
--- a/drivers/gpu/drm/nouveau/nouveau_mem.c
+++ b/drivers/gpu/drm/nouveau/nouveau_mem.c
@@ -351,7 +351,7 @@ nouveau_mem_reset_agp(struct drm_device *dev)
351 /* First of all, disable fast writes, otherwise if it's 351 /* First of all, disable fast writes, otherwise if it's
352 * already enabled in the AGP bridge and we disable the card's 352 * already enabled in the AGP bridge and we disable the card's
353 * AGP controller we might be locking ourselves out of it. */ 353 * AGP controller we might be locking ourselves out of it. */
354 if (dev->agp->acquired) { 354 if (nv_rd32(dev, NV04_PBUS_PCI_NV_19) & PCI_AGP_COMMAND_FW) {
355 struct drm_agp_info info; 355 struct drm_agp_info info;
356 struct drm_agp_mode mode; 356 struct drm_agp_mode mode;
357 357
@@ -359,7 +359,7 @@ nouveau_mem_reset_agp(struct drm_device *dev)
359 if (ret) 359 if (ret)
360 return ret; 360 return ret;
361 361
362 mode.mode = info.mode & ~0x10; 362 mode.mode = info.mode & ~PCI_AGP_COMMAND_FW;
363 ret = drm_agp_enable(dev, mode); 363 ret = drm_agp_enable(dev, mode);
364 if (ret) 364 if (ret)
365 return ret; 365 return ret;
@@ -405,6 +405,8 @@ nouveau_mem_init_agp(struct drm_device *dev)
405 } 405 }
406 } 406 }
407 407
408 nouveau_mem_reset_agp(dev);
409
408 ret = drm_agp_info(dev, &info); 410 ret = drm_agp_info(dev, &info);
409 if (ret) { 411 if (ret) {
410 NV_ERROR(dev, "Unable to get AGP info: %d\n", ret); 412 NV_ERROR(dev, "Unable to get AGP info: %d\n", ret);
@@ -492,7 +494,6 @@ nouveau_mem_init(struct drm_device *dev)
492 /* GART */ 494 /* GART */
493#if !defined(__powerpc__) && !defined(__ia64__) 495#if !defined(__powerpc__) && !defined(__ia64__)
494 if (drm_device_is_agp(dev) && dev->agp && !nouveau_noagp) { 496 if (drm_device_is_agp(dev) && dev->agp && !nouveau_noagp) {
495 nouveau_mem_reset_agp(dev);
496 ret = nouveau_mem_init_agp(dev); 497 ret = nouveau_mem_init_agp(dev);
497 if (ret) 498 if (ret)
498 NV_ERROR(dev, "Error initialising AGP: %d\n", ret); 499 NV_ERROR(dev, "Error initialising AGP: %d\n", ret);