Displaying 4 results from an estimated 4 matches for "alloc_ok".
Did you mean:
alloc_bh
2008 Mar 09
0
[PATCH 4/4] nouveau: clean up nouveau_mem_alloc function
...file_priv);
+ if (block)
+ goto out;
+ }
-#define NOUVEAU_MEM_ALLOC_AGP {\
- type=NOUVEAU_MEM_AGP;\
- block = nouveau_mem_alloc_block(dev_priv->agp_heap, size,\
- alignment, file_priv); \
- if (block) goto alloc_ok;\
- }
-
-#define NOUVEAU_MEM_ALLOC_PCI {\
- type = NOUVEAU_MEM_PCI;\
- block = nouveau_mem_alloc_block(dev_priv->pci_heap, size, \
- alignment, file_priv); \
- if ( block ) goto alloc_ok;\
- }
-
-#define NOUVEAU_MEM_ALLOC_FB {\
-...
2008 Mar 09
0
[PATCH 2/4] nouveau: add nouveau_map_block function
...gt;map);
+ if (!entry)
+ return -EINVAL;
+
+ block->map_handle = entry->user_token;
+ block->flags |= NOUVEAU_MEM_MAPPED;
+ return 0;
+}
+
static 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,...
2008 Mar 09
0
[PATCH 1/4] nouveau: add nouveau_addmap_{agp, fb, pci} functions
...DMA)
+ type = _DRM_SCATTER_GATHER;
+ else
+ type = _DRM_AGP;
+
+ return nouveau_addmap(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->st...
2008 Mar 09
0
[PATCH 3/4] nouveau: move nouveau_map_block() call to nouveau_addmap()
...&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%08x\n", block->size, block->start, block->flags);