tech-x11 archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: DRM scatter/gather mem allocation fix



On Fri, Apr 03, 2009 at 09:19:09PM -0400, Rafal Boni wrote:

> -     entry = malloc(sizeof(*entry), M_DRM, M_WAITOK | M_ZERO);
> +     entry = malloc(sizeof(*entry), M_DRM, M_ZERO | M_NOWAIT);
...
> +         M_ZERO | M_NOWAIT);
> +     dmah = malloc(sizeof(struct drm_dma_handle), M_DRM,
> +         M_ZERO | M_NOWAIT);
...
> +     ret = bus_dmamem_alloc(dmah->dmat, request->size, PAGE_SIZE, 0,
> +         dmah->segs, 1, &nsegs, BUS_DMA_NOWAIT);
...
> +     ret = bus_dmamem_map(dmah->dmat, dmah->segs, nsegs, request->size,
> +          &dmah->addr, BUS_DMA_NOWAIT | BUS_DMA_COHERENT);
...
> +     ret = bus_dmamap_create(dmah->dmat, request->size, pages, PAGE_SIZE,
> +             0, BUS_DMA_NOWAIT | BUS_DMA_ALLOCNOW, &dmah->map);

- Do these need to be NOWAIT allocations? See kmem_alloc(9)
- Can you use kmem_alloc+kmem_free?

Thanks.


Home | Main Index | Thread Index | Old Index