Displaying 3 results from an estimated 3 matches for "nouveau_addmap_pci".
2008 Mar 09
0
[PATCH 1/4] nouveau: add nouveau_addmap_{agp, fb, pci} functions
...int nouveau_mem_init(struct drm_device *
return 0;
}
+static int nouveau_addmap(struct drm_device *dev, struct mem_block *block,
+ unsigned long offset, enum drm_map_type type)
+{
+ return drm_addmap(dev, block->start, block->size, type, 0,
+ &block->map);
+}
+
+static int nouveau_addmap_pci(struct drm_device *dev, struct mem_block *block)
+{
+ return nouveau_addmap(dev, block, block->start, _DRM_SCATTER_GATHER);
+}
+
+static int nouveau_addmap_fb(struct drm_device *dev, struct mem_block *block)
+{
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+ unsigned long offset...
2008 Mar 09
0
[PATCH 4/4] nouveau: clean up nouveau_mem_alloc function
...es the block need mapping?
+ */
+ if (!(flags & NOUVEAU_MEM_MAPPED))
+ return block;
+
+ switch (type) {
+ case NOUVEAU_MEM_AGP:
+ err = nouveau_addmap_agp(dev, block);
+ break;
+ case NOUVEAU_MEM_FB:
+ err = nouveau_addmap_fb(dev, block);
+ break;
+ case NOUVEAU_MEM_PCI:
+ err = nouveau_addmap_pci(dev, block);
+ break;
+ default:
+ err = -EINVAL;
+ break;
+ };
+ if (err)
+ goto error;
+
+ return block;
+error:
+ nouveau_mem_free_block(block);
+ return NULL;
+}
+
+static struct mem_block *
+nouveau_mem_alloc_pci(struct drm_device *dev, uint64_t size, int alignment,
+ int flags,...
2008 Mar 09
0
[PATCH 3/4] nouveau: move nouveau_map_block() call to nouveau_addmap()
...rm_map_type type)
{
- return drm_addmap(dev, block->start, block->size, type, 0,
- &block->map);
+ int err;
+
+ err = drm_addmap(dev, block->start, block->size, type, 0, &block->map);
+ if (err)
+ return err;
+
+ return nouveau_map_block(dev, block);
}
static int nouveau_addmap_pci(struct drm_device *dev, struct mem_block *block)
@@ -646,11 +651,6 @@ alloc_ok:
nouveau_mem_free_block(block);
return NULL;
}
-
- if (!nouveau_map_block(dev, block)) {
- nouveau_mem_free_block(block);
- return NULL;
- }
}
DRM_DEBUG("allocated %lld bytes at 0x%llx type=0x...