fixed bug that prevented PCIE cards from actually using PCIGART - NV50 will probably...
authorArthur Huillet <arthur.huillet@free.fr>
Wed, 11 Jul 2007 12:56:27 +0000 (14:56 +0200)
committerArthur Huillet <arthur.huillet@free.fr>
Wed, 11 Jul 2007 12:56:27 +0000 (14:56 +0200)
shared-core/nouveau_fifo.c
shared-core/nouveau_mem.c
shared-core/nouveau_state.c

index fcdc14c..88f66d7 100644 (file)
@@ -217,7 +217,7 @@ nouveau_fifo_cmdbuf_alloc(struct drm_device *dev, int channel)
                                cb->size,
                                NV_DMA_ACCESS_RO, NV_DMA_TARGET_AGP, &pushbuf);
        } else if ( cb->flags & NOUVEAU_MEM_PCI) {
-               DRM_DEBUG("Creating CB in PCI memory starting at virt 0x%08llx size %d\n", cb->start, cb->size);
+               DRM_DEBUG("Creating CB in PCI memory\n", cb->start, cb->size);
                ret = nouveau_gpuobj_dma_new(dev, channel,
                                NV_CLASS_DMA_IN_MEMORY,
                                cb->start,
index 79f94fd..c545acf 100644 (file)
@@ -345,9 +345,9 @@ int nouveau_mem_init(struct drm_device *dev)
 
                dev_priv->agp_phys              = info.aperture_base;
                dev_priv->agp_available_size    = info.aperture_size;
+               goto have_agp;
        }
 
-goto have_agp;
 no_agp:
        dev_priv->pci_heap = NULL;
        DRM_DEBUG("Allocating sg memory for PCI DMA\n");
@@ -357,8 +357,7 @@ no_agp:
                goto no_pci;
                }
 
-       DRM_DEBUG("Got %d KiB\n", (dev->sg->pages * PAGE_SIZE) >> 10);
-       if ( nouveau_mem_init_heap(&dev_priv->pci_heap, dev->sg->virtual, dev->sg->pages * PAGE_SIZE))
+       if ( nouveau_mem_init_heap(&dev_priv->pci_heap, (uint64_t) dev->sg->virtual, dev->sg->pages * PAGE_SIZE))
                {
                DRM_ERROR("Unable to initialize pci_heap!");    
                goto no_pci;
index 14b33a4..fe3db16 100644 (file)
@@ -445,11 +445,11 @@ int nouveau_ioctl_getparam(DRM_IOCTL_ARGS)
                break;
        case NOUVEAU_GETPARAM_PCI_PHYSICAL:
                if ( dev -> sg )
-                       getparam.value=dev->sg->virtual;
+                       getparam.value=(uint64_t) dev->sg->virtual;
                else 
                     {
                     DRM_ERROR("Requested PCIGART address, while no PCIGART was created\n");
-                    DRM_ERR(EINVAL);
+                    return DRM_ERR(EINVAL);
                     }
                break;
        case NOUVEAU_GETPARAM_FB_SIZE: