On Fri, 6 Sep 2019 18:47:09 +0000 John Stultz wrote: > > +static int system_heap_allocate(struct dma_heap *heap, > + unsigned long len, > + unsigned long fd_flags, > + unsigned long heap_flags) > +{ > + struct heap_helper_buffer *helper_buffer; > + struct dma_buf *dmabuf; > + int ret = -ENOMEM; > + pgoff_t pg; > + > + helper_buffer = kzalloc(sizeof(*helper_buffer), GFP_KERNEL); > + if (!helper_buffer) > + return -ENOMEM; > + > + init_heap_helper_buffer(helper_buffer, system_heap_free); > + helper_buffer->flags = heap_flags; > + helper_buffer->heap = heap; > + helper_buffer->size = len; > + A couple of lines looks needed to handle len if it is not PAGE_SIZE aligned. > + helper_buffer->pagecount = len / PAGE_SIZE; > + helper_buffer->pages = kmalloc_array(helper_buffer->pagecount, > + sizeof(*helper_buffer->pages), > + GFP_KERNEL); _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel