Displaying 3 results from an estimated 3 matches for "nouveau_mem_agp".
2008 Mar 09
0
[PATCH 4/4] nouveau: clean up nouveau_mem_alloc function
...{
+ struct mem_block *block;
+ int err;
+
+ block = nouveau_mem_alloc_block(heap, size, alignment, file_priv);
+ if (!block)
+ return NULL;
+ block->flags = type;
+
+ /*
+ * Does 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;...
2008 Mar 09
0
[PATCH 1/4] nouveau: add nouveau_addmap_{agp, fb, pci} functions
...ddmap(dev, block, block->start, type);
+}
+
struct mem_block* nouveau_mem_alloc(struct drm_device *dev, int alignment,
uint64_t size, int flags,
struct drm_file *file_priv)
@@ -590,21 +623,12 @@ alloc_ok:
int ret = 0;
block->flags|=NOUVEAU_MEM_MAPPED;
- if (type == NOUVEAU_MEM_AGP) {
- if (dev_priv->gart_info.type != NOUVEAU_GART_SGDMA)
- ret = drm_addmap(dev, block->start, block->size,
- _DRM_AGP, 0, &block->map);
- else
- ret = drm_addmap(dev, block->start, block->size,
- _DRM_SCATTER_GATHER, 0, &block->map);
- }
+ if (type...
2008 Mar 09
0
[PATCH 2/4] nouveau: add nouveau_map_block function
...int nouveau_addmap(struct drm_device *dev, struct mem_block *block,
unsigned long offset, enum drm_map_type type)
{
@@ -619,9 +633,7 @@ alloc_ok:
if (flags&NOUVEAU_MEM_MAPPED)
{
- struct drm_map_list *entry;
int ret = 0;
- block->flags|=NOUVEAU_MEM_MAPPED;
if (type == NOUVEAU_MEM_AGP)
ret = nouveau_addmap_agp(dev, block);
@@ -635,12 +647,10 @@ alloc_ok:
return NULL;
}
- entry = drm_find_matching_map(dev, block->map);
- if (!entry) {
+ if (!nouveau_map_block(dev, block)) {
nouveau_mem_free_block(block);
return NULL;
}
- block->map_handle = entry...